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:
    131
    Likes Received:
    2
    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
    Offline

    arvoreen Member

    Joined:
    Aug 20, 2014
    Messages:
    74
    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:
    131
    Likes Received:
    2
    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 Trying to add the following 2 scripts to RunUO Server 2.6 . . . Sunday at 2:11 PM
ServUO Discussion New publish on UO adds some CC/EC bug fixes. Jun 13, 2018
Script Support Add type door May 20, 2018
3rd Party Discussions Question about adding graphics/items with UOFiddler May 19, 2018
Script Support Adding attacks to pets via deed. May 16, 2018
ServUO Discussion Publish 100 - Some of these changes will need to be added to ServUO May 16, 2018
Archived Bug Reports Newest potions can not be added to kegs May 9, 2018