本文整理汇总了C#中DOL.GS.RegionTimer类的典型用法代码示例。如果您正苦于以下问题:C# RegionTimer类的具体用法?C# RegionTimer怎么用?C# RegionTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegionTimer类属于DOL.GS命名空间,在下文中一共展示了RegionTimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: startTimer
private void startTimer()
{
m_tickTimer = new RegionTimer(m_playerOwner);
m_tickTimer.Callback = new RegionTimerCallback(onTick);
m_tickTimer.Start(3000);
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:7,代码来源:RestorativeMindEffect.cs
示例2: Effect
public int Effect(RegionTimer timer)
{
m_timer.Dequeue();
GamePlayer player = (GamePlayer)castplayer.Dequeue();
foreach (GamePlayer visplayer in this.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
visplayer.Out.SendSpellEffectAnimation(this, player, spell, 0, false, 1);
}
return 0;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:10,代码来源:effectNPC.cs
示例3: EndCast
protected virtual int EndCast(RegionTimer timer)
{
if (m_player.IsMezzed || m_player.IsStunned || m_player.IsSitting)
return 0;
Statics.ThornweedFieldBase twf = new Statics.ThornweedFieldBase(m_dmgValue);
twf.CreateStatic(m_player, m_player.GroundTarget, m_duration, 3, 500);
DisableSkill(m_player);
timer.Stop();
timer = null;
return 0;
}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:11,代码来源:ThornweedFieldAbility.cs
示例4: 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:mynew4,项目名称:DAoC,代码行数:12,代码来源:Caster.cs
示例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.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:boscorillium,项目名称:dol,代码行数:52,代码来源:VolcanicPillarAbility.cs
示例6: 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:Refizul,项目名称:DOL-Kheldron,代码行数:18,代码来源:NegativeMaelstromAbility.cs
示例7: 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.Account.Language, "GuardCaster.SkinsHardens", this.Name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
}
}
timer.Stop();
timer = null;
return 0;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:19,代码来源:Caster.cs
示例8: 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:mynew4,项目名称:DAoC,代码行数:24,代码来源:GenericBase.cs
示例9: MakeDelayedDamage
private int MakeDelayedDamage(RegionTimer callingTimer)
{
DoDamage();
return 0;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:5,代码来源:GameSiegeWeapon.cs
示例10: RespawnTimerCallback
/// <summary>
/// Called when the Respawntimer is reached
/// </summary>
/// <param name="respawnTimer"></param>
/// <returns></returns>
protected override int RespawnTimerCallback(RegionTimer respawnTimer)
{
if (respawntimer != null)
{
respawntimer.Stop();
respawntimer = null;
}
if (ObjectState == eObjectState.Active) return 0;
X = SpawnX;
Y = SpawnY;
Z = SpawnZ;
Heading = (ushort)SpawnHeading;
CurrentRegionID = (ushort)SpawnRegion;
XP = MinotaurRelicManager.MAX_RELIC_EXP;
AddToWorld();
return 0;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:23,代码来源:MinotaurRelic.cs
示例11: ReturnRelicTick
/// <summary>
/// when the relic is lost and ReturnRelicInterval is elapsed
/// </summary>
protected virtual int ReturnRelicTick(RegionTimer timer)
{
if (CurrentRegion.Time - m_timeRelicOnGround < ReturnRelicInterval)
{
// Note: This does not show up, possible issue with SendSpellEffect
ushort effectID = (ushort)Util.Random(5811, 5815);
foreach (GamePlayer ppl in GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
ppl.Out.SendSpellEffectAnimation(this, this, effectID, 0, false, 0x01);
}
return RelicEffectInterval;
}
if (ReturnRelicPad != null)
{
log.Debug("Relic " + this.Name + " is lost and returns to " + ReturnRelicPad.ToString());
RemoveFromWorld();
RelicPadTakesOver(ReturnRelicPad, true);
SaveIntoDatabase();
AddToWorld();
}
else
{
log.Error("Relic " + this.Name + " is lost and ReturnRelicPad is null!");
}
m_returnRelicTimer.Stop();
m_returnRelicTimer = null;
return 0;
}
开发者ID:andyhebear,项目名称:DOLSharp,代码行数:32,代码来源:GameRelic.cs
示例12: CastGlare
/// <summary>
/// Cast glare on the target.
/// </summary>
/// <param name="timer">The timer that started this cast.</param>
/// <returns></returns>
private int CastGlare(RegionTimer timer)
{
// Turn around to the target and cast glare, then go back to the original
// target, if one exists.
GameObject oldTarget = TargetObject;
TargetObject = GlareTarget;
Z = SpawnPoint.Z; // this is a fix to correct Z errors that sometimes happen during dragon fights
TurnTo(GlareTarget);
CastSpell(Glare, SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells));
GlareTarget = null;
if (oldTarget != null) TargetObject = oldTarget;
return 0;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:19,代码来源:GameDragon.cs
示例13: FollowTimerCallback
/// <summary>
/// Keep following a specific object at a max distance
/// </summary>
protected virtual int FollowTimerCallback(RegionTimer callingTimer)
{
if (IsCasting)
return ServerProperties.Properties.GAMENPC_FOLLOWCHECK_TIME;
bool wasInRange = m_followTimer.Properties.getProperty(FOLLOW_TARGET_IN_RANGE, false);
m_followTimer.Properties.removeProperty(FOLLOW_TARGET_IN_RANGE);
GameObject followTarget = (GameObject)m_followTarget.Target;
GameLiving followLiving = followTarget as GameLiving;
//Stop following if target living is dead
if (followLiving != null && !followLiving.IsAlive)
{
StopFollowing();
Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget));
return 0;
}
//Stop following if we have no target
if (followTarget == null || followTarget.ObjectState != eObjectState.Active || CurrentRegionID != followTarget.CurrentRegionID)
{
StopFollowing();
Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget));
return 0;
}
//Calculate the difference between our position and the players position
float diffx = (long)followTarget.X - X;
float diffy = (long)followTarget.Y - Y;
float diffz = (long)followTarget.Z - Z;
//SH: Removed Z checks when one of the two Z values is zero(on ground)
//Tolakram: a Z of 0 does not indicate on the ground. Z varies based on terrain Removed 0 Z check
float distance = (float)Math.Sqrt(diffx * diffx + diffy * diffy + diffz * diffz);
//if distance is greater then the max follow distance, stop following and return home
if ((int)distance > m_followMaxDist)
{
StopFollowing();
Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget));
this.WalkToSpawn();
return 0;
}
int newX, newY, newZ;
if (this.Brain is StandardMobBrain)
{
StandardMobBrain brain = this.Brain as StandardMobBrain;
//if the npc hasn't hit or been hit in a while, stop following and return home
if (!(Brain is IControlledBrain))
{
if (AttackState && brain != null && followLiving != null)
{
long seconds = 20 + ((brain.GetAggroAmountForLiving(followLiving) / (MaxHealth + 1)) * 100);
long lastattacked = LastAttackTick;
long lasthit = LastAttackedByEnemyTick;
if (CurrentRegion.Time - lastattacked > seconds * 1000 && CurrentRegion.Time - lasthit > seconds * 1000)
{
//StopFollow();
Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget));
//brain.ClearAggroList();
this.WalkToSpawn();
return 0;
}
}
}
//If we're part of a formation, we can get out early.
newX = followTarget.X;
newY = followTarget.Y;
newZ = followTarget.Z;
if (brain.CheckFormation(ref newX, ref newY, ref newZ))
{
WalkTo(newX, newY, (ushort)newZ, MaxSpeed);
return ServerProperties.Properties.GAMENPC_FOLLOWCHECK_TIME;
}
}
// Tolakram - Distances under 100 do not calculate correctly leading to the mob always being told to walkto
int minAllowedFollowDistance = MIN_ALLOWED_FOLLOW_DISTANCE;
// pets can follow closer. need to implement /fdistance command to make this adjustable
if (this.Brain is IControlledBrain)
minAllowedFollowDistance = MIN_ALLOWED_PET_FOLLOW_DISTANCE;
//Are we in range yet?
if ((int)distance <= (m_followMinDist < minAllowedFollowDistance ? minAllowedFollowDistance : m_followMinDist))
{
StopMoving();
TurnTo(followTarget);
if (!wasInRange)
{
m_followTimer.Properties.setProperty(FOLLOW_TARGET_IN_RANGE, true);
FollowTargetInRange();
}
//.........这里部分代码省略.........
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:101,代码来源:GameNPC.cs
示例14: DecayTimerCallback
private int DecayTimerCallback(RegionTimer callingTimer)
{
TakeDamage(this, eDamageType.Natural, DeductHp, 0);
return DECAYPERIOD;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:5,代码来源:GameSiegeWeapon.cs
示例15: CallBack
private int CallBack(RegionTimer timer)
{
m_pickup.Stop();
m_pickup = null;
return 0;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:6,代码来源:WorldInventoryItem.cs
示例16: StartPickupTimer
/// <summary>
/// Starts a new pickuptimer with the given time (in seconds)
/// </summary>
/// <param name="time"></param>
public void StartPickupTimer(int time)
{
if (m_pickup != null)
{
m_pickup.Stop();
m_pickup = null;
}
m_pickup = new RegionTimer(this, new RegionTimerCallback(CallBack), time * 1000);
}
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:WorldInventoryItem.cs
示例17: CarrierTimerTick
/// <summary>
/// The callback for the pulsing spelleffect
/// </summary>
/// <param name="timer">The ObjectTimerCallback object</param>
private int CarrierTimerTick(RegionTimer timer)
{
//update the relic position
Update();
// check to make sure relic is in a legal region and still in the players backpack
if (GameServer.KeepManager.FrontierRegionsList.Contains(CurrentRegionID) == false)
{
log.DebugFormat("{0} taken out of frontiers, relic returned to previous pad.", Name);
RelicPadTakesOver(ReturnRelicPad, true);
SaveIntoDatabase();
AddToWorld();
return 0;
}
if (CurrentCarrier != null && CurrentCarrier.Inventory.GetFirstItemByID(m_item.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) == null)
{
log.DebugFormat("{0} not found in carriers backpack, relic returned to previous pad.", Name);
RelicPadTakesOver(ReturnRelicPad, true);
SaveIntoDatabase();
AddToWorld();
return 0;
}
//fireworks spells temp
ushort effectID = (ushort)Util.Random(5811, 5815);
foreach (GamePlayer ppl in m_currentCarrier.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
ppl.Out.SendSpellEffectAnimation(m_currentCarrier, m_currentCarrier, effectID, 0, false, 0x01);
return RelicEffectInterval;
}
开发者ID:andyhebear,项目名称:DOLSharp,代码行数:36,代码来源:GameRelic.cs
示例18: StartPlayerTimer
/// <summary>
/// Starts the "signalising effect" sequence on the carrier.
/// </summary>
/// <param name="player">Player to set the timer on. Timer stops if param is null</param>
protected virtual void StartPlayerTimer(GamePlayer player)
{
if (player != null)
{
if (m_currentCarrierTimer != null)
{
log.Warn("GameRelic: PlayerTimer already set on a player, stopping timer!");
m_currentCarrierTimer.Stop();
m_currentCarrierTimer = null;
}
m_currentCarrierTimer = new RegionTimer(player, new RegionTimerCallback(CarrierTimerTick));
m_currentCarrierTimer.Start(RelicEffectInterval);
}
else
{
if (m_currentCarrierTimer != null)
{
m_currentCarrierTimer.Stop();
m_currentCarrierTimer = null;
}
}
}
开发者ID:andyhebear,项目名称:DOLSharp,代码行数:29,代码来源:GameRelic.cs
示例19: StartDecay
private void StartDecay()
{
if (ObjectState != eObjectState.Active)
return;
lock (m_decayTimerLock)
{
if (m_decayTimer == null)
{
m_decayTimer = new RegionTimer(this);
m_decayTimer.Callback = new RegionTimerCallback(DecayTimerCallback);
}
else if (m_decayTimer.IsAlive)
return;
m_decayTimer.Start(DECAYPERIOD);
}
}
开发者ID:mynew4,项目名称:DAoC,代码行数:16,代码来源:GameSiegeWeapon.cs
示例20: RespawnTimerCallback
/// <summary>
/// The callback that will respawn this mob
/// </summary>
/// <param name="respawnTimer">the timer calling this callback</param>
/// <returns>the new interval</returns>
protected virtual int RespawnTimerCallback(RegionTimer respawnTimer)
{
int dummy;
// remove Mob from "respawning"
CurrentRegion.MobsRespawning.TryRemove(this, out dummy);
lock (m_respawnTimerLock)
{
if (m_respawnTimer != null)
{
m_respawnTimer.Stop();
m_respawnTimer = null;
}
}
//DOLConsole.WriteLine("respawn");
//TODO some real respawn handling
if (IsAlive) return 0;
if (ObjectState == eObjectState.Active) return 0;
//Heal this mob, move it to the spawnlocation
Health = MaxHealth;
Mana = MaxMana;
Endurance = MaxEndurance;
int origSpawnX = m_spawnPoint.X;
int origSpawnY = m_spawnPoint.Y;
//X=(m_spawnX+Random(750)-350); //new SpawnX = oldSpawn +- 350 coords
//Y=(m_spawnY+Random(750)-350); //new SpawnX = oldSpawn +- 350 coords
X = m_spawnPoint.X;
Y = m_spawnPoint.Y;
Z = m_spawnPoint.Z;
Heading = m_spawnHeading;
AddToWorld();
m_spawnPoint.X = origSpawnX;
m_spawnPoint.Y = origSpawnY;
return 0;
}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:42,代码来源:GameNPC.cs
注:本文中的DOL.GS.RegionTimer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论