Esempio n. 1
0
 public void Release()
 {
     Player  = null;
     Target  = null;
     Buttons = null;
     Rewards = null;
 }
Esempio n. 2
0
 public void Release()
 {
     Player = null;
     Target = null;
     Buttons = null;
     Rewards = null;
 }
Esempio n. 3
0
        public override void Release()
        {
            ObservedCreature = null;

            Inventory.Release();
            Inventory = null;

            PlayerData = null;

            try
            {
                Visible.Stop();
                Visible.Release();
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                //Already stoped
            }
            Visible = null;

            Skills = null;

            Quests = null;

            if (CurrentDialog != null)
            {
                CurrentDialog.Release();
            }

            if (Pet != null)
            {
                Pet.Release();
            }
            Pet = null;

            MarkedCreatures = null;

            TeleportLoadMapEvent = null;

            try
            {
                SystemWindowsTimer.Stop();
                SystemWindowsTimer.Dispose();
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
            }
            SystemWindowsTimer = null;

            BlockersInChat = null;

            Friends = null;

            base.Release();
        }
Esempio n. 4
0
        public Dialog(Player.Player player, Npc.Npc target, int special, int dialogId, int stage = 1)
        {
            Player   = player;
            Target   = target;
            Special  = special;
            DialogId = dialogId;
            Stage    = stage;

            Buttons = new List <DialogButton>();
            Rewards = new List <QuestReward>();
        }
Esempio n. 5
0
        public Dialog(Player.Player player, Npc.Npc target, int special, int dialogId, int stage = 1)
        {
            Player = player;
            Target = target;
            Special = special;
            DialogId = dialogId;
            Stage = stage;

            Buttons = new List<DialogButton>();
            Rewards = new List<QuestReward>();
        }
Esempio n. 6
0
        public static void DrawMapNpcName(RendererDestinationData destData, Map activeMap, Enums.MapID targetMapID, int npcSlot)
        {
            Color nameColor = Color.White;

            if (activeMap.MapNpcs[npcSlot].Enemy)
            {
                nameColor = Color.Red;
            }
            Npc.Npc npc = Npc.NpcHelper.Npcs[activeMap.MapNpcs[npcSlot].Num];

            string name = npc.Name;

            //if (Globals.FoolsMode) {
            //    name = "EBIL Zubat";
            //}

            SpriteRenderer.DrawSpriteName(destData, activeMap, targetMapID, activeMap.MapNpcs[npcSlot], nameColor, name);
        }
Esempio n. 7
0
        public Projectile(Creature.Creature owner, ProjectileSkill projectileSkill)
        {
            Player.Player player = owner as Player.Player;
            Npc.Npc       npc    = owner as Npc.Npc;

            Parent = owner;

            if (npc != null)
            {
                TargetPosition = new WorldPosition();
                npc.Target.Position.CopyTo(TargetPosition);
            }
            else
            {
                TargetPosition = owner.Attack.Args.TargetPosition;
            }

            Position = new WorldPosition
            {
                Heading = owner.Position.Heading,
                X       = owner.Position.X,
                Y       = owner.Position.Y,
                Z       = owner.Position.Z + projectileSkill.DetachHeight,
            };

            double angle = Position.Heading * Math.PI / 32768;

            Position.X += projectileSkill.DetachDistance * (float)Math.Cos(angle);
            Position.Y += projectileSkill.DetachDistance * (float)Math.Sin(angle);

            Instance        = owner.Instance;
            ProjectileSkill = projectileSkill;
            GameStats       = new CreatureBaseStats {
                HpBase = 1
            };

            if (player != null)
            {
                Skill   = Data.Skills[0][player.TemplateId][ProjectileSkill.Id];
                SkillId = Skill.Id;
            }
            else if (npc != null)
            {
                Skill   = Data.Skills[npc.NpcTemplate.HuntingZoneId][npc.NpcTemplate.Id][ProjectileSkill.Id];
                SkillId = Skill.Id + 0x40000000 + (npc.NpcTemplate.HuntingZoneId << 16);
            }

            Lifetime = Skill.ProjectileData.LifeTime != 0
                           ? Skill.ProjectileData.LifeTime
                           : 1000;

            if (projectileSkill.FlyingDistance <= 0f)
            {
                TargetPosition = null;
            }
            else if (Skill != null)
            {
                if (TargetPosition.IsNull())
                {
                    TargetPosition = Position.Clone();

                    TargetPosition.X += projectileSkill.FlyingDistance * (float)Math.Cos(angle);
                    TargetPosition.Y += projectileSkill.FlyingDistance * (float)Math.Sin(angle);
                }

                Speed = (int)(projectileSkill.FlyingDistance * 1000 / Lifetime);
            }

            if (Skill != null)
            {
                if (Skill.TargetingList != null)
                {
                    for (int i = 0; i < Skill.TargetingList.Count; i++)
                    {
                        if (Skill.TargetingList[i].AreaList == null)
                        {
                            continue;
                        }

                        for (int j = 0; j < Skill.TargetingList[i].AreaList.Count; j++)
                        {
                            if (Skill.TargetingList[i].AreaList[j].MaxRadius > AttackDistance)
                            {
                                AttackDistance = Skill.TargetingList[i].AreaList[j].MaxRadius;
                                return;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 8
0
        public override void Release()
        {
            ObservedCreature = null;

            Inventory.Release();
            Inventory = null;

            PlayerData = null;

            try
            {
                Visible.Stop();
                Visible.Release();
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                //Already stoped
            }
            Visible = null;

            Skills = null;

            Quests = null;

            if (CurrentDialog != null)
                CurrentDialog.Release();

            if (Pet != null)
                Pet.Release();
            Pet = null;

            MarkedCreatures = null;

            TeleportLoadMapEvent = null;

            try
            {
                SystemWindowsTimer.Stop();
                SystemWindowsTimer.Dispose();
            }
                // ReSharper disable EmptyGeneralCatchClause
            catch
                // ReSharper restore EmptyGeneralCatchClause
            {
            }
            SystemWindowsTimer = null;

            BlockersInChat = null;

            Friends = null;

            base.Release();
        }
Esempio n. 9
0
 public virtual void OnNpcKill(Player.Player killer, Npc.Npc killed)
 {
 }
Esempio n. 10
0
 public void AddNpc(Npc.Npc npc)
 {
     npc.UID = (short)NpcUID.GetNext();
     Npcs.Add(npc);
 }