本文整理汇总了C#中DOL.GS.Effects.GameSpellEffect类的典型用法代码示例。如果您正苦于以下问题:C# GameSpellEffect类的具体用法?C# GameSpellEffect怎么用?C# GameSpellEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameSpellEffect类属于DOL.GS.Effects命名空间,在下文中一共展示了GameSpellEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEffectStart
/// <summary>
/// When an applied effect starts
/// duration spells only
/// </summary>
/// <param name="effect"></param>
public override void OnEffectStart(GameSpellEffect effect)
{
base.OnEffectStart(effect);
if (effect.Owner.Realm == 0 || Caster.Realm == 0)
{
effect.Owner.LastAttackedByEnemyTickPvE = effect.Owner.CurrentRegion.Time;
Caster.LastAttackTickPvE = Caster.CurrentRegion.Time;
}
else
{
effect.Owner.LastAttackedByEnemyTickPvP = effect.Owner.CurrentRegion.Time;
Caster.LastAttackTickPvP = Caster.CurrentRegion.Time;
}
effect.Owner.DisarmedTime = effect.Owner.CurrentRegion.Time + CalculateEffectDuration(effect.Owner, Caster.Effectiveness);
effect.Owner.StopAttack();
MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell);
Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), eChatType.CT_Spell, effect.Owner);
effect.Owner.StartInterruptTimer(effect.Owner.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
if (effect.Owner is GameNPC)
{
IOldAggressiveBrain aggroBrain = ((GameNPC)effect.Owner).Brain as IOldAggressiveBrain;
if (aggroBrain != null)
aggroBrain.AddToAggroList(Caster, 1);
}
}
示例2: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
base.OnEffectStart(effect);
GameLiving living = effect.Owner as GameLiving;
living.AbilityBonus[(int)eProperty.Dexterity] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Strength] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Constitution] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Acuity] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Piety] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Empathy] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Quickness] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Intelligence] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Charisma] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.MagicAbsorption] += (int)m_spell.Value;
if (effect.Owner is GamePlayer)
{
GamePlayer player = effect.Owner as GamePlayer;
player.Out.SendCharStatsUpdate();
player.UpdateEncumberance();
player.UpdatePlayerStatus();
player.Out.SendUpdatePlayer();
}
}
示例3: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
base.OnEffectStart(effect);
//effect.Owner.DebuffCategory[(int)eProperty.Dexterity] += (int)m_spell.Value;
double percentValue = (m_spell.Value) / 100;
StrDebuff = (int)((double)effect.Owner.GetModified(eProperty.Strength) * percentValue);
DexDebuff = (int)((double)effect.Owner.GetModified(eProperty.Dexterity) * percentValue);
ConDebuff = (int)((double)effect.Owner.GetModified(eProperty.Constitution) * percentValue);
EmpDebuff = (int)((double)effect.Owner.GetModified(eProperty.Empathy) * percentValue);
QuiDebuff = (int)((double)effect.Owner.GetModified(eProperty.Quickness) * percentValue);
IntDebuff = (int)((double)effect.Owner.GetModified(eProperty.Intelligence) * percentValue);
ChaDebuff = (int)((double)effect.Owner.GetModified(eProperty.Charisma) * percentValue);
PieDebuff = (int)((double)effect.Owner.GetModified(eProperty.Piety) * percentValue);
effect.Owner.DebuffCategory[(int)eProperty.Dexterity] += DexDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Strength] += StrDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Constitution] += ConDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Piety] += PieDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Empathy] += EmpDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Quickness] += QuiDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Intelligence] += IntDebuff;
effect.Owner.DebuffCategory[(int)eProperty.Charisma] += ChaDebuff;
if (effect.Owner is GamePlayer)
{
GamePlayer player = effect.Owner as GamePlayer;
player.Out.SendCharStatsUpdate();
player.UpdateEncumberance();
player.UpdatePlayerStatus();
player.Out.SendUpdatePlayer();
}
}
示例4: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
base.OnEffectStart(effect);
if (effect.Owner is GamePlayer)
{
GamePlayer player = effect.Owner as GamePlayer;
for (int i = (int)eProperty.Skill_First; i <= (int)eProperty.Skill_Last; i++)
{
if (player.GetModifiedSpecLevel(SkillBase.GetPropertyName((eProperty)(i))) != 0)
{
player.BaseBuffBonusCategory[i] = -player.GetModifiedSpecLevel(SkillBase.GetPropertyName((eProperty)(i)));
}
// DOLConsole.WriteWarning("Spec " + SkillBase.GetPropertyName((eProperty)(i)) + " " + player.GetModifiedSpecLevel(SkillBase.GetPropertyName((eProperty)(i))));
}
player.PropertiesChanged();
player.Out.SendCharStatsUpdate();
player.UpdatePlayerStatus();
MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell);
Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner);
}
}
示例5: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
if (effect.Owner is GamePlayer)
{
base.OnEffectStart(effect);
GamePlayer player = effect.Owner as GamePlayer;
player.BaseBuffBonusCategory[0] = (int)player.Effectiveness;
double effectiveness = player.Effectiveness;
double valueToAdd = (Spell.Value * effectiveness)/100;
valueToAdd = effectiveness - valueToAdd;
if ((valueToAdd) > 0)
{
player.Effectiveness = valueToAdd;
}
else
{
player.Effectiveness = 0;
}
MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell);
Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner);
}
}
示例6: OnEffectStart
/// <summary>
/// When an applied effect starts
/// duration spells only
/// </summary>
/// <param name="effect"></param>
public override void OnEffectStart(GameSpellEffect effect)
{
base.OnEffectStart(effect);
if (effect.Owner.Realm == 0 || Caster.Realm == 0)
{
effect.Owner.LastAttackedByEnemyTickPvE = effect.Owner.CurrentRegion.Time;
Caster.LastAttackTickPvE = Caster.CurrentRegion.Time;
}
else
{
effect.Owner.LastAttackedByEnemyTickPvP = effect.Owner.CurrentRegion.Time;
Caster.LastAttackTickPvP = Caster.CurrentRegion.Time;
}
GameSpellEffect mezz = SpellHandler.FindEffectOnTarget(effect.Owner, "Mesmerize");
if (mezz != null) mezz.Cancel(false);
effect.Owner.Disease(true);
effect.Owner.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 0.15);
effect.Owner.BuffBonusMultCategory1.Set((int)eProperty.Strength, this, 1.0 - 0.075);
SendUpdates(effect);
MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell);
Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_System, effect.Owner);
effect.Owner.StartInterruptTimer(effect.Owner.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
if (effect.Owner is GameNPC)
{
IOldAggressiveBrain aggroBrain = ((GameNPC)effect.Owner).Brain as IOldAggressiveBrain;
if (aggroBrain != null)
aggroBrain.AddToAggroList(Caster, 1);
}
}
示例7: OnEffectExpires
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
GamePlayer player = effect.Owner as GamePlayer;
if (player == null) return base.OnEffectExpires(effect, noMessages);
GameEventMgr.RemoveHandler((GamePlayer)effect.Owner, GamePlayerEvent.SwimmingStatus, new DOLEventHandler(SwimmingStatusChange));
return base.OnEffectExpires(effect, noMessages);
}
示例8: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
//Add the handler for when the target is attacked and we should reduce the damage
GameEventMgr.AddHandler(FSTarget, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
//Add handlers for the target attacking, casting, etc
//Don't need to add the handlers twice
if (FSTarget != Caster)
{
GameEventMgr.AddHandler(FSTarget, GameLivingEvent.AttackFinished, new DOLEventHandler(CancelSpell));
GameEventMgr.AddHandler(FSTarget, GameLivingEvent.CastStarting, new DOLEventHandler(CancelSpell));
}
//Send the spell messages
MessageToLiving(FSTarget, Spell.Message1, eChatType.CT_Spell);
foreach (GamePlayer player in FSTarget.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
{
if (player != FSTarget)
MessageToLiving(player, string.Format(Spell.Message3, FSTarget.Name), eChatType.CT_Spell);
}
timer = new FSTimer(Caster, this);
timer.Start(1);
base.OnEffectStart(effect);
}
示例9: OnEffectExpires
/// <summary>
/// When an applied effect expires.
/// Duration spells only.
/// </summary>
/// <param name="effect">The expired effect</param>
/// <param name="noMessages">true, when no messages should be sent to player and surrounding</param>
/// <returns>immunity duration in milliseconds</returns>
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
// http://www.camelotherald.com/more/1749.shtml
// immunity timer will now be exactly five times the length of the stun
base.OnEffectExpires(effect, noMessages);
return Spell.Duration * 5;
}
示例10: IsOverwritable
/// <summary>
/// Determines wether this spell is compatible with given spell
/// and therefore overwritable by better versions
/// spells that are overwritable cannot stack
/// </summary>
/// <param name="compare"></param>
/// <returns></returns>
public override bool IsOverwritable(GameSpellEffect compare)
{
if (Spell.EffectGroup != 0 || compare.Spell.EffectGroup != 0)
return Spell.EffectGroup == compare.Spell.EffectGroup;
if (compare.Spell.SpellType == "Stun") return true;
return base.IsOverwritable(compare);
}
示例11: OnEffectStart
public override void OnEffectStart(GameSpellEffect effect)
{
effect.Owner.BaseBuffBonusCategory[(int)eProperty.Skill_Stealth]+=(int)m_spell.Value;
base.OnEffectStart(effect);
// effect.Owner.BuffBonusCategory1[(int)eProperty.StealthRange] += (int)m_spell.Value;
}
示例12: OnEffectExpires
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
GameLiving living = effect.Owner as GameLiving;
living.AbilityBonus[(int)eProperty.Dexterity] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Strength] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Constitution] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Acuity] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Piety] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Empathy] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Quickness] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Intelligence] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.Charisma] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)m_spell.Value;
living.AbilityBonus[(int)eProperty.MagicAbsorption] -= (int)m_spell.Value;
if (effect.Owner is GamePlayer)
{
GamePlayer player = effect.Owner as GamePlayer;
player.Out.SendCharStatsUpdate();
player.UpdateEncumberance();
player.UpdatePlayerStatus();
player.Out.SendUpdatePlayer();
}
return base.OnEffectExpires(effect, noMessages);
}
示例13: BuffCheckAction
public BuffCheckAction(GameLiving caster, GameLiving owner, GameSpellEffect effect)
: base(caster)
{
m_caster = caster;
m_owner = owner;
m_effect = effect;
}
示例14: OnEffectExpires
/// <summary>
/// Despawn pet.
/// </summary>
/// <param name="effect"></param>
/// <param name="noMessages"></param>
/// <returns>Immunity timer (in milliseconds).</returns>
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
if (Caster.PetCount > 0)
Caster.PetCount--;
return base.OnEffectExpires(effect, noMessages);
}
示例15: OnEffectPulse
/// <summary>
/// When an applied effect pulses
/// duration spells only
/// </summary>
/// <param name="effect"></param>
public override void OnEffectPulse(GameSpellEffect effect)
{
base.OnEffectPulse(effect);
MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_YouWereHit);
Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), eChatType.CT_YouHit, effect.Owner);
int bleedValue = effect.Owner.TempProperties.getProperty<int>(BLEED_VALUE_PROPERTY);
AttackData ad = CalculateDamageToTarget(effect.Owner, 1.0);
SendDamageMessages(ad);
// attacker must be null, attack result is 0x0A
foreach (GamePlayer player in ad.Target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendCombatAnimation(null, ad.Target, 0, 0, 0, 0, 0x0A, ad.Target.HealthPercent);
}
// send animation before dealing damage else dead livings show no animation
ad.Target.OnAttackedByEnemy(ad);
ad.Attacker.DealDamage(ad);
if (--bleedValue <= 0 || !effect.Owner.IsAlive)
effect.Cancel(false);
else effect.Owner.TempProperties.setProperty(BLEED_VALUE_PROPERTY, bleedValue);
}