本文整理汇总了C#中RegionTimer类的典型用法代码示例。如果您正苦于以下问题:C# RegionTimer类的具体用法?C# RegionTimer怎么用?C# RegionTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegionTimer类属于命名空间,在下文中一共展示了RegionTimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:7,代码来源:VanishEffect.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:25,代码来源:GenericBase.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:32,代码来源:SelflessDevotionEffect.cs
示例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));
}
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:33,代码来源:ResurrectSpellHandler.cs
示例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);
}
开发者ID:mynew4,项目名称:DAoC,代码行数:9,代码来源:PortalCeremonyExampleNPC.cs
示例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);
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:14,代码来源:AmelioratingMelodiesEffect.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:10,代码来源:VanishEffect.cs
示例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));
}
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:SearingPetEffect.cs
示例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);
}
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:15,代码来源:TimedEffect.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:Caster.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:52,代码来源:VolcanicPillarAbility.cs
示例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);
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:VanishEffect.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:14,代码来源:BoilingCauldronEffect.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:17,代码来源:Caster.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:18,代码来源:NegativeMaelstromAbility.cs
示例16: startSpell
private int startSpell(RegionTimer timer)
{
if (!owner.IsAlive)
return 0;
traparea = new Area.Circle("decimation trap", owner.X, owner.Y, owner.Z, 50);
owner.CurrentRegion.AddArea(traparea);
region = owner.CurrentRegionID;
GameEventMgr.AddHandler(traparea, AreaEvent.PlayerEnter, new DOLEventHandler(EventHandler));
ticktimer = new RegionTimer(owner);
ticktimer.Callback = new RegionTimerCallback(onTick);
ticktimer.Start(600000);
getTargets();
DisableSkill(owner);
return 0;
}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:19,代码来源:DecimationTrap.cs
示例17: Start
public override void Start(GameLiving target)
{
base.Start(target);
owner = target as GamePlayer;
if (owner == null) return;
foreach (GamePlayer p in owner.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
p.Out.SendSpellEffectAnimation(owner, owner, Icon, 0, false, 1);
m_debuffs = new Dictionary<eProperty, int>(1 + eProperty.Stat_Last - eProperty.Stat_First);
for (eProperty property = eProperty.Stat_First; property <= eProperty.Stat_Last; property++)
{
m_debuffs.Add(property, (int)(owner.GetModified(property) * 0.25));
owner.DebuffCategory[(int)property] += m_debuffs[property];
}
owner.Out.SendCharStatsUpdate();
m_timer = new RegionTimer(owner, new RegionTimerCallback(HealPulse));
m_timer.Start(1);
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:23,代码来源:SelflessDevotionEffect.cs
示例18: ExpiredCallback
protected virtual int ExpiredCallback(RegionTimer callingTimer)
{
Stop();
return 0;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:5,代码来源:Arrogance.cs
示例19: StartTimers
protected virtual void StartTimers()
{
StopTimers();
m_expireTimer = new RegionTimer(playertarget, new RegionTimerCallback(ExpiredCallback), 10000);
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:5,代码来源:Arrogance.cs
示例20: DeleteDunwynClone
protected virtual int DeleteDunwynClone(RegionTimer callingTimer)
{
if (dunwynClone != null)
{
dunwynClone.Delete();
GameEventMgr.RemoveHandler(dunwynClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwyn));
GameEventMgr.RemoveHandler(dunwynClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterDunwyn));
}
for (int i = 0; i < recruits.Length; i++)
{
if (recruits[i] != null)
recruits[i].Delete();
}
return 0;
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:17,代码来源:Culmination.cs
注:本文中的RegionTimer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论