コード例 #1
0
ファイル: DebugCommands.cs プロジェクト: wlasser/mooege-2
        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());
        }
コード例 #2
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);
 }
コード例 #3
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);
        }
コード例 #4
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()));
 }
コード例 #5
0
ファイル: DungeonStonePortal.cs プロジェクト: realTobby/NullD
        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);
        }