本文整理汇总了C#中RegionTimer.Stop方法的典型用法代码示例。如果您正苦于以下问题:C# RegionTimer.Stop方法的具体用法?C# RegionTimer.Stop怎么用?C# RegionTimer.Stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegionTimer
的用法示例。
在下文中一共展示了RegionTimer.Stop方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PulseTimer
protected virtual int PulseTimer(RegionTimer timer)
{
if (currentTick >= m_lifeTime || m_caster == null)
{
this.RemoveFromWorld();
timer.Stop();
timer = null;
return 0;
}
if (currentTick % m_pulseFrequency == 0)
{
currentPulse++;
foreach (GamePlayer target in this.GetPlayersInRadius(m_radius))
{
CastSpell(target);
}
foreach (GameNPC npc in this.GetNPCsInRadius(m_radius))
{
CastSpell(npc);
}
}
currentTick++;
return 1000;
}
示例2: ShowEffect
public int ShowEffect(RegionTimer timer)
{
if (base.IsAlive)
{
foreach (GamePlayer player in this.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendSpellEffectAnimation(this, this, 4321, 0, false, 1);
}
foreach (GamePlayer player in this.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "GuardCaster.SkinsHardens", this.Name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
}
}
timer.Stop();
timer = null;
return 0;
}
示例3: EndCast
protected virtual int EndCast(RegionTimer timer)
{
bool castWasSuccess = player.TempProperties.getProperty(NM_CAST_SUCCESS, false);
player.TempProperties.removeProperty(IS_CASTING);
GameEventMgr.RemoveHandler(player, GamePlayerEvent.Moving, new DOLEventHandler(CastInterrupted));
GameEventMgr.RemoveHandler(player, GamePlayerEvent.AttackFinished, new DOLEventHandler(CastInterrupted));
GameEventMgr.RemoveHandler(player, GamePlayerEvent.Dying, new DOLEventHandler(CastInterrupted));
if (player.IsMezzed || player.IsStunned || player.IsSitting)
return 0;
if (!castWasSuccess)
return 0;
Statics.NegativeMaelstromBase nm = new Statics.NegativeMaelstromBase(dmgValue);
nm.CreateStatic(player, player.GroundTarget, duration, 5, 350);
DisableSkill(player);
timer.Stop();
timer = null;
return 0;
}
示例4: RootExpires
protected virtual int RootExpires(RegionTimer timer)
{
GameLiving living = timer.Owner as GameLiving;
if (living != null)
{
living.BuffBonusMultCategory1.Remove((int)eProperty.MaxSpeed, this);
SendUpdates(living);
}
timer.Stop();
timer = null;
return 0;
}
示例5: EndCast
protected virtual int EndCast(RegionTimer timer)
{
if (caster.TargetObject == null)
{
caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
caster.DisableSkill(this, 3 * 1000);
return 0;
}
if (caster.IsMoving)
{
caster.Out.SendMessage(LanguageMgr.GetTranslation(caster.Client, "SpellHandler.CasterMove"), eChatType.CT_Say, eChatLoc.CL_SystemWindow);
caster.DisableSkill(this, 3000);
return 0;
}
if ( !caster.IsWithinRadius( caster.TargetObject, 1875 ) )
{
caster.Out.SendMessage(caster.TargetObject.Name + " is too far away.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
caster.DisableSkill(this, 3 * 1000);
return 0;
}
GameLiving living = caster.TargetObject as GameLiving;
if(living==null)
{
timer.Stop();
timer = null;
return 0;
}
if (living.EffectList.GetOfType<ChargeEffect>() == null && living.EffectList.GetOfType<SpeedOfSoundEffect>() != null)
{
living.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
m_rootExpire = new RegionTimer(living, new RegionTimerCallback(RootExpires), duration);
GameEventMgr.AddHandler(living, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
SendUpdates(living);
}
foreach (GamePlayer player in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendSpellEffectAnimation(caster, (caster.TargetObject as GameLiving), 7029, 0, false, 1);
}
foreach (GameNPC mob in living.GetNPCsInRadius(500))
{
if (!GameServer.ServerRules.IsAllowedToAttack(caster, mob, true))
continue;
if (mob.HasAbility(Abilities.CCImmunity) || mob.HasAbility(Abilities.RootImmunity) || mob.HasAbility(Abilities.DamageImmunity))
continue;
GameSpellEffect mez = SpellHandler.FindEffectOnTarget(mob, "Mesmerize");
if (mez != null)
mez.Cancel(false);
mob.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);
if (mob.EffectList.GetOfType<ChargeEffect>() == null && mob.EffectList.GetOfType<SpeedOfSoundEffect>() == null)
{
mob.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
m_rootExpire = new RegionTimer(mob, new RegionTimerCallback(RootExpires), duration);
GameEventMgr.AddHandler(mob, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
SendUpdates(mob);
}
caster.Out.SendMessage("You hit the " + mob.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
foreach (GamePlayer player2 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player2.Out.SendSpellEffectAnimation(caster, mob, 7029, 0, false, 1);
}
}
foreach (GamePlayer aeplayer in living.GetPlayersInRadius(500))
{
if (!GameServer.ServerRules.IsAllowedToAttack(caster, aeplayer, true))
continue;
GameSpellEffect mez = SpellHandler.FindEffectOnTarget(aeplayer, "Mesmerize");
if (mez != null)
mez.Cancel(false);
aeplayer.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);
aeplayer.StartInterruptTimer(3000, AttackData.eAttackType.Spell, caster);
if (aeplayer.EffectList.GetOfType<ChargeEffect>() == null && aeplayer.EffectList.GetOfType<SpeedOfSoundEffect>() == null)
{
(aeplayer as GameLiving).BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
m_rootExpire = new RegionTimer(aeplayer, new RegionTimerCallback(RootExpires), duration);
GameEventMgr.AddHandler(aeplayer, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
SendUpdates(aeplayer);
}
caster.Out.SendMessage("You hit " + aeplayer.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
foreach (GamePlayer player3 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player3.Out.SendSpellEffectAnimation(caster, aeplayer, 7029, 0, false, 1);
}
//.........这里部分代码省略.........
示例6: CauldronCallBack
private int CauldronCallBack(RegionTimer timer)
{
if (Cauldron != null && EffectOwner != null)
{
foreach (GamePlayer target in Cauldron.GetPlayersInRadius(spellRadius))
{
if (GameServer.ServerRules.IsAllowedToAttack(EffectOwner, target, true))
target.TakeDamage(EffectOwner, eDamageType.Heat, spellDamage, 0);
}
}
timer.Stop();
timer = null;
return 0;
}
示例7: spiritCallBack
// Check distance between spirit and target
private int spiritCallBack(RegionTimer timer)
{
if (timer.Owner == null || !(timer.Owner is GameNPC))
{
timer.Stop();
timer = null;
return 0;
}
GameNPC spirit = timer.Owner as GameNPC;
GamePlayer targetPlayer = spirit.TargetObject as GamePlayer;
if (targetPlayer == null || !targetPlayer.IsAlive)
{
spirit.StopFollowing();
timer.Stop();
timer = null;
return 0;
}
if (targetPlayer.IsWithinRadius(spirit, 100))
{
ApplySpiritEffect(spirit, targetPlayer);
timer.Stop();
timer = null;
return 0;
}
return 200;
}
示例8: EndCast
protected virtual int EndCast(RegionTimer timer)
{
if (caster.TargetObject == null)
{
caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
caster.DisableSkill(this, 3 * 1000);
return 0;
}
if (!caster.IsWithinRadius(caster.TargetObject, (int)(1500 * caster.GetModified(eProperty.SpellRange) * 0.01)))
{
caster.Out.SendMessage(caster.TargetObject + " is too far away.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
return 0;
}
foreach (GamePlayer player in caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendSpellEffectAnimation(caster, (caster.TargetObject as GameLiving), 7025, 0, false, 1);
}
foreach (GameNPC mob in caster.TargetObject.GetNPCsInRadius(500))
{
if (!GameServer.ServerRules.IsAllowedToAttack(caster, mob, true))
continue;
mob.TakeDamage(caster, eDamageType.Heat, dmgValue, 0);
caster.Out.SendMessage("You hit the " + mob.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
foreach (GamePlayer player2 in caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player2.Out.SendSpellEffectAnimation(caster, mob, 7025, 0, false, 1);
}
}
foreach (GamePlayer aeplayer in caster.TargetObject.GetPlayersInRadius(500))
{
if (!GameServer.ServerRules.IsAllowedToAttack(caster, aeplayer, true))
continue;
aeplayer.TakeDamage(caster, eDamageType.Heat, dmgValue, 0);
caster.Out.SendMessage("You hit " + aeplayer.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
aeplayer.Out.SendMessage(caster.Name + " hits you for " + dmgValue + " damage.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
foreach (GamePlayer player3 in caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player3.Out.SendSpellEffectAnimation(caster, aeplayer, 7025, 0, false, 1);
}
}
DisableSkill(caster);
timer.Stop();
timer = null;
return 0;
}
示例9: PulseTimer
protected virtual int PulseTimer(RegionTimer timer)
{
if (EffectOwner == null || pet == null || pbaoe == null)
{
timer.Stop();
timer = null;
return 0;
}
if (currentTick % spellFrequency == 0)
{
foreach (GamePlayer target in pet.GetPlayersInRadius(spellRadius))
{
pbaoe.StartSpell(target);
}
foreach (GameNPC npc in pet.GetNPCsInRadius(spellRadius))
{
pbaoe.StartSpell(npc);
}
}
currentTick++;
return 1000;
}