Inheritance: D3Sharp.Core.Ingame.Actors.Actor
Esempio n. 1
0
        public void Reveal(Hero toon)
        {
            if (toon.RevealedActors.Contains(this)) return; //already revealed
            toon.RevealedActors.Add(this);

            var msg = new ACDEnterKnownMessage
                          {
                              Field0 = Id,
                              Field1 = SnoId,
                              Field2 = Field2,
                              Field3 = Field3,
                              Field4 = new WorldLocationMessageData
                                           {
                                               Field0 = Scale,
                                               Field1 = new PRTransform { Field0 = new Quaternion { Amount = RotationAmount, Axis = RotationAxis, }, ReferencePoint = Position, },
                                               Field2 = WorldId,
                                           },
                              Field5 = InventoryLocationData,
                              Field6 = GBHandle,
                              Field7 = Field7,
                              Field8 = Field8,
                              Field9 = Field9,
                              Field10 = Field10,
                          };

            toon.InGameClient.SendMessage(msg);
            toon.InGameClient.FlushOutgoingBuffer();
        }
Esempio n. 2
0
        public void Destroy(Hero hero)
        {
            if (!hero.RevealedActors.Contains(this)) return; //not revealed yet

            hero.InGameClient.SendMessage(new ANNDataMessage() { Id=0x3c, Field0=Id, });
            hero.InGameClient.FlushOutgoingBuffer();
            hero.RevealedActors.Remove(this);
        }
Esempio n. 3
0
 public void Destroy(Hero hero)
 {
     if (!hero.RevealedScenes.Contains(this)) return; //not revealed yet
     if (SceneData != null)
     {
         hero.InGameClient.SendMessage(new DestroySceneMessage() { Id = 0x35, Field0 = SceneData.WorldID, Field1 = ID });
         hero.InGameClient.FlushOutgoingBuffer();
         hero.RevealedScenes.Remove(this);
     }
 }
Esempio n. 4
0
        public void Reveal(Hero hero)
        {
            if (hero.RevealedScenes.Contains(this)) return; //already revealed

            if (SceneData != null)
            {
                hero.InGameClient.SendMessage(SceneData);
                hero.RevealedScenes.Add(this);
            }
            if (Map != null) hero.InGameClient.SendMessage(Map);
            hero.InGameClient.FlushOutgoingBuffer();
        }
Esempio n. 5
0
 public Player(GameClient client, Universe universe, Toon bnetToon)
 {
     this.Client = client;
     this.Universe = universe;
     this.Hero = new Hero(client, universe, bnetToon);
 }
Esempio n. 6
0
        public void Reveal(Hero hero)
        {
            //reveal world to player
            hero.InGameClient.SendMessage(new RevealWorldMessage()
            {
                Id = 0x0037,
                Field0 = WorldID,
                Field1 = WorldSNO,
            });

            //player enters world
            hero.InGameClient.SendMessage(new EnterWorldMessage()
            {
                Id = 0x0033,
                Field0 = hero.Position,
                Field1 = WorldID,
                Field2 = WorldSNO,
            });

            //just reveal the whole thing to the player for now
            foreach (var scene in Scenes)
                scene.Reveal(hero);

            //reveal actors
            foreach (var actor in Actors)
            {
                if (ActorDB.isBlackListed(actor.SnoId)) continue;
                if (ActorDB.isNPC(actor.SnoId)) continue;
                actor.Reveal(hero);
            }
        }
Esempio n. 7
0
 public void Reveal(Hero hero)
 {
     if (SceneData != null) hero.InGameClient.SendMessage(SceneData);
     if (Map != null) hero.InGameClient.SendMessage(Map);
     hero.InGameClient.FlushOutgoingBuffer();
 }
Esempio n. 8
0
        //uncomment this constructor to show all portals in the world, even those that will crash the client on entry
        //useful for determining which actor the portal is.
        //public Portal()
        //{
        //    TargetPos = new Vector3D();
        //}

        public void Reveal(Hero hero)
        {
            if (PortalMessage != null && ActorRef != null && TargetPos!=null)
                //targetpos!=null in this case is used to detect if the portal has been completely initialized to have a target
                //if it doesn't have one, it won't be displayed - otherwise the client would crash from this.
            {
                //Logger.Info("Revealing portal: " + PortalMessage.AsText());

                ActorRef.Reveal(hero);

                hero.InGameClient.SendMessage(new AffixMessage()
                {
                    Id = 0x48,
                    Field0 = ActorRef.Id,
                    Field1 = 1,
                    aAffixGBIDs = new int[0]
                });

                hero.InGameClient.SendMessage(new AffixMessage()
                {
                    Id = 0x48,
                    Field0 = ActorRef.Id,
                    Field1 = 2,
                    aAffixGBIDs = new int[0]
                });

                hero.InGameClient.SendMessage(PortalMessage);

                hero.InGameClient.SendMessage(new ACDCollFlagsMessage()
                {
                    Id = 0x00A6,
                    Field0 = ActorRef.Id,
                    Field1 = 0x00000001,
                });

                hero.InGameClient.SendMessage(new AttributesSetValuesMessage()
                {
                    Id = 0x004D,
                    Field0 = ActorRef.Id,
                    atKeyVals = new NetAttributeKeyValue[7]
                    {
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x02BC], // MinimapActive 
                            Int = 0x00000001,
                            Float = 0f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x0056], // Hitpoints_Max_Total 
                            Int = 0x00000000,
                            Float = 1f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x0054], // Hitpoints_Max 
                            Int = 0x00000000,
                            Float = 0.0009994507f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x0051], // Hitpoints_Total_From_Level 
                            Int = 0x00000000,
                            Float = 3.051758E-05f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x004D], // Hitpoints_Cur 
                            Int = 0x00000000,
                            Float = 0.0009994507f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x0043], // TeamID 
                            Int = 0x00000001,
                            Float = 0f,
                         },
                         new NetAttributeKeyValue()
                         {
                            Attribute = GameAttribute.Attributes[0x0026], // Level 
                            Int = 0x00000001,
                            Float = 0f,
                         },
                    },
                });

                hero.InGameClient.SendMessage(new ACDGroupMessage()
                {
                    Id = 0x00B8,
                    Field0 = ActorRef.Id,
                    Field1 = -1,
                    Field2 = -1,
                });

                hero.InGameClient.SendMessage(new ANNDataMessage()
                {
                    Id = 0x003E,
                    Field0 = ActorRef.Id,
                });

                hero.InGameClient.SendMessage(new ACDTranslateFacingMessage()
                {
                    Id = 0x0070,
                    Field0 = ActorRef.Id,
                    Field1 = 0f,
                    Field2 = false,
                });

            }
            hero.InGameClient.FlushOutgoingBuffer();
        }
Esempio n. 9
0
        public void DestroyWorld(Hero hero)
        {
            //for (int x = hero.RevealedActors.Count - 1; x >= 0; x-- )
            //    if (hero.RevealedActors[x].RevealMessage.Field4.Field2 == WorldID) hero.RevealedActors[x].Destroy(hero);

            //for (int x = hero.RevealedScenes.Count - 1; x >= 0; x--)
            //    if (hero.RevealedScenes[x].SceneData.WorldID == WorldID) hero.RevealedScenes[x].Destroy(hero);

            //hero.Owner.LoggedInBNetClient.InGameClient.SendMessage(new WorldDeletedMessage() { Id = 0xd9, Field0 = WorldID, });
            hero.InGameClient.FlushOutgoingBuffer();
        }
Esempio n. 10
0
        public void Reveal(Hero hero)
        {
            bool found=hero.RevealedWorlds.Contains(this);

            if (!found)
            {
                //reveal world to player
                hero.InGameClient.SendMessage(new RevealWorldMessage()
                {
                    Id = 0x0037,
                    Field0 = WorldID,
                    Field1 = WorldSNO,
                });
                hero.RevealedWorlds.Add(this);
            }

            //player enters world
            hero.InGameClient.SendMessage(new EnterWorldMessage()
            {
                Id = 0x0033,
                Field0 = hero.Position,
                Field1 = WorldID,
                Field2 = WorldSNO,
            });

            //just reveal the whole thing to the player for now
            foreach (var scene in Scenes)
                scene.Reveal(hero);

            if (!found)
            {
                //reveal actors
                foreach (var actor in Actors)
                {
                    if (SNODatabase.Instance.IsOfGroup(actor.SnoId, SNOGroup.Blacklist)) continue;
                    if (SNODatabase.Instance.IsOfGroup(actor.SnoId, SNOGroup.NPCs)) continue;
                    //actor.Reveal(hero);
                }

                //reveal portals
                Logger.Info("Revealing portals for world " + WorldID);
                foreach (Portal portal in Portals)
                {
                    portal.Reveal(hero);
                }
            }

        }