Hard Times In Life

06/20/2011 05:45 zTek#1
Sup sup sup.....So I've been at this for about 4 hours now, and it is really pissing me off. I've coded it 3 different ways, they only work "slightly".

Kinshi has helped me, Fang has helped me, John has helped me...still can't get it to work..

So the problem of this code, it only turns into mesh 1001..I haven't a clue why..


Code here:
Code:
case 723724:
                        {
                            if (Body == 1003)
                            {
                                Random iRan = new Random();
                                ushort[] IBody = new ushort[2];
                                IBody[0] = (ushort)iRan.Next(1001, 1002);
                                IBody[1] = (ushort)iRan.Next(103, 105);

                                Random iRan2 = new Random();
                                int Nr = iRan2.Next(1, 2);
                                if (Nr == 1)
                                {
                                    Body = IBody[0];
                                }
                                if (Nr == 2)
                                {
                                    Body = IBody[1];
                                }

                                Equips.UnEquip(3, this);
                                Equips.UnEquip(4, this);
                                Equips.UnEquip(5, this);

                                for (iIi = 1; iIi <= count; iIi++)
                                {

                                    Thread.Sleep(1000);

                                    if (iIi == 10)
                                    {
                                        goto PrevBod;
                                    }
                                }
                            }
                        PrevBod:
                            Body = 1003;

                            Equips.Armor.ID = 3;
                            Equips.Armor.ID = 4;
                            Equips.Armor.ID = 5;
                        }
                        break;
Sank yoo
06/20/2011 06:07 { Angelius }#2
the current patch works this way thought .

Mesh = Rand.Next(103, 200); // not the correct numbers .
Mesh += (Avat + Body);

lets say the mesh was 200 hair 225 body 1003

its gonna look like 2002251003

idk about the older patches ,
06/20/2011 06:27 zTek#3
public virtual int Next(int minValue, int maxValue);
06/20/2011 07:29 Spirited42#4
Code:
public static uint[] Transformations = new byte[2] { 2001, 2002, 1003, 1004 };
Code:
                        case 723724:
                        {
                            if (Body == 1003)
                            {
                                Body = /* NEVER DO THIS- MAKE A TRANSFORMATION COVER*/ Transformations[new Random().Next(0, 1)];

                                for (iIi = 1; iIi <= count; iIi++)
                                {

                                    Thread.Sleep(1000);

                                    if (iIi == 10)
                                    {
                                        goto PrevBod;
                                    }
                                }
                            }
                        PrevBod:
                            Body = 1003;

                            Equips.Armor.ID = 3;
                            Equips.Armor.ID = 4;
                            Equips.Armor.ID = 5;
                        }
                        break;
Example of a transformation cover:
Normal Mesh: 1003
Normal Avatar: 34
Mesh & Avatar: 341003
Mesh, Avatar, & transformation cover: 1002341003 (not sure- something like that tho- test with it).
06/20/2011 08:10 Y u k i#5
Quote:
....
Random iRan2 = new Random();
int Nr = iRan2.Next(1, 2);
if (Nr == 1)
{
Body = IBody[0];
}
if (Nr == 2)
{
Body = IBody[1];
}
....
This will result in the same "random" number everytime. you need to put that outside the actual code and only call it once.
06/20/2011 08:15 zTek#6
Currently I am using this code:
Code:
[I]case 723724:
                        {
                            if (Body == 1003)
                            {
                                Random iRan = new Random();
                                Random iRan2 = new Random();

                                ushort[] IBody = new ushort[3];

                                int iValue1 = Body = (ushort)iRan2.Next(103, 105);
                                int iValue2 = Body = (ushort)iRan2.Next(266, 269);
                                int iValue3 = Body = (ushort)iRan2.Next(326, 329);

                                int NR = iRan.Next(1, 3);
                                if (NR == 1)
                                {
                                    IBody[0] = (ushort)iValue1;
                                }
                                if (NR == 2)
                                {
                                    IBody[1] = (ushort)iValue2;
                                }
                                if (NR == 3)
                                {
                                    IBody[2] = (ushort)iValue3;
                                }

                                Equips.UnEquip(3, this);
                                Equips.UnEquip(4, this);
                                Equips.UnEquip(5, this);

                                for (iIi = 1; iIi <= count; iIi++)
                                {
                                    Thread.Sleep(1000);
                                }
                                if (iIi == 10)
                                {
                                    goto PrevBod;
                                }
                            }
                        PrevBod:
                            Body = 1003;

                            Equips.Armor.ID = 3;
                            Equips.Armor.ID = 4;
                            Equips.Armor.ID = 5;
                        }
                        break;[/I]
It only transforms on 3 different mesh's, when obviously there is more than that set to it.

@Fang
I will try that thank you.

@Yuki
Thanks, I will try it.
06/21/2011 01:49 .Kinshi#7
I tried to help but I went afk when you showed me your second attempt, so sorry about that.

The mesh for a player is split up into 3 different values:
Code:
(TransformationType * 10000000) + (Avatar * 10000) + Body
If you change the TransformationType you can turn into various mobs and stuffz.

Here's a few I found when i was bored:
Code:
public enum TransformationIDs : byte
    {
        Pheasent = 104,
        Vampire1 = 111,
        Vampire2 = 112,
        Vampire3 = 113,
        Vampire4 = 114,
        Vampire5 = 115,
        Vampire6 = 116,
        Bull = 117,
        Weregirl = 130,
        Robin = 132,
        Geisha = 152,
        Bat = 157,
        CrazyBeast = 179,
        BladeMonster = 200,
        Bandit = 201,
        Rat = 202,
        Snake = 203,
        SnakeMan = 204,
        DivineHare = 207,
        AxeMaster = 208,
        FireRat = 209,
        Demon = 210,
        SkullWarrior = 211,
        UndeadSamurai = 212,
        WaterElf = 213,
        Golem = 214,
        Piggy = 215,
        PiggyPink = 216,
        NightDevil = 217,
        Leapord = 218,
        RatPurple = 219,
        SnakeBlue = 220,
        RatNeon = 221,
        Rabbit = 222,
        GM = 223,
        RabbitGirl = 224,
        DivineHareGold = 229,
        WereGirlBlue = 230,
        Pheasent2 = 231,
        Robin2 = 232,
        GhostWarrior = 233,
        Geisha2 = 252,
    }