1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lookpack.cs how to add random item

Discussion in 'Script Support' started by Opywang, Nov 14, 2017.

  1. Opywang
    Offline

    Opywang Member

    Joined:
    Jan 16, 2017
    Messages:
    52
    Likes Received:
    1
    Hey there I found an easier way to make token drop I think we can just make it drop by SuperBoss loot pack, and I've added the item in there, and had errors it doesn't work so I wonder how can we add random item that is base on loot pack?

    Here is what I did I replace instruments, and then name the item it doesn't work.

    new LootPackEntry(false, RewardTicket, 100.00, 1)


    Here this is entire thing so you can get an idea.

    public static readonly LootPack AosSuperBoss =
    new LootPack(
    new[]
    {
    new LootPackEntry(true, Gold, 100.00, "5d100+500"),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
    new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
    new LootPackEntry(false, Instruments, 2.00, 1)
    new LootPackEntry(false, RewardTicket, 100.00, 1)
    });


    Here is Error that I've gotten

    Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
    Errors:
    + Misc/LootPack.cs:
    CS1514: Line 138: { expected
    CS1525: Line 140: Invalid expression term 'public'
    CS1513: Line 140: } expected
    CS1513: Line 424: } expected
    CS1026: Line 424: ) expected
    CS1002: Line 424: ; expected
    CS1520: Line 425: Method must have a return type
    CS1031: Line 425: Type expected
    CS1519: Line 425: Invalid token ',' in class, struct, or interface member declaration
    CS0116: Line 426: A namespace cannot directly contain members such as fields or methods
    CS1518: Line 430: Expected class, delegate, enum, interface, or struct
    CS1518: Line 431: Expected class, delegate, enum, interface, or struct
    CS1518: Line 431: Expected class, delegate, enum, interface, or struct
    CS1001: Line 431: Identifier expected
    CS1518: Line 431: Expected class, delegate, enum, interface, or struct
    CS1518: Line 431: Expected class, delegate, enum, interface, or struct
    CS1518: Line 431: Expected class, delegate, enum, interface, or struct
    CS0116: Line 431: A namespace cannot directly contain members such as fields or methods
    CS1518: Line 433: Expected class, delegate, enum, interface, or struct
    CS1518: Line 434: Expected class, delegate, enum, interface, or struct
    CS1518: Line 435: Expected class, delegate, enum, interface, or struct
    CS1001: Line 435: Identifier expected
    CS1518: Line 436: Expected class, delegate, enum, interface, or struct
    CS1518: Line 437: Expected class, delegate, enum, interface, or struct
    CS1518: Line 437: Expected class, delegate, enum, interface, or struct
    CS1518: Line 438: Expected class, delegate, enum, interface, or struct
    CS1518: Line 439: Expected class, delegate, enum, interface, or struct
    CS1022: Line 440: Type or namespace definition, or end-of-file expected
    Scripts: One or more scripts failed to compile or no script files were found.
    - Press return to exit, or R to try again.
     
  2. arvoreen
    Online

    arvoreen Member

    Joined:
    Aug 20, 2014
    Messages:
    61
    Likes Received:
    1
    You're missing or have mismatched curly braces. What do you use to edit your code? You should be using some sort of syntax highlighting editor, and it should show your mismatched quotes. Keep your code indented (indent 1 tab every time you open a code block with {, and go back a tab when you close with }) and you should have an easier time.
     
  3. Opywang
    Offline

    Opywang Member

    Joined:
    Jan 16, 2017
    Messages:
    52
    Likes Received:
    1
    LOL i forgot to add common, and it work.

    Thank you what happen was i copy, and paste, and it needed a common to help make it return for the next one, and I forgot to put a common for return.

    Plus I had to add this for it to accept random item.

    public static readonly LootPackItem[] RewardTicket = new[] {new LootPackItem(typeof(RewardTicket), 1)};
     
Similar Threads: Lookpackcs add
Forum Title Date
Script Support How add new Resource Nov 13, 2017
Script Support Adding Addon Items and Mobs to XMLSpawner Oct 30, 2017
Custom Releases 3 Display Cases as Addons Oct 29, 2017
Script Support How to add a new prefix to the name similar to the Lady and Lord titles? Oct 19, 2017
Script Support Addstairs addon Oct 18, 2017
ServUO Discussion UO adds a new 20 Year Ethereal Mount today with newest patch (10/17/2017) Oct 17, 2017
Script Support Help with creating and adding other crafting PS's Oct 16, 2017