private uint duration = 15; // 15 Sec duration public override void Execute(GameLiving living) { if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return; base.Execute(living); GamePlayer player = living as GamePlayer; if (player == null) return; if (player.IsMoving) { player.Out.SendMessage("You must be standing still to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } foreach (GamePlayer i_player in player.GetPlayersInRadius(WorldMgr.INFO_DISTANCE)) { if (i_player == player) i_player.Out.SendMessage("You cast a Wall of Flame!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow); else i_player.Out.SendMessage(player.Name + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow); i_player.Out.SendSpellCastAnimation(player, 7028, 20); } Statics.WallOfFlameBase wof = new Statics.WallOfFlameBase(dmgValue); Point3D targetSpot = new Point3D(player.X, player.Y, player.Z); wof.CreateStatic(player, targetSpot, duration, 3, 150); DisableSkill(living); player.StopCurrentSpellcast(); }
///<summary>Calculate flee target.</summary> ///<param>The target to flee.</param> protected virtual void CalculateFleeTarget(GameLiving target) { Point3D stalker = new Point3D(target.X, target.Y, target.Z); ushort NotTarget = Body.GetHeading( stalker ); ushort TargetAngle = (ushort)((NotTarget + 2048) % 4096); Body.Heading = TargetAngle; Point2D fleePoint = Body.GetPointFromHeading( Body.Heading, 300 ); Body.StopFollowing(); Body.StopAttack(); Body.WalkTo( fleePoint.X, fleePoint.Y, Body.Z, Body.MaxSpeed ); }
public static Point3D ConvertRegionPointToZone(int zoneID, Point3D global) { Point3D local = new Point3D(); DataRow[] row = DB.ZoneTable.Select(DB.COL_ZONE_ID+"=" + zoneID); if (row.Length > 0) { local.X = global.X - Convert.ToInt32(row[0][DB.COL_ZONE_OFFSETX]) * 8192; local.Y = global.Y - Convert.ToInt32(row[0][DB.COL_ZONE_OFFSETY]) * 8192; local.Z = global.Z; } return global; }
public override void Execute(GameLiving living) { if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return; GamePlayer caster = living as GamePlayer; if (caster.TargetObject == null) { caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (!(caster.TargetObject is GameLiving) || !GameServer.ServerRules.IsAllowedToAttack(caster, (GameLiving)caster.TargetObject, true)) { caster.Out.SendMessage("You cannot attack " + caster.TargetObject.Name + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (!caster.TargetInView) { caster.Out.SendMessage("You cannot see " + caster.TargetObject.Name + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (!caster.IsWithinRadius( caster.TargetObject, 1500 )) { caster.Out.SendMessage("You target is too far away to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } this.m_player = caster; switch (Level) { case 1: m_duration = 10; break; case 2: m_duration = 15; break; case 3: m_duration = 30; break; default: return; } m_stunDuration = 3; foreach (GamePlayer i_player in caster.GetPlayersInRadius(WorldMgr.INFO_DISTANCE)) { if (i_player == caster) { i_player.MessageToSelf("You cast " + this.Name + "!", eChatType.CT_Spell); } else { i_player.MessageFromArea(caster, caster.Name + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow); } } Statics.StaticTempestBase st = new Statics.StaticTempestBase(m_stunDuration); Point3D targetSpot = new Point3D(caster.TargetObject.X, caster.TargetObject.Y, caster.TargetObject.Z); st.CreateStatic(caster, targetSpot, m_duration, 5, 360); DisableSkill(living); }
public void CreateStatic(GamePlayer caster, Point3D gt, uint lifeTime, uint pulseFrequency, ushort radius) { m_lifeTime = lifeTime; m_caster = caster; m_radius = radius; m_pulseFrequency = pulseFrequency; this.Name = GetStaticName(); this.Model = GetStaticModel(); this.X = gt.X; this.Y = gt.Y; this.Z = gt.Z; this.CurrentRegionID = m_caster.CurrentRegionID; this.Level = caster.Level; this.Realm = caster.Realm; this.AddToWorld(); }
/// <summary> /// Calculate the target position with given height and displacement. /// </summary> /// <param name="x">Current object X position.</param> /// <param name="y">Current object Y position.</param> /// <param name="z">Current object Z position.</param> /// <param name="height">Height the object is to be lifted to.</param> /// <param name="heading">The direction the object is displaced in.</param> /// <param name="displacement">The amount the object is displaced by.</param> /// <returns></returns> private Point3D PositionOfTarget(IPoint3D target, int height, int heading, int displacement) { Point3D targetPoint; targetPoint = new Point3D(target.GetPointFromHeading((ushort)heading, displacement), target.Z + height); return targetPoint; }
/// <summary> /// Constructs a NPC /// </summary> public GameNPC() : base() { Level = 1; // health changes when GameNPC.Level changes m_Realm = 0; m_name = "new mob"; m_model = 408; //Fill the living variables // CurrentSpeed = 0; // cause position addition recalculation MaxSpeedBase = 200; GuildName = ""; m_brainSync = m_brains.SyncRoot; m_followTarget = new WeakRef(null); m_size = 50; //Default size TargetPosition = new Point3D(); m_followMinDist = 100; m_followMaxDist = 3000; m_flags = 0; m_maxdistance = 0; m_roamingRange = 0; // default to non roaming - tolakram m_ownerID = ""; if ( m_spawnPoint == null ) m_spawnPoint = new Point3D(); //m_factionName = ""; LinkedFactions = new ArrayList(1); if (m_ownBrain == null) { m_ownBrain = new StandardMobBrain(); m_ownBrain.Body = this; } }
/// <summary> /// Creates a new TurnBackAction /// </summary> /// <param name="actionSource">The source of action</param> public RestoreHeadingAction(GameNPC actionSource) : base(actionSource) { m_oldHeading = actionSource.Heading; m_oldPosition = new Point3D(actionSource); }
/// <summary> /// Gets the areas for a certain spot, /// less performant than getAreasOfZone so use other on if possible /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <returns></returns> public virtual IList GetAreasOfSpot(int x, int y, int z) { Zone zone = GetZone(x, y); Point3D p = new Point3D(x, y, z); return GetAreasOfZone(zone, p); }
public void SendChangeGroundTarget(Point3D newTarget) { }
private void position_ValueChanged(object sender, EventArgs e) { if (disableEvents) return; if (comboBoxZone.SelectedItem != null) { disableEvents = true; DataRowView zoneRow = (DataRowView)comboBoxZone.SelectedItem; Point3D local = new Point3D(Convert.ToInt32(zoneX.Value), Convert.ToInt32(zoneY.Value), Convert.ToInt32(zoneZ.Value)); Point3D global = Utils.ConvertZonePointToRegion((int)zoneRow[DB.COL_ZONE_ID], local); loc.X = global.X; loc.Y = global.Y; loc.Z = global.Z; regionX.Value = global.X; regionY.Value = global.Y; if (cbComputeZ.Checked) { updateZ(); } else { regionZ.Value = global.Z; } disableEvents = false; } }
public void SendChangeGroundTarget(Point3D newTarget) { if (SendChangeGroundTargetMethod != null) SendChangeGroundTargetMethod(this, newTarget); }