RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Ultima: Artifact Gumball Machine

KHzspeed

Sorceror
Ultima: Artifact Gumball Machine
a fun, addictive, and exciting way to reward players.

- possibly you may remember as a child. those plastic toy capsules containing trinkets, dispensed randomly by oversize gumball machines at the mall. hah! still with me? good ;) .

The Artifact Gumball Machine is just that, and twice as fun!

How it works:
  • open "ArtifactCapsuleList.cs" this is where you will add any items you wish to reward your players with. where it says " typeof( ), " fill in the blank with an item name. add one or a thousand items. the choice is yours.
  • Plug-n-play. Drop system in customs folder.
  • distribute Reward tickets to your players any way you choose. you may also change the required currency and price found in ArtifactGumballMachine.cs
  • Add the gumball machine, and have fun!
-----
.V2 fixed.
-----
let me know what you think
 

Attachments

  • Artifact Capsule Machine V2.rar
    2.1 KB · Views: 118

wlrdwawoolard

Sorceror
well i tested it out and had errors and fixed them ass well did some revisions so everyone can use this script.
hope u didnt mind i saw u had some custom stuff in the script that went directly to ur server like:
using Server.Customs;
and
PangaeaTicket
and
RewardtTicket
dont know what these are for but this isnt in runuo or orb its custom stuff but gladly to help :)
 

Attachments

  • gumball.rar
    2.2 KB · Views: 38

KHzspeed

Sorceror
PangaeaTicket
and
RewardtTicket
dont know what these are for but this isnt in runuo or orb its custom stuff but gladly to help :)
I pulled this system from my own server, so my mistake for missing that one edit. I re-uploaded a working copy for anyone else having trouble with this.

RewardTicket's were included with the Rar, so I don't understand what your having trouble with.
and of course, it's not part of Orbsydia's SVN release. I'm not sure what gave you that idea.
 

wlrdwawoolard

Sorceror
/*Monolith-KHzspeed 2011
ArtifactGumballRewards*/

using System;

namespace Server.Items
{
public class RewardtTicket : Item <----------RewardtTicket i made it RewardTicket for easy access
{
[Constructable]
public RewardtTicket() : this( 1 )
{
}

[Constructable]
public PangaeaTicket( int amount ) : base( 0xEF3 ) <----have no clue what PangeaTicket is so i put it as
{ RewardTicket
Name = "Reward Ticket";
LootType=LootType.Blessed;
Hue = 1260 ;
Stackable = true;
Amount = amount;
}

public RewardtTicket( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
------------------------------------------------------------------------------------------------------------------------
/*Monolith-KHzspeed 2011
ArtifactGumballRewards*/

using System;
using System.Reflection;
using System.IO;
using Server;
using Server.Items;
using Server.Customs; <----------------------- Had errors with this so i took it out

namespace Server
{
public class ArtifactList
{
static int index;
static Type type;

public static Type[] ArtifactTypes = new Type[]
{
typeof( ),
typeof( ),
typeof( ),
typeof( ),
typeof( ),
typeof( ),
};
public static Type[] Artifacts{ get{ return ArtifactTypes; } }

public static Item RandomArtifact()
{
index = Utility.Random( ArtifactTypes.Length );
type = ArtifactTypes[index];
return Activator.CreateInstance( type )as Item;
}
}
}

//typeof( ),
//typeof( ),
//typeof( ),
//typeof( ),
//typeof( ),
//typeof( ),
-----------------------------------------------------------------------------------------------------------------------
its all good thats why i edited it and made it easy access and fixed :)
 

Zagros

Sorceror
Thats good stuff, I remember those when I was a kid In fact I made something simmilar to this with afew XML spawners that took 25 gold and supplied a colorchanging gumball in return. I like your script.
 

peepeetree

Sorceror
I tested this out on 2.2, it works great except the item ID being used says it is for an unused tile. I used a globe until I can find something else, 0x1047, but I am curious as to what was intended to be used?
 

KHzspeed

Sorceror
I tested this out on 2.2, it works great except the item ID being used says it is for an unused tile. I used a globe until I can find something else, 0x1047, but I am curious as to what was intended to be used?

you have it right. the original Item was indeed a standing globe.
something changed in the Item ID's during one of OSI's updates.
I haven't tinkered with RUO since 2011, so some of these systems may be a bit dated.
 

peepeetree

Sorceror
you have it right. the original Item was indeed a standing globe.
something changed in the Item ID's during one of OSI's updates.
I haven't tinkered with RUO since 2011, so some of these systems may be a bit dated.

Awesome, I figured the machines in real life looked sort of like a globe, glad I guessed it right, great script, thanks a lot!
 
Top