예제 #1
0
        // Allows cooking a custom item.
        public static Item Cook(Player player, string name)
        {
            int       hash       = StringHashHelper.HashItemName(name);
            ItemTable definition = Items[hash];

            return(CookFromDefinition(player, definition));
        }
예제 #2
0
파일: Scoundrel.cs 프로젝트: xPathin/DiIiS-
        public Scoundrel(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            Brain = new AI.Brains.HirelingBrain(this);

            mainSNO      = 4644;
            hirelingSNO  = 52694;
            proxySNO     = 192941;
            skillKit     = 0x8AFE;
            hirelingGBID = StringHashHelper.HashItemName("Scoundrel");
            Attributes[GameAttribute.Hireling_Class] = 2;

            try
            {
                foreach (var player in world.Players)
                {
                    Master = world.GetActorBySNO(player.Value.ActorSNO.Id);
                }
            }catch { }
            this.Attributes[GameAttribute.Attacks_Per_Second]     = 1.0f;
            this.Attributes[GameAttribute.Damage_Weapon_Min, 0]   = 5f;
            this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
            //RandomDirection(player.Value.Position, 3f, 8f);
            //this.WalkSpeed = 0.3f * monsterData.Floats[129];  // TODO: this is probably multiplied by something erekose the 0.3 is because he is way too fast otherwise
            this.WalkSpeed = this.RunSpeed;
        }
예제 #3
0
        private static void LoadHandlers()
        {
            foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (!type.IsSubclassOf(typeof(Item)))
                {
                    continue;
                }

                var attributes = (HandledItemAttribute[])type.GetCustomAttributes(typeof(HandledItemAttribute), true);
                if (attributes.Length != 0)
                {
                    foreach (var name in attributes.First().Names)
                    {
                        GBIDHandlers.Add(StringHashHelper.HashItemName(name), type);
                    }
                }

                var typeAttributes = (HandledTypeAttribute[])type.GetCustomAttributes(typeof(HandledTypeAttribute), true);
                if (typeAttributes.Length != 0)
                {
                    foreach (var typeName in typeAttributes.First().Types)
                    {
                        TypeHandlers.Add(StringHashHelper.HashItemName(typeName), type);
                    }
                }
            }
        }
예제 #4
0
        public LeahParty(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            Brain = new AI.Brains.HirelingBrain(this);


            mainSNO      = 144681;
            hirelingSNO  = 52694;
            proxySNO     = 192941;
            skillKit     = 0x8AFE;
            hirelingGBID = StringHashHelper.HashItemName("Leah_Party");
            Attributes[GameAttribute.Hireling_Class] = 2;

            try
            {
                foreach (var player in world.Players)
                {
                    Master = world.GetActorBySNO(player.Value.ActorSNO.Id);
                }
            }
            catch { }
            this.Attributes[GameAttribute.Attacks_Per_Second]     = 1.0f;
            this.Attributes[GameAttribute.Damage_Weapon_Min, 0]   = 5f;
            this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
            this.WalkSpeed = this.RunSpeed;

            (Brain as AI.Brains.HirelingBrain).AddPresetPower(30252); //Range_instant
        }
예제 #5
0
        private static ItemTable GetRandom(List <ItemTable> pool)
        {
            var       found          = false;
            ItemTable itemDefinition = null;

            while (!found)
            {
                itemDefinition = pool[RandomHelper.Next(0, pool.Count() - 1)];

                if (itemDefinition.SNOActor == -1)
                {
                    continue;
                }

                // if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue != 0)) return itemDefinition; // testing books /xsochor
                // if (itemDefinition.ItemType1 != StringHashHelper.HashItemName("Book")) continue; // testing books /xsochor
                // if (!ItemGroup.SubTypesToHashList("SpellRune").Contains(itemDefinition.ItemType1)) continue; // testing spellrunes /xsochor

                // ignore gold and healthglobe, they should drop only when expect, not randomly
                if (itemDefinition.Name.ToLower().Contains("gold"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("healthglobe"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("pvp"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("unique"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("crafted"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("debug"))
                {
                    continue;
                }
                if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue == 0))
                {
                    continue;                                                                                                             // i hope it catches all lore with npc spawned /xsochor
                }
                if (!GBIDHandlers.ContainsKey(itemDefinition.Hash) &&
                    !AllowedItemTypes.Contains(itemDefinition.ItemType1))
                {
                    continue;
                }

                found = true;
            }

            return(itemDefinition);
        }
예제 #6
0
        public string HashNormal(string[] @params, MooNetClient invokerClient)
        {
            if (@params.Count() < 1)
            {
                return("Invalid arguments. Type 'help hash show' to get help.");
            }

            return(StringHashHelper.HashNormal(@params[0]).ToString());
        }
예제 #7
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;
 }
예제 #8
0
파일: Scoundrel.cs 프로젝트: wlasser/D3Emu
 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;
 }
예제 #9
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;
 }
예제 #10
0
파일: Toon.cs 프로젝트: DZilli/mooege
 /// <summary>
 /// Happens only when a hero is created so a hashing of all values can be afforded
 /// </summary>
 /// <param name="classHash"></param>
 /// <returns></returns>
 private static int GetClassFromHash(int classHash)
 {
     foreach (ToonClass heroClass in Enum.GetValues(typeof(ToonClass)))
     {
         if (StringHashHelper.HashNormal(heroClass.ToString().ToLower()) == classHash)
         {
             return((int)(ToonClass)heroClass);
         }
     }
     return(0);
 }
예제 #11
0
        // Allows cooking a custom item.
        public static Item Cook(Player player, string name)
        {
            int       hash       = StringHashHelper.HashItemName(name);
            ItemTable definition = Items[hash];
            Type      type       = GetItemClass(definition);

            var item = (Item)Activator.CreateInstance(type, new object[] { player.World, definition });

            //player.GroundItems[item.DynamicID] = item;

            return(item);
        }
예제 #12
0
        public Account(string email, string password, string battleTagName, int hashCode, UserLevels userLevel) // Account with **newly generated** persistent ID
            : base(StringHashHelper.HashIdentity(battleTagName + "#" + hashCode.ToString("D4")))
        {
            if (password.Length > 16)
            {
                password = password.Substring(0, 16);                       // make sure the password does not exceed 16 chars.
            }
            var salt             = SRP6a.GetRandomBytes(32);
            var passwordVerifier = SRP6a.CalculatePasswordVerifierForAccount(email, password, salt);

            this.SetFields(email, salt, passwordVerifier, battleTagName, hashCode, userLevel);
        }
예제 #13
0
파일: Portal.cs 프로젝트: wlasser/mooege-2
        public override bool Reveal(Player player)
        {
            //Logger.Debug(" (Reveal) portal {0} has location {1}", this.ActorSNO, this._position);


            if (!base.Reveal(player) || this.Destination == null)
            {
                return(false);
            }

            player.InGameClient.SendMessage(new PortalSpecifierMessage()
            {
                ActorID     = this.DynamicID,
                Destination = this.Destination
            });

            // Show a minimap icon
            Mooege.Common.MPQ.Asset asset;
            string markerName = "";

            if (Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.LevelArea].TryGetValue(this.Destination.DestLevelAreaSNO, out asset))
            {
                markerName = System.IO.Path.GetFileNameWithoutExtension(asset.FileName);
            }

            player.InGameClient.SendMessage(new MapMarkerInfoMessage()
            {
                Field0 = (int)World.NewSceneID,    // TODO What is the correct id space for mapmarkers?
                Field1 = new WorldPlace()
                {
                    Position = this.Position,
                    WorldID  = this.World.DynamicID
                },
                Field2          = MinimapIcon,                         //   0x00018FB0,  /* Marker_DungeonEntrance.tex */          // TODO Dont mark all portals as dungeon entrances... some may be exits too (although d3 does not necesarrily use the correct markers). Also i have found no hacky way to determine whether a portal is entrance or exit - farmy
                m_snoStringList = 0x0000CB2E, /* LevelAreaNames.stl */ // TODO Dont use hardcoded numbers

                Field3  = StringHashHelper.HashNormal(markerName),
                Field9  = 0,
                Field10 = 0,
                Field11 = 0,
                Field5  = 0,
                Field6  = true,
                Field7  = false,
                Field8  = true,
                Field12 = 0
            });
            return(true);
        }
예제 #14
0
        /// <summary>
        /// Makes an RPC over remote client.
        /// </summary>
        /// <param name="method">The method to call.</param>
        /// <param name="controller">The rpc controller.</param>
        /// <param name="request">The request message.</param>
        /// <param name="responsePrototype">The response message.</param>
        /// <param name="done">Action to run when client responds RPC.</param>
        public void CallMethod(MethodDescriptor method, IRpcController controller, IMessage request, IMessage responsePrototype, Action <IMessage> done)
        {
            var serviceName = method.Service.FullName;
            var serviceHash = StringHashHelper.HashIdentity(serviceName);

            if (!this.Services.ContainsKey(serviceHash))
            {
                Logger.Error("Not bound to client service {0} [0x{1}] yet.", serviceName, serviceHash.ToString("X8"));
                return;
            }

            var serviceId = this.Services[serviceHash];
            var token     = this._tokenCounter++;

            RPCCallbacks.Add(token, new RPCCallback(done, responsePrototype.WeakToBuilder()));

            var packet = new PacketOut((byte)serviceId, MooNetRouter.GetMethodId(method), (uint)token, this._listenerId, request);

            this.Connection.Send(packet);
        }
예제 #15
0
        public void CallMethod(MethodDescriptor method, IMessage request, ulong localObjectId)
        {
            var serviceName = method.Service.FullName;
            var serviceHash = StringHashHelper.HashIdentity(serviceName);

            if (!this.Services.ContainsKey(serviceHash))
            {
                Logger.Error("Not bound to client service {0} [0x{1}] yet.", serviceName, serviceHash.ToString("X8"));
                return;
            }

            var serviceId      = this.Services[serviceHash];
            var remoteObjectId = GetRemoteObjectID(localObjectId);

            Logger.Debug("Calling {0} localObjectId={1}, remoteObjectId={2}", method.FullName, localObjectId, remoteObjectId);

            var packet = new BNetPacket(
                new BNetHeader((byte)serviceId, (uint)(method.Index + 1), this._requestCounter++, (uint)request.SerializedSize, remoteObjectId),
                request.ToByteArray());

            this.Connection.Send(packet);
        }
예제 #16
0
        public Item generateRandomElement(ItemType itemType)
        {
            try
            {
                // select count of Items with correct Type
                // the itemname structure ITEMTYPE_NUMBER example: BOOTS_001 , BELT_004
                String querypart  = String.Format("from items where itemname like '{0}_%'", itemType.ToString());
                String countQuery = String.Format("SELECT count(*) {0}", querypart);
                var    cmd        = new SQLiteCommand(countQuery, Storage.GameDataDBManager.Connection);
                var    reader     = cmd.ExecuteReader();
                reader.Read();
                int itemsCount = reader.GetInt32(0);

                // Now select random element
                int    selectedElementNr = RandomHelper.Next(itemsCount);
                String selectRandom      = String.Format("SELECT itemname {0} limit {1},1", querypart, selectedElementNr);
                cmd    = new SQLiteCommand(selectRandom, Storage.GameDataDBManager.Connection);
                reader = cmd.ExecuteReader();

                if (!reader.HasRows)
                {
                    throw new Exception("Missing Data in DB");
                }

                while (reader.Read())
                {
                    var itemName = (String)reader.GetString(0);
                    var id       = (int)StringHashHelper.HashItemName(itemName);
                    var item     = new Item(id, itemType);
                    return(item);
                }
            }
            catch (Exception e)
            {
                Logger.ErrorException(e, "Error generating Item");
            }

            return(null);
        }
예제 #17
0
파일: Toon.cs 프로젝트: DZilli/mooege
 /// <summary>
 /// Transforms from normal value to the notification send value whenever a notification is sent
 /// </summary>
 public int HeroClassFieldTransform(int value)
 {
     return(StringHashHelper.HashNormal(Enum.GetName(typeof(ToonClass), value).ToLower()));
 }
예제 #18
0
 public static bool IsValidItem(string name)
 {
     return(Items.ContainsKey(StringHashHelper.HashItemName(name)));
 }
예제 #19
0
        private static ItemTable GetRandom(List <ItemTable> pool, Player player)
        {
            var       found          = false;
            ItemTable itemDefinition = null;

            //if (player.Toon.Class == ToonClass.Monk)
            while (!found)
            {
                itemDefinition = pool[RandomHelper.Next(0, pool.Count() - 1)];

                if (itemDefinition.SNOActor == -1)
                {
                    continue;
                }

                // if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue != 0)) return itemDefinition; // testing books /xsochor
                // if (itemDefinition.ItemType1 != StringHashHelper.HashItemName("Book")) continue; // testing books /xsochor
                // if (!ItemGroup.SubTypesToHashList("SpellRune").Contains(itemDefinition.ItemType1)) continue; // testing spellrunes /xsochor

                if (itemDefinition.Name.ToLower().Contains("gold"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("healthglobe"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("_104"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("pvp"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("unique"))
                {
                    if (player != null)
                    {
                        if (player.Attributes[GameAttribute.Skill, 30476] == 1)
                        {
                            int Percent = RandomHelper.Next(0, 1000);
                            if (Percent < 880)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            int Percent = RandomHelper.Next(0, 1000);
                            if (Percent < 980)
                            {
                                continue;
                            }
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                if (itemDefinition.Name.ToLower().Contains("dye"))
                {
                    if (player != null)
                    {
                        if (player.Attributes[GameAttribute.Skill, 30476] == 1)
                        {
                            int Percent = RandomHelper.Next(0, 1000);
                            if (Percent < 880)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            int Percent = RandomHelper.Next(0, 1000);
                            if (Percent < 980)
                            {
                                continue;
                            }
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                if (itemDefinition.Name.ToLower().Contains("crafted"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("test"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("debug"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("missing"))
                {
                    continue;                                                    //I believe I've seen a missing item before, may have been affix though. //Wetwlly
                }
                if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue == 0))
                {
                    continue;                                                                                                             // i hope it catches all lore with npc spawned /xsochor
                }
                //if (itemDefinition.Name.Contains("Debug"))  continue;
                //if (itemDefinition.Quality == ItemTable.ItemQuality.Invalid) continue;
                if (itemDefinition.Name.Contains("StaffOfCow"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("NephalemCube"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("BladeoftheAncients"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("book"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("staffofcow"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("angelwings"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("journal"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("lore"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("craftingplan"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("set"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("TalismanUnlock"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("StoneOfRecall"))
                {
                    continue;
                }

                if (!GBIDHandlers.ContainsKey(itemDefinition.Hash) &&
                    !AllowedItemTypes.Contains(itemDefinition.ItemType1))
                {
                    continue;
                }

                if (player != null)
                {
                    if (player.Toon.Level <= 60)
                    {
                        if (itemDefinition.RequiredLevel < player.Toon.Level - 3 || itemDefinition.RequiredLevel > player.Toon.Level + 1)
                        {
                            continue;
                        }
                    }

                    if (AllowedArmorTypes.Contains(itemDefinition.Hash) || AllowedWeaponTypes.Contains(itemDefinition.Hash))
                    {
                        ItemTypeTable Type = ItemGroup.FromHash(itemDefinition.ItemType1);
                        switch (player.Toon.Class)
                        {
                        case LogNet.Toons.ToonClass.Barbarian:
                            if (Type.Flags.HasFlag(ItemFlags.Barbarian) & RandomHelper.Next(0, 100) > 40)
                            {
                                break;
                            }
                            else
                            {
                                continue;
                            }

                        case LogNet.Toons.ToonClass.DemonHunter:
                            if (Type.Flags.HasFlag(ItemFlags.DemonHunter) & RandomHelper.Next(0, 100) > 40)
                            {
                                break;
                            }
                            else
                            {
                                continue;
                            }

                        case LogNet.Toons.ToonClass.Monk:
                            if (Type.Flags.HasFlag(ItemFlags.Monk) & RandomHelper.Next(0, 100) > 40)
                            {
                                break;
                            }
                            else
                            {
                                continue;
                            }

                        case LogNet.Toons.ToonClass.WitchDoctor:
                            if (Type.Flags.HasFlag(ItemFlags.WitchDoctor) & RandomHelper.Next(0, 100) > 40)
                            {
                                break;
                            }
                            else
                            {
                                continue;
                            }

                        case LogNet.Toons.ToonClass.Wizard:
                            if (Type.Flags.HasFlag(ItemFlags.Wizard) & RandomHelper.Next(0, 100) > 40)
                            {
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }
                    }
                }
                found = true;
            }

            return(itemDefinition);
        }
예제 #20
0
파일: Service.cs 프로젝트: rdavydov/d3sharp
 public ServiceAttribute(uint serviceID, string serviceName)
     : this(serviceID, StringHashHelper.HashIdentity(serviceName))
 {
 }
예제 #21
0
 public static bool IsSubType(ItemTypeTable type, string rootTypeName)
 {
     return(IsSubType(type, StringHashHelper.HashItemName(rootTypeName)));
 }
예제 #22
0
파일: Toon.cs 프로젝트: DZilli/mooege
 public Toon(string name, int hashCode, int classHash, ToonFlags flags, byte level, GameAccount account) // Toon with **newly generated** persistent ID
     : base(StringHashHelper.HashIdentity(name + "#" + hashCode.ToString("D3")))
 {
     this.HeroClassField.transformDelegate += HeroClassFieldTransform;
     this.SetFields(name, hashCode, Toon.GetClassFromHash(classHash), flags, level, account, 0, 0, new Dictionary <uint, Item>());
 }
예제 #23
0
        private static ItemTable GetRandomWeaponToVendor(List <ItemTable> pool, Player player)
        {
            var       found          = false;
            ItemTable itemDefinition = null;
            int       MaxLevel       = 0;

            while (!found)
            {
                itemDefinition = pool[RandomHelper.Next(0, pool.Count() - 1)];

                if (itemDefinition.SNOActor == -1)
                {
                    continue;
                }

                // if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue != 0)) return itemDefinition; // testing books /xsochor
                // if (itemDefinition.ItemType1 != StringHashHelper.HashItemName("Book")) continue; // testing books /xsochor
                // if (!ItemGroup.SubTypesToHashList("SpellRune").Contains(itemDefinition.ItemType1)) continue; // testing spellrunes /xsochor

                // ignore gold and healthglobe, they should drop only when expect, not randomly
                if (itemDefinition.Name.ToLower().Contains("gold"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("_104"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("healthglobe"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("pvp"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("unique"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("crafted"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("test"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("debug"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("unique"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("missing"))
                {
                    continue;                                                    //I believe I've seen a missing item before, may have been affix though. //Wetwlly
                }
                if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue == 0))
                {
                    continue;                                                                                                             // i hope it catches all lore with npc spawned /xsochor
                }
                //if (itemDefinition.Name.Contains("Debug"))  continue;
                //if (itemDefinition.Quality == ItemTable.ItemQuality.Invalid) continue;
                if (itemDefinition.Name.Contains("StaffOfCow"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("BladeoftheAncients"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("book"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("staffofcow"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("angelwings"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("journal"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("lore"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("craftingplan"))
                {
                    continue;
                }
                if (itemDefinition.Name.ToLower().Contains("set"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("TalismanUnlock"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("StoneOfRecall"))
                {
                    continue;
                }
                if (itemDefinition.Name.Contains("StoneOfWealth"))
                {
                    continue;
                }

                if (!GBIDHandlers.ContainsKey(itemDefinition.Hash) &&
                    !AllowedWeaponTypes.Contains(itemDefinition.ItemType1))
                {
                    continue;
                }

                if (player != null)
                {
                    if (itemDefinition.RequiredLevel > player.Toon.Level + 3 &
                        itemDefinition.RequiredLevel < player.Toon.Level - 3
                        )
                    {
                        continue;
                    }
                }
                found = true;
            }

            return(itemDefinition);
        }
예제 #24
0
        public static ItemTypeTable FromString(string name)
        {
            int hash = StringHashHelper.HashItemName(name);

            return(FromHash(hash));
        }
예제 #25
0
 public Toon(string name, int hashCode, int classId, ToonFlags flags, byte level, GameAccount account) // Toon with **newly generated** persistent ID
     : base(StringHashHelper.HashIdentity(name + "#" + hashCode.ToString("D3")))
 {
     this.SetFields(name, hashCode, GetClassByID(classId), flags, level, account, 0);
 }
예제 #26
0
파일: Toon.cs 프로젝트: rdavydov/d3sharp
 public Toon(string name, int classId, ToonFlags flags, byte level, Account account) // Toon with **newly generated** persistent ID
     : base(StringHashHelper.HashIdentity(name))
 {
     this.SetFields(name, GetClassByID(classId), flags, level, account);
 }
예제 #27
0
        public override bool Reveal(Player player)
        {
            //Logger.Debug(" (Reveal) portal {0} has location {1}", this.ActorSNO, this._position);
            if (!base.Reveal(player) || this.Destination == null)
            {
                return(false);
            }

            if (!Activated)
            {
                return(false);
            }

            player.InGameClient.SendMessage(new PortalSpecifierMessage()
            {
                ActorID     = this.DynamicID,
                Destination = this.Destination
            });

            // Show a minimap icon
            NullD.Common.MPQ.Asset asset;
            string markerName = "";

            if (NullD.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.LevelArea].TryGetValue(this.Destination.DestLevelAreaSNO, out asset))
            {
                markerName = System.IO.Path.GetFileNameWithoutExtension(asset.FileName);
            }

            player.InGameClient.SendMessage(new MapMarkerInfoMessage()
            {
                Field0 = (int)World.NewSceneID,    // TODO What is the correct id space for mapmarkers?
                Field1 = new WorldPlace()
                {
                    Position = this.Position,
                    WorldID  = this.World.DynamicID
                },
                Field2          = 0x00018FB0, /* Marker_DungeonEntrance.tex */  // TODO Dont mark all portals as dungeon entrances... some may be exits too (although d3 does not necesarrily use the correct markers). Also i have found no hacky way to determine whether a portal is entrance or exit - farmy
                m_snoStringList = 0x0000CB2E, /* LevelAreaNames.stl */          // TODO Dont use hardcoded numbers

                Field3  = StringHashHelper.HashNormal(markerName),
                Field9  = 0,
                Field10 = 0,
                Field11 = 0,
                Field5  = 0,
                Field6  = true,
                Field7  = false,
                Field8  = true,
                Field12 = 0
            });

            if (this.ActorSNO.Id != 5648 & this.ActorSNO.Id != 5660)// && this.ActorSNO.Id != 229013)
            {
                //this.World.SpawnMonster(4686, new Vector3D(Position.X, Position.Y, Position.Z - 1));
                //uint Need = World.NewActorID - 2;

                var actors = this.GetActorsInRange(2f);
                foreach (var actor in actors)
                {
                    if (actor.ActorSNO.Id == 4686)
                    {
                        if (this.ActorSNO.Id != 5648 && this.ActorSNO.Id != 229013)
                        {
                            actor.Attributes[GameAttribute.MinimapIconOverride] = this.ActorData.TagMap[ActorKeys.MinimapMarker].Id;
                        }
                        else
                        {
                            actor.Attributes[GameAttribute.MinimapIconOverride] = 102321;
                        }
                        actor.Attributes[GameAttribute.MinimapActive] = true;
                        actor.Attributes.BroadcastChangedIfRevealed();
                    }
                }
            }
            return(true);
        }