本文整理汇总了C#中RegionTimer类的典型用法代码示例。如果您正苦于以下问题:C# RegionTimer类的具体用法?C# RegionTimer怎么用?C# RegionTimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RegionTimer类属于命名空间,在下文中一共展示了RegionTimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveAttackBlock
public int RemoveAttackBlock(RegionTimer timer)
{
GamePlayer player = timer.Owner as GamePlayer;
if (player != null)
player.TempProperties.removeProperty(VANISH_BLOCK_ATTACK_TIME_KEY);
return 0;
}
示例2: 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;
}
示例3: HealPulse
public int HealPulse(RegionTimer timer)
{
if (m_healpulse > 0)
{
m_healpulse--;
GamePlayer player = Owner as GamePlayer;
if (player == null) return 0;
if (player.Group == null) return 3000;
foreach (GamePlayer p in player.Group.GetPlayersInTheGroup())
{
if (p.Health < p.MaxHealth && player.IsWithinRadius(p, 750) && p.IsAlive)
{
if (player.IsStealthed)
player.Stealth(false);
int heal = 300;
if (p.Health + heal > p.MaxHealth)
heal = p.MaxHealth - p.Health;
p.ChangeHealth(player, GameLiving.eHealthChangeType.Regenerate, heal);
player.Out.SendMessage("You heal " + p.Name + " for " + heal.ToString() + " hit points.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
p.Out.SendMessage(player.Name + " heals you for " + heal.ToString() + " hit points.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
}
}
return 3000;
}
return 0;
}
示例4: OnDirectEffect
/// <summary>
/// execute non duration spell effect on target
/// </summary>
/// <param name="target"></param>
/// <param name="effectiveness"></param>
public override void OnDirectEffect(GameLiving target, double effectiveness)
{
base.OnDirectEffect(target, effectiveness);
if (target == null || target.IsAlive) return;
SendEffectAnimation(target, 0, false, 1);
GamePlayer targetPlayer = target as GamePlayer;
if (targetPlayer == null)
{
//not a player
ResurrectLiving(target);
}
else
{
targetPlayer.TempProperties.setProperty(RESURRECT_CASTER_PROPERTY, m_caster);
RegionTimer resurrectExpiredTimer = new RegionTimer(targetPlayer);
resurrectExpiredTimer.Callback = new RegionTimerCallback(ResurrectExpiredCallback);
resurrectExpiredTimer.Properties.setProperty("targetPlayer", targetPlayer);
resurrectExpiredTimer.Start(15000);
lock (m_resTimersByLiving.SyncRoot)
{
m_resTimersByLiving.Add(target, resurrectExpiredTimer);
}
//send resurrect dialog
targetPlayer.Out.SendCustomDialog("Do you allow " + m_caster.GetName(0, true) + " to resurrected you\nwith " + m_spell.ResurrectHealth + " percent hits?", new CustomDialogResponse(ResurrectResponceHandler));
}
}
示例5: TeleportTimerCallback
protected override int TeleportTimerCallback(RegionTimer respawnTimer)
{
// Check any Keep State / Tower State here
// This is called 16 times between each teleport !
// You can change teleport speed using
// this.PortalTeleportInterval (in ms !!)
return base.TeleportTimerCallback(respawnTimer);
}
示例6: Start
/// <summary>
/// Starts the effect
/// </summary>
/// <param name="target">The player of this effect</param>
public override void Start(GameLiving target)
{
base.Start(target);
GamePlayer player = target as GamePlayer;
if (player == null) return;
player.EffectList.Add(this);
m_range = (int)(2000 * (player.GetModified(eProperty.SpellRange) * 0.01));
m_countDownTimer = new RegionTimer(player, new RegionTimerCallback(CountDown));
m_countDownTimer.Start(1);
}
示例7: CountDown
public int CountDown(RegionTimer timer)
{
if (m_countdown > 0)
{
((GamePlayer)Owner).Out.SendMessage("You are hidden for " + m_countdown + " more seconds!", eChatType.CT_SpellPulse, eChatLoc.CL_SystemWindow);
m_countdown--;
return 1000;
}
return 0;
}
示例8: Start
public override void Start(GameLiving target)
{
base.Start(target);
if (target is GameNPC)
{
pet = target as GameNPC;
pbaoe = ScriptMgr.CreateSpellHandler(EffectOwner, petSpell, petSpellLine);
pulseTimer = new RegionTimer(EffectOwner, new RegionTimerCallback(PulseTimer), 1000);
GameEventMgr.AddHandler(EffectOwner, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
}
}
示例9: Start
/// <summary>
/// Start the timed effect on target
/// </summary>
/// <param name="target">The effect target</param>
public override void Start(GameLiving target)
{
lock (m_LockObject)
{
if (m_expireTimer == null)
{
m_expireTimer = new RegionTimer(target, new RegionTimerCallback(ExpiredCallback), m_duration);
}
base.Start(target);
}
}
示例10: Timer
protected virtual int Timer(RegionTimer callingTimer)
{
if (base.IsAlive)
{
foreach (GamePlayer player in this.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendSpellCastAnimation(this, 4321, 30);
RegionTimer timer = new RegionTimer(player, new RegionTimerCallback(ShowEffect), 3000);
}
}
return INTERVAL;
}
示例11: 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;
}
示例12: Start
public override void Start(GameLiving target)
{
base.Start(target);
GamePlayer player = target as GamePlayer;
player.StopAttack();
player.Stealth(true);
player.Out.SendUpdateMaxSpeed();
m_countDownTimer = new RegionTimer(player, new RegionTimerCallback(CountDown));
m_countDownTimer.Start(1);
player.TempProperties.setProperty(VANISH_BLOCK_ATTACK_TIME_KEY, player.CurrentRegion.Time + 30000);
m_removeTimer = new RegionTimer(player, new RegionTimerCallback(RemoveAttackBlock));
m_removeTimer.Start(30000);
}
示例13: 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;
}
示例14: 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;
}
示例15: 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;
}