Question about transforming...

06/15/2011 14:17 JobvdH#1
Hello guys,

I have been working on my older source for a while now, and ive already fixed allot and ive added some things (Note: Its LOTF 5017..)
Now my question is, how to i make transform work properly...

I have this as code..
Code:
                        if (SkillId == 1270)
                        {
                            XpList = false;
                            Transform = true;
                            TransformActivated = DateTime.Now;
                            Model = 214;
                            MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                            MyClient.SendPacket(General.MyPackets.Vital(UID, 12, ulong.Parse(Avatar.ToString() + Model.ToString())));
                        }
and this:
Code:
public DateTime TransformActivated = DateTime.Now;
public bool Transform = false;
And again, to remove the transform this (In skilltimers):
Code:
            if (Transform)
            {
                if (DateTime.Now > TransformActivated.AddSeconds(60))
                {
                    Transform = false;
                    Model = RealModel;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 12, ulong.Parse(Avatar.ToString() + Model.ToString())));
                }
            }
#EDIT: The disguise part works fine, i transform in this case into a robot and i will get transformed back after 60 seconds.. (But it doesnt show up a counter and a Restore button. and i can jump while transformed..)

But now my question is: How can i add a countdown to the skill and make it so I cant jump while transformed?

Thanks in advance,
JobvdH!
06/15/2011 15:57 pro4never#2
Meshes are really quite simple.
The way it works is you have 3 ushorts which are combined which represent...


Transformation Face Model

To make this all work correctly what you want to do is have those 3 values which all combine properly. By assigning the transformation properly you'll still have your avatar when you mouse over your character and a number of other bugs will disappear (because you'll be doing it correctly)


Here's how I do it in my source


Code:
public uint Mesh
        {
            get { return _mesh; }
            set
            {
                _mesh = value; SetUpdate(UpdateType.Mesh, value, SynchroType.Broadcast);
            }
        }
        public ushort Body
        {
            get { return _body; }
            set
            {
                 _body = value; Mesh = (uint)(Transformation * 10000000 + Face * 10000 + value);
            }
        }
        public ushort Face
        {
            get { return _face; }
            set {  _face = value; Mesh = (uint)(Transformation * 10000000 + value * 10000 + Body); }
        }
        public ushort Transformation
        {
            get { return _transformation; }
            set { _transformation = value; Mesh = (uint)(value * 10000000 + Face * 10000 + Body); }
        }
In this case SetUpdate is a method we're using (stolen from tq's sources essentially) which determines who to send the update packets to. Basically whenever MESH changes we send a update packet to screen... because we're using accessors for each PART of mesh though, we are actually updating it any time we modify Face, Mesh or Transformation.
06/16/2011 10:06 JobvdH#3
Thanks for your reply, I will look to your code and se how I can put it on a correct way in my source.

I need some help xd
I have no idea how i should get this work to get a transformation working correct