Esempio n. 1
0
        public static Actor Create(World world, int snoId, TagMap tagMap)
        {
            if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId))
                return null;

            var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId];            
            var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor;
            if (actorData == null) return null;

            if (actorData.Type == ActorType.Invalid) 
                return null;

            // read tagMapEntries and put them into a dictionary
            var tags = tagMap.TagMapEntries.ToDictionary(entry => entry.TagID);

            // see if we have an implementation for actor.
            if (SNOHandlers.ContainsKey(snoId))
                return (Actor) Activator.CreateInstance(SNOHandlers[snoId], new object[] {world, snoId, tags});
           
            switch (actorData.Type)
            {
                case ActorType.Monster:
                    if(tags.ContainsKey((int)MarkerTagTypes.ConversationList))
                        return new InteractiveNPC(world, snoId, tags);
                    else
                        return new Monster(world, snoId, tags);
                case ActorType.Gizmo:
                    return CreateGizmo(world, snoId, tags);

            }

            return null;
        }
Esempio n. 2
0
 public Hireling(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Attributes[GameAttribute.TeamID] = 2;
     Interactions.Add(new HireInteraction());
     Interactions.Add(new InventoryInteraction());
 }
Esempio n. 3
0
        public Portal(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Destination = new ResolvedPortalDestination
            {
                WorldSNO = tags[TagKeys.DestinationWorld].Id,
            };

            if (tags.ContainsKey(TagKeys.DestinationLevelArea))
                this.Destination.DestLevelAreaSNO = tags[TagKeys.DestinationLevelArea].Id;

            if (tags.ContainsKey(TagKeys.DestinationActorTag))
                this.Destination.StartingPointActorTag = tags[TagKeys.DestinationActorTag];
            else
                Logger.Warn("Found portal {0}without target location actor", this.ActorSNO.Id);

            this.Field2 = 16;

            // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
            this.Attributes[GameAttribute.MinimapActive] = true;
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
            this.Attributes[GameAttribute.TeamID] = 1;
            this.Attributes[GameAttribute.Level] = 1;
        }
Esempio n. 4
0
 public Vendor(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Attributes[GameAttribute.MinimapActive] = true;
     _vendorGrid = new InventoryGrid(this, 1, 20, (int) EquipmentSlotId.Vendor);
     PopulateItems();
 }
Esempio n. 5
0
 public Minion(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     // The following two seems to be shared with monsters. One wonders why there isn't a specific actortype for minions.
     this.Field2 = 0x8; 
     this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1;
 }
Esempio n. 6
0
        private static Actor CreateGizmo(World world, int snoId, TagMap tags)
        {
            if (tags.ContainsKey(MarkerKeys.DestinationWorld))
                return new Portal(world, snoId, tags);

            return new Gizmo(world, snoId, tags);
        }
Esempio n. 7
0
        public Monster(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Field2 = 0x8;
            this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1;
            this.Attributes[GameAttribute.Experience_Granted] = 125;

        }
Esempio n. 8
0
 public NPC(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Field2 = 0x9;
     this.Field7 = 2;
     this.Attributes[GameAttribute.TeamID] = 1;
     this.Attributes[GameAttribute.Is_NPC] = true;
 }
Esempio n. 9
0
 public Cain(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Attributes[GameAttribute.MinimapActive] = true;
     Conversations.Add(new ConversationInteraction(72416));
     Conversations.Add(new ConversationInteraction(198588));
     Conversations.Add(new ConversationInteraction(73171));
     Interactions.Add(new IdentifyAllInteraction());
 }
Esempio n. 10
0
 public Scoundrel(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     mainSNO = 4644;
     hirelingSNO = 52694;
     proxySNO = 192941;
     skillKit = 0x8AFE;
     hirelingGBID = StringHashHelper.HashItemName("Scoundrel");
     Attributes[GameAttribute.Hireling_Class] = 2;
 }
Esempio n. 11
0
 public Templar(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     mainSNO = 4538;
     hirelingSNO = 0x0000CDD5;  
     proxySNO = 0x0002F1AC;
     skillKit = 0x8AFB;
     hirelingGBID = StringHashHelper.HashItemName("Templar");
     this.Attributes[GameAttribute.Hireling_Class] = 1;
 }
Esempio n. 12
0
 public Enchantress(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     mainSNO = 4062;
     hirelingSNO = -1;
     proxySNO = 192942;
     skillKit = 87094;
     hirelingGBID = StringHashHelper.HashItemName("Enchantress");
     Attributes[Mooege.Net.GS.Message.GameAttribute.Hireling_Class] = 3;
 }
Esempio n. 13
0
 public Minion(World world, int snoId, Actor master, TagMap tags)
     : base(world, snoId, tags)
 {
     // The following two seems to be shared with monsters. One wonders why there isn't a specific actortype for minions.
     this.Master = master;
     this.Field2 = 0x8; 
     this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1;
     this.Attributes[GameAttribute.Summoned_By_ACDID] = (int)master.DynamicID;
     this.Attributes[GameAttribute.TeamID] = master.Attributes[GameAttribute.TeamID];
 }
Esempio n. 14
0
        public Ravenous(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Brain = new MonsterBrain(this);
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 5f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 5f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 5f;

            
        }
Esempio n. 15
0
 public Zombie(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Brain = new MonsterBrain(this);
     this.Attributes[GameAttribute.Hitpoints_Max_Total] = 5f;
     this.Attributes[GameAttribute.Hitpoints_Max] = 5f;
     this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
     this.Attributes[GameAttribute.Hitpoints_Cur] = 5f;
     this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;
     this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 5f;
     this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 7f;
 }
Esempio n. 16
0
        public InteractiveNPC(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true;
            this.Attributes[GameAttribute.NPC_Is_Operatable] = true;
            //this.Attributes[GameAttribute.Buff_Visual_Effect, 0x00FFFFF] = true;
            Interactions = new List<IInteraction>();
            Conversations = new List<ConversationInteraction>();

            foreach(var quest in World.Game.Quests)
                quest.OnQuestProgress += new Games.Quest.QuestProgressDelegate(quest_OnQuestProgress);
            UpdateConversationList(); // show conversations with no quest dependency
        }
Esempio n. 17
0
        public MommySpider(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Brain = new MonsterBrain(this);
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 2f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 2f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 2f;

            this.Attributes[GameAttribute.Movement_Bonus_Run_Speed] = 15f;

            this.Attributes[GameAttribute.Skill_Total, 76961] = 1;  //Spider_Web_Slow.pow
            this.Attributes[GameAttribute.Skill, 76961] = 1;
            this.Attributes[GameAttribute.Trait, 76961] = 1;
            this.Attributes[GameAttribute.Buff_Active, 76961] = true;
            this.Attributes[GameAttribute.Buff_Icon_Count0, 76961] = 1;
        }
Esempio n. 18
0
        public Ghost(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Brain = new MonsterBrain(this);
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 15f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 15f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 15f;
            this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;
            this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 15f;
            this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 7f;

            this.Attributes[GameAttribute.Skill_Total, 30525] = 1;  //SporeCloud.pow
            this.Attributes[GameAttribute.Skill, 30525] = 1;
            this.Attributes[GameAttribute.Trait, 30525] = 1;
            this.Attributes[GameAttribute.Buff_Active, 30525] = true;
            this.Attributes[GameAttribute.Buff_Icon_Count0, 30525] = 1;
        }
Esempio n. 19
0
        public Living(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Monster = new SNOHandle(SNOGroup.Monster, (ActorData.MonsterSNO));

            // FIXME: This is hardcoded crap
            this.SetFacingRotation((float)(RandomHelper.NextDouble() * 2.0f * Math.PI));
            this.GBHandle.Type = -1; this.GBHandle.GBID = -1;
            this.Field7 = 0x00000001;
            this.Field10 = 0x0;

            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 4.546875f;

            this.Attributes[GameAttribute.Level] = 1;
        }
Esempio n. 20
0
        public Monster(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Field2 = 0x8;
            this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1;
            this.Attributes[GameAttribute.TeamID] = 10;
            this.Attributes[GameAttribute.Experience_Granted] = 125;
            var monsterAsset = MPQStorage.Data.Assets[SNOGroup.Monster][SNOMonsterId];
            var monsterData = monsterAsset.Data as Mooege.Common.MPQ.FileFormats.Monster;
            if (monsterData != null)
            {
                LoreSNOId = monsterData.SNOLore;
            }
            else
            {
                LoreSNOId = -1;
            }

        }
Esempio n. 21
0
        public Living(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.SNOMonsterId = this.ActorData.MonsterSNO;

            // FIXME: This is hardcoded crap
            this.FacingAngle = (float)(RandomHelper.NextDouble() * 2.0f * Math.PI);
            this.RotationAxis.X = 0f; this.RotationAxis.Y = 0f; this.RotationAxis.Z = 1f;
            this.GBHandle.Type = -1; this.GBHandle.GBID = -1;
            this.Field7 = 0x00000001;
            this.Field10 = 0x0;

            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 4.546875f;

            this.Attributes[GameAttribute.Level] = 1;
        }
Esempio n. 22
0
        public static Actor Create(World world, int snoId, TagMap tags)
        {
            if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId))
                return null;

            var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId];            
            var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor;
            if (actorData == null) return null;

            if (actorData.Type == ActorType.Invalid) 
                return null;

            // see if we have an implementation for actor.
            if (SNOHandlers.ContainsKey(snoId))
                return (Actor) Activator.CreateInstance(SNOHandlers[snoId], new object[] {world, snoId, tags});
           
            switch (actorData.Type)
            {
                case ActorType.Monster:
                    if(tags.ContainsKey(MarkerKeys.ConversationList))
                        return new InteractiveNPC(world, snoId, tags);
                    else
                        if (!MPQStorage.Data.Assets[SNOGroup.Monster].ContainsKey(actorData.MonsterSNO))
                        return null;

                        var monsterAsset = MPQStorage.Data.Assets[SNOGroup.Monster][actorData.MonsterSNO];
                        var monsterData = monsterAsset.Data as Mooege.Common.MPQ.FileFormats.Monster;
                        if (monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Ally ||
                            monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Helper)
                            return new NPC(world, snoId, tags);
                        else
                            return new Monster(world, snoId, tags);
                case ActorType.Gizmo:
                    return CreateGizmo(world, snoId, tags);

                case ActorType.ServerProp:
                    return new ServerProp(world, snoId, tags);

            }

            return null;
        }
Esempio n. 23
0
File: World.cs Progetto: Naxp/mooege
 public void Read(MpqFileStream stream)
 {
     this.Name = stream.ReadString(128, true);
     CommandType = stream.ReadValueS32();
     this.TagMap = stream.ReadSerializedItem<TagMap>();
     stream.Position += (3 * 4);
 }
Esempio n. 24
0
File: World.cs Progetto: Naxp/mooege
        public void Read(MpqFileStream stream)
        {
            Tiles = stream.ReadSerializedData<TileInfo>();

            stream.Position += (14 * 4);
            this.CommandCount = stream.ReadValueS32();
            this.Commands = stream.ReadSerializedData<DRLGCommand>();

            stream.Position += (3 * 4);
            this.ParentIndices = stream.ReadSerializedInts();

            stream.Position += (2 * 4);
            this.TagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
        }
Esempio n. 25
0
 public override Hireling CreateHireling(World world, int snoId, TagMap tags)
 {
     return new Enchantress(world, snoId, tags);
 }
Esempio n. 26
0
 public Gizmo(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Field2 = 16;
     this.Field7 = 0x00000001;
 }
Esempio n. 27
0
 public Stash(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 { }
Esempio n. 28
0
 public Waypoint(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     this.Attributes[GameAttribute.MinimapActive] = true;
 }
Esempio n. 29
0
 public Jeweler(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
 }
Esempio n. 30
0
 public Zombie(World world, int snoId, TagMap tags)
     : base(world, snoId, tags)
 {
     // this.Brain = new MonsterBrain(this);
 }