Results 1 to 5 of 5
  1. #1
    KiD_CuDi_'s Avatar
    Join Date
    Aug 2015
    Gender
    male
    Location
    The Universe
    Posts
    234
    Reputation
    10
    Thanks
    259
    My Mood
    Amused

    Thumbs up Weird Item Glitch [As3 Fabs]

    I tried to create a consumable that when used, would turn into a random item. Everything is fine except that when using the consumable, the random item would replace my weapon instead of going into my inventory.

     
    Code:
    case ActivateEffects.LegendaryRoll:
                            {
                                int RollChance = Random.Next(0, 32);
                                switch (RollChance)
                                {
                                    case 0:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xa139];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Helm of the Royal Juggernaut'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 1:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xa149];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Blade of Planets'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 2:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x23cb];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Milkway Glove'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 3:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x2469];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Magma Blast Spell'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 4:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x1a61];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Infinity Crossbow'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 5:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x2467];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:Magma Blast Spell!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 6:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x2467];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Seal of Reoccuring Nightmares'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 7:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x9961];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Executioner's calling'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 8:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xa86];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Godly Chest'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 9:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x23cd];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Molten Kings Armor'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 10:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xa981];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Cloak of Symmachus'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 11:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xa991];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Leather Armor of Symmachus!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 12:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x6017];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Captain America Sword'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 13:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xaa1];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item: Staff of Diabolic Secrets!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 14:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0x6019];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Captain America Ring'!");
                                                return false;
                                            }
                                        };
                                        break;
                                    case 15:
                                        for (int i = 0; i < Inventory.Length; i++)
                                        {
                                            if (Inventory[i] == null) continue;
                                            {
                                                Inventory[i] = Manager.GameData.Items[0xaa8];
                                                UpdateCount++;
                                                SaveToCharacter();
                                                SendInfo("You have obtained the item:'Godly Chest'!");
                                                return false;
                                            }
                                        };
                                        break;
                                }
    
                            }
                            break;
                            break;
    cool

  2. #2
    sebastianfra12's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    361
    Reputation
    21
    Thanks
    75
    My Mood
    Inspired
    Do not try programming if you don't know what is it

  3. #3
    Stone2405's Avatar
    Join Date
    Jun 2018
    Gender
    male
    Posts
    117
    Reputation
    10
    Thanks
    9
    My Mood
    Amused
    Inventory[i] = Manager.GameData.Items[0xa139];

    Try writing 4 rather than i

  4. The Following User Says Thank You to Stone2405 For This Useful Post:

    Solvi (01-29-2019)

  5. #4
    Demon's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    Lost
    Posts
    1,095
    Reputation
    86
    Thanks
    316
    My Mood
    Angelic
    Quote Originally Posted by Stone2405 View Post
    Inventory[i] = Manager.GameData.Items[0xa139];

    Try writing 4 rather than i
    Its often best to not reply if you don't know what your talking about.

    The problem is because you started the loop at index 0, when in reality... you should start at (index > 3), as the equipment occupies [0, 1 , 2, 3]

    Code:
    for( var i = 4; i < inv.Length; i++)
    {
    }
    P.S. That code is larger than your future. JK <3... no hate... spread love.
    Last edited by Demon; 01-29-2019 at 07:33 AM.
    Nice

  6. #5
    Stone2405's Avatar
    Join Date
    Jun 2018
    Gender
    male
    Posts
    117
    Reputation
    10
    Thanks
    9
    My Mood
    Amused
    Quote Originally Posted by Demon View Post
    Its often best to not reply if you don't know what your talking about.
    Well, i am talking about that post.

Similar Threads

  1. [Discussion] Weird Loading Glitch
    By SPittn_Blood in forum Combat Arms Glitches
    Replies: 23
    Last Post: 04-24-2010, 11:25 PM
  2. Weird Hotkey Glitch?
    By mnpeepno2 in forum Visual Basic Programming
    Replies: 9
    Last Post: 02-06-2010, 04:44 PM
  3. Weird Microphone glitch...
    By Lolland in forum General
    Replies: 0
    Last Post: 02-04-2010, 01:16 AM
  4. Weird CA glitch?
    By leothelion in forum Combat Arms Glitches
    Replies: 14
    Last Post: 09-05-2009, 04:17 AM
  5. Weird Quartine Glitch..
    By davie13 in forum Combat Arms Glitches
    Replies: 3
    Last Post: 08-11-2009, 02:58 PM