本文整理汇总了C#中WCell.RealmServer.Entities.WorldObject类的典型用法代码示例。如果您正苦于以下问题:C# WorldObject类的具体用法?C# WorldObject怎么用?C# WorldObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldObject类属于WCell.RealmServer.Entities命名空间,在下文中一共展示了WorldObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IsFriendly
public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
{
if (effectHandler.Cast.CasterObject.MayAttack(target))
{
failedReason = SpellFailedReason.TargetEnemy;
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:DefaultTargetFilters.cs
示例2: Apply
protected override void Apply(WorldObject target)
{
var chr = (Character)target;
if (Effect.Spell.RequiredItemClass == ItemClass.Weapon && !chr.Skills.WeaponProficiency.HasAnyFlag(Effect.Spell.RequiredItemSubClassMask))
{
chr.Skills.WeaponProficiency |= Effect.Spell.RequiredItemSubClassMask;
CharacterHandler.SendProficiency(chr, ItemClass.Weapon, chr.Skills.WeaponProficiency);
}
else if (Effect.Spell.RequiredItemClass == ItemClass.Armor && !chr.Skills.ArmorProficiency.HasAnyFlag(Effect.Spell.RequiredItemSubClassMask))
{
chr.Skills.ArmorProficiency |= Effect.Spell.RequiredItemSubClassMask;
CharacterHandler.SendProficiency(chr, ItemClass.Armor, chr.Skills.ArmorProficiency);
}
if (Effect.Spell.Ability == null)
{
log.Warn("Spell {0} had Handler for Proficiency but Spell has no Skill associated with it.", Effect.Spell);
}
else if (!chr.Skills.Contains(Effect.Spell.Ability.Skill.Id))
{
chr.Skills.Add(Effect.Spell.Ability.Skill, false);
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:27,代码来源:AddProficiencyHandler.cs
示例3: InitializeTarget
public override SpellFailedReason InitializeTarget(WorldObject target)
{
//if (((Unit)target).Health >= ((Unit)target).MaxHealth) {
// return SpellFailedReason.AlreadyAtFullHealth;
//}
return SpellFailedReason.Ok;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:HealMaxHealth.cs
示例4: Apply
protected override void Apply(WorldObject target)
{
if (Effect.Spell.IsHearthStoneSpell && m_cast.CasterChar != null)
{
// teleport back home
var pos = m_cast.CasterChar.BindLocation;
target.AddMessage(() => ((Unit)target).TeleportTo(pos));
}
else
{
if (Effect.ImplicitTargetB == ImplicitSpellTargetType.BehindTargetLocation)
{
var unit = (Unit)target;
if (unit != null)
{
var o = unit.Orientation;
var newx = unit.Position.X - (unit.BoundingRadius + 0.5f) * (float)Math.Cos(o);
var newy = unit.Position.Y - (unit.BoundingRadius + 0.5f) * (float)Math.Sin(o);
var newpos = new Util.Graphics.Vector3(newx, newy, unit.Position.Z);
m_cast.CasterChar.TeleportTo(newpos, o);
}
}
else
{
// teleport to given target location
var map = m_cast.TargetMap;
var pos = m_cast.TargetLoc;
var ori = m_cast.TargetOrientation;
target.AddMessage(() => ((Unit)target).TeleportTo(map, pos, ori));
}
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:32,代码来源:TeleportUnits.cs
示例5: Apply
protected override void Apply(WorldObject target)
{
var npc = (NPC)target;
npc.ThreatCollection[(Unit)m_cast.Caster] +=
((Unit)m_cast.Caster).GetGeneratedThreat(CalcEffectValue(), Effect.Spell.Schools[0], Effect);
}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:ThreatHandler.cs
示例6: IsHostileOrHealable
/// <summary>
/// Duel target type
/// </summary>
/// <param name="targets"></param>
/// <param name="target"></param>
/// <param name="failedReason"></param>
public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
{
var caster = effectHandler.Cast.CasterObject;
var spell = effectHandler.Cast.Spell;
var isHarmful = spell.HasHarmfulEffects;
var isHarmfulAndBeneficial = spell.HasHarmfulEffects == spell.HasBeneficialEffects;
if (!isHarmfulAndBeneficial)
{
if (isHarmful != caster.MayAttack(target))
{
if (isHarmful)
{
failedReason = SpellFailedReason.TargetFriendly;
}
else
{
failedReason = SpellFailedReason.TargetEnemy;
}
}
else if (isHarmful && !target.CanBeHarmed)
{
failedReason = SpellFailedReason.NotHere;
}
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:32,代码来源:DefaultTargetFilters.cs
示例7: Apply
protected override void Apply(WorldObject target)
{
Unit unit;
if (target is Unit)
{
unit = (Unit) target;
}
else if (target is Corpse)
{
unit = ((Corpse)target).Owner;
if (unit == null || unit.IsAlive)
{
return;
}
}
else
{
return;
}
unit.Health = CalcEffectValue();
if (((Unit)target).PowerType == PowerType.Mana)
{
((Unit)target).Energize(Effect.MiscValue, m_cast.CasterUnit, Effect);
}
}
开发者ID:remixod,项目名称:netServer,代码行数:26,代码来源:ResurrectFlat.cs
示例8: Apply
protected override void Apply(WorldObject target)
{
var chr = target as Character;
chr.TaxiNodes.Activate((uint)Effect.MiscValue);
TaxiHandler.SendTaxiPathActivated(chr.Client);
TaxiHandler.SendTaxiPathUpdate(chr.Client, Cast.CasterUnit.EntityId, true);
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:TeachFlightPath.cs
示例9: Apply
protected override void Apply(WorldObject target)
{
if (!target.IsPlayer)
{
base.Apply(target);
}
}
开发者ID:remixod,项目名称:netServer,代码行数:7,代码来源:MiscSpells.cs
示例10: GossipConversation
/// <summary>
/// Creates gossip conversation by its fields
/// </summary>
/// <param name="menu">starting menu</param>
/// <param name="chr">character which started the conversation</param>
/// <param name="speaker">respondent</param>
public GossipConversation(GossipMenu menu, Character chr, WorldObject speaker, bool keepOpen)
{
CurrentMenu = menu;
Character = chr;
Speaker = speaker;
StayOpen = keepOpen;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:13,代码来源:GossipConversation.cs
示例11: Apply
protected override void Apply(WorldObject target)
{
var chr = target as Character;
if (chr != null)
{
if (target.IsFriendlyWith(Cast.CasterChar))
{
chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
if (Cast.Spell.Id == (int)SpellId.ClassSkillDispelMagicRank2)
{
chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
}
if (Cast.CasterChar.Spells.Contains(SpellId.GlyphOfDispelMagic) || Cast.CasterChar.Spells.Contains(SpellId.GlyphOfDispelMagic_2))
{
int amountToHeal = (chr.Health * 3) / 100;
chr.Target.Heal(amountToHeal, Cast.CasterChar, Effect);
}
}
else
{
chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasBeneficialEffects);
if (Cast.Spell.Id == (int)SpellId.ClassSkillDispelMagicRank2)
{
chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
}
}
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:29,代码来源:PriestFixes.cs
示例12: Apply
protected override void Apply(WorldObject target)
{
if (target.IsUsingSpell)
{
target.SpellCast.Cancel(SpellFailedReason.Interrupted);
}
}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:InterruptCast.cs
示例13: CasterInfo
public CasterInfo(WorldObject caster)
{
CasterId = caster.EntityId;
Level = caster.CasterLevel;
m_caster = caster;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:CasterInfo.cs
示例14: Apply
protected override void Apply(WorldObject target)
{
var chr = target as Character;
if (m_cast.CasterUnit != null && m_cast.CasterUnit is NPC)
{
chr.QuestLog.OnNPCInteraction((NPC)m_cast.CasterUnit);
}
}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:KillCreditPersonal.cs
示例15: MatchesRequiredTargetType
public bool MatchesRequiredTargetType(WorldObject obj)
{
if (RequiredTargetType == RequiredSpellTargetType.GameObject)
{
return obj is GameObject;
}
return obj is NPC && ((NPC) obj).IsAlive == (RequiredTargetType == RequiredSpellTargetType.NPCAlive);
}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:8,代码来源:Spell.Overrides.cs
示例16: Apply
protected override void Apply(WorldObject target)
{
if (((Unit)target).PowerType == PowerType.Mana)
{
var manavalue = ((((Unit)target).MaxPower * Effect.MiscValue) / 100);
((Unit)target).Energize(m_cast.Caster, manavalue, Effect);
}
}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:RestoreManaPercent.cs
示例17: InitializeTarget
public override SpellFailedReason InitializeTarget(WorldObject target)
{
//if (!target.IsUsingSpell)
//{
// return SpellFailedReason.
//}
return base.InitializeTarget(target);
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:InterruptCast.cs
示例18: InitializeTarget
public override SpellFailedReason InitializeTarget(WorldObject target)
{
if (((Unit)target).Power == ((Unit)target).MaxPower)
{
return ((Unit)target).PowerType == PowerType.Mana ? SpellFailedReason.AlreadyAtFullMana : SpellFailedReason.AlreadyAtFullPower;
}
return base.InitializeTarget(target);
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:Energize.cs
示例19: InitializeTarget
public override SpellFailedReason InitializeTarget(WorldObject target)
{
if (!((Unit)target).MayTeleport)
{
return SpellFailedReason.TargetAurastate;
}
return SpellFailedReason.Ok;
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:TeleportUnits.cs
示例20: ObjectReference
public ObjectReference(WorldObject obj)
{
EntityId = obj.EntityId;
Level = obj.CasterLevel;
m_Object = obj;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
开发者ID:Zerant,项目名称:WCell,代码行数:8,代码来源:ObjectReference.cs
注:本文中的WCell.RealmServer.Entities.WorldObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论