本文整理汇总了C#中RegionTimer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# RegionTimer.Start方法的具体用法?C# RegionTimer.Start怎么用?C# RegionTimer.Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegionTimer
的用法示例。
在下文中一共展示了RegionTimer.Start方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
}
示例2: 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);
}
示例3: 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);
}
示例4: 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;
}
示例5: 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);
}
示例6: StartHealthRegeneration
/// <summary>
/// do not regen
/// </summary>
public override void StartHealthRegeneration()
{
m_repairTimer = new RegionTimer(CurrentRegion.TimeManager);
m_repairTimer.Callback = new RegionTimerCallback(RepairTimerCallback);
m_repairTimer.Interval = repairInterval;
m_repairTimer.Start(1);
}
示例7: StartHealthRegeneration
public override void StartHealthRegeneration()
{
if (m_repairTimer != null && m_repairTimer.IsAlive) return;
m_repairTimer = new RegionTimer(CurrentRegion.TimeManager);
m_repairTimer.Callback = new RegionTimerCallback(RepairTimerCallback);
m_repairTimer.Interval = repairInterval;
m_repairTimer.Start(repairInterval);
}
示例8: AddToWorld
/// <summary>
/// Override Add To World to Spawn Teleporters in Circle
/// And start Timer.
/// </summary>
/// <returns></returns>
public override bool AddToWorld()
{
if (!base.AddToWorld())
return false;
// Add the Item Pad
m_worldObject.X = X;
m_worldObject.Y = Y;
m_worldObject.Z = Z;
m_worldObject.Heading = Heading;
m_worldObject.Model = PortalWorldObjectModel;
m_worldObject.AddToWorld();
// Add the teleporters
NpcTemplate teleporters = NpcTemplateMgr.GetTemplate(PortalTeleportersTemplateID);
ushort divisor = (ushort)(4096/PortalTeleporterCount);
for (int cnt = 0 ; cnt < PortalTeleporterCount ; cnt++)
{
GameNPC teleporter = new GameNPC(teleporters);
Point2D tgt = GetPointFromHeading((ushort)((Heading+(cnt*divisor))%4096), PortalCeremonyRange);
teleporter.X = tgt.X;
teleporter.Y = tgt.Y;
teleporter.Z = Z;
teleporter.CurrentRegion = CurrentRegion;
teleporter.Heading = (ushort)((Heading+(cnt*divisor)+2048)%4096);
m_teleporters.Add(teleporter);
teleporter.AddToWorld();
}
// Start Timer.
m_teleportTimer = new RegionTimer(this);
m_teleportTimer.Callback = new RegionTimerCallback(TeleportTimerCallback);
m_teleportTimer.Start((int)(PortalTeleportInterval >> 4));
return true;
}
示例9: OnCloseToDeadWilbur
protected void OnCloseToDeadWilbur(DOLEvent e, object n, EventArgs args)
{
GameNPC pigHerderWyatt = n as GameNPC;
if(pigHerderWyatt != null)
{
GameEventMgr.RemoveHandler(pigHerderWyatt, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(OnCloseToDeadWilbur));
pigHerderWyatt.Emote(eEmote.Beg);
pigHerderWyatt.Yell("Wilbur? What have you done to Wilbur, you scoundrel!");
RegionTimer waitTimer = new RegionTimer(pigHerderWyatt);
waitTimer.Callback = new RegionTimerCallback(OnCloseToDeadWilburCallBack);
waitTimer.Properties.setProperty(questTitle, pigHerderWyatt);
waitTimer.Start(4000);
}
}
示例10: startTimer
private void startTimer()
{
m_tickTimer = new RegionTimer(m_playerOwner);
m_tickTimer.Callback = new RegionTimerCallback(onTick);
m_tickTimer.Start(3000);
}
示例11: Execute
public override void Execute(GameLiving living)
{
if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
return;
GamePlayer player = living as GamePlayer;
if (player == null)
return;
GamePlayer targetPlayer = null;
bool isGoodTarget = true;
if (player.TargetObject == null)
{
isGoodTarget = false;
}
else
{
targetPlayer = player.TargetObject as GamePlayer;
if (targetPlayer == null ||
targetPlayer.IsAlive ||
GameServer.ServerRules.IsSameRealm(living, player.TargetObject as GameLiving, true) == false)
{
isGoodTarget = false;
}
}
if (isGoodTarget == false)
{
player.Out.SendMessage("You have to target a dead member of your realm!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
return;
}
switch (Level)
{
case 2: m_resurrectValue = 50; break;
case 3: m_resurrectValue = 100; break;
}
GameLiving resurrectionCaster = targetPlayer.TempProperties.getProperty<object>(RESURRECT_CASTER_PROPERTY, null) as GameLiving;
if (resurrectionCaster != null)
{
player.Out.SendMessage("Your target is already considering a resurrection!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
return;
}
if (!player.IsWithinRadius(targetPlayer, (int)(1500 * player.GetModified(eProperty.SpellRange) * 0.01)))
{
player.Out.SendMessage("You are too far away from your target to use this ability!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
return;
}
if (targetPlayer != null)
{
SendCasterSpellEffectAndCastMessage(living, 7019, true);
DisableSkill(living);
//Lifeflight:
//don't rez just yet
//ResurrectLiving(targetPlayer, player);
//we need to add a dialogue response to the rez, copying from the rez spellhandler
targetPlayer.TempProperties.setProperty(RESURRECT_CASTER_PROPERTY, living);
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(player.TargetObject, resurrectExpiredTimer);
}
//send resurrect dialog
targetPlayer.Out.SendCustomDialog("Do you allow " + living.GetName(0, true) + " to resurrect you\nwith " + m_resurrectValue + " percent hits?", new CustomDialogResponse(ResurrectResponceHandler));
}
}