|
||
|
|||||||
| Custom Script Releases This forum is where you can release your custom scripts for other users to use. Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
This is my updated slots to work with RunUO 2.0. Please note the following defines in the source of turboslot.cs:
// Undefine for a "live" shard. See profiling notes below. #define PROFILE // Undefine if you are not using RunUo 2.0 (Use this for both RC1 and RC2) #define RUNUO2RC1 /* Using Arte Gordon's XMLSPAWNER? If so leave "#define XMLSPAWNER" below as is. * If you do not have XMLSPAWNER installed comment out the line. All this does is * give you a larger property gump to view the slot's properties. */ #define XMLSPAWNER // // This section allows you turn of themes and/or options that may not work on your shard //#define MINIHOUSES (Minihouse theme is not done, I didn't want to delay the update tho) #define MINIHOUSES_CEORANDOM (will explain later, doesn't matter) /* Package Name: CEOTurboSlots Author: CEO Version: 1.0b Public Release: 12/22/05 Purpose: Real Casino style slots. 14 different themes and progressive jackpots. Description: This package allows you to add casino style slots to your shard. You can choose * from 14 different themes that all give different symbols, pay outs, and unique options. You can * also link slots together for progressive jackpots. Some slots can be configured to give item * rewards. Special "Casino Club" cards are given out to big jackpot winners allowing you to configure * some slots just for those players. A top ten board is included that will show recent jackpot * winners as well as give overall shardwide stats for GMs and above. * * Themes: * Classic, ClassicII, ClassicIII: Modeled after real Las Vegas slots! * FarmerFaceoff: "Nickle" slots with a farm theme. * GruesomeGambling: Creepy. Bleeds player now and then and throws out bones. Top prize * Hooded Shroud of Shadows. More deadly in Fel. * Holiday1: Christmas themed slot. * LadyLuck: Gives out luck items, sashe, cloak, or robe. * MinerMadness: The original minermadness with exploit removed, streamlined bonus round gump, * and is NOT a gold farm slot! * OffToTheRaces: Inexpensive slot with a racing theme. * Pirates: Arr mateys. 10gp slot with a priate ship model as top prize. * PowerScrolls: Very colorful slot, that changes symbols (and top prize) every 4 hours. * StatScrolls: The harrower! Watchout this one bites, more deadly in Fel. * TailorTreats: Barbed kits as top prize. * TrophyHunter: Uses the animal trophy mounts as symbols. * * Slots that give rewards have values assigned to the rewards. I spent many hours profiling and simulating * these slots, the text file, allodds.txt, shows the statistical odds and simulated odds over many spins. * Over alot of spins, they *will* remove gold from the economy. Some may seem to payout more * often, but overall players will have fun while losing their shirts. ![]() * In general the different odds are as such: * * Loose: 96%-98% * Normal: 93%-96% * Tight: 89%-92% * Extremely Tight: 85%-88% * Casino Cheats: 79%-84% (Not really cheating. The preferred setting for progressive groups.) * Random: The machine will randomly bounce around from Loose-CasioCheats every 15 minutes. * This setting can make a slot appear "hot", but then go "cold" after awhile. * * The odds tables are pretty accurate for each machine. They use odds distribution tables like real * casinos with each reel having it's own symbol distribution/odds table. * * Note: A player's luck can also affect odds, though it'll be random and reevaluted every 10-15 minutes * simular to the Random setting. The player will never know whether their luck helped or not. If the "roll" favors * the player, the machine's odds will be bumped up by one favorable level, maxing out of course at Loose. * * The Percentage is basically the payback. For instance, a slot with a 95% payback odds means that * for every 100gp played 95gp will be returned to the player. * So over time and alot of spins/plays the casino's take will be 5%. * * Progressive Jackpots: * * With progressive jackpots you can link groups of machines together. As people play these slots * a percentage of the gold played is added to what's called a progressive jackpot. This jackpot * continues to grow until someone hits the "big one" on a linked machine. Progressive jackpots can * get to be over several million gp and cause a playing "frenzy" as they grow. Because the odds of * a machine can be dramtically affected, you should only link machines together that cost the same amount * to play. IE. do not link a 5gp machine to a 100gp progresssive pool as the 5gp machine WILL become * a gold farm. It's also recommended that progressive machine's odds are setup to be either Extremely * Tight or Casino Cheats as over time the statistical payout will increase, and may even go over 100%. * With Normal and Loose odds the machines have the potentional to be gold farms. Even in Extremely/CasinoCheats * modes odds may go over 100%, odds like that are normal though, and only the machine that "hits" will * be temporarily in the red and appear to be a gold farm. * * To setup a progressive pool, first set one slot machine's properties to ProgIsMaster = true. Then * point other machine's property of ProgSlotMaster toward the "Master" slot machine. The more * you link together the faster the jackpot will rise (as people play those machines). * * Other Options: * * Active(false): Determins whether a slot is available for play. A new slot will default to the * Classic theme and Active=false allowing you to configure it before putting it * online. * * AnnounceJackpots(True): Does a shardwide annoucement when someone hits a big jackpot. * CardClubOnly(False): Only players holding a Casino Membership card may play this slot. * CreditATMIncrements(10000):Amount to add to credit from bank gold in ATM transfer. * CreditATMLimits:Varies with theme. The maximum amount that can be withdrawn from bank to machines credit. * CreditCashOutAt:The maximum amount allowed on a machine before a bank check is put in player's backpack. * * ErrorCode: For determining the cause of a slot machine failure. * * JackpotRewards: Values are None (no item rewards), RewardOnly(jackpot gives items only), or * RewardAndCash(jackpot gives rewards AND cash). This value only applies to those * themes that give item rewards. * * MembershipCard(True):Issues a Casino membership card to jackpot winners over 500k. * See CardClubOnly above. Also makes for a useful "bragging" trophy. * * PlayerSounds:Usually defaults to true. These slots are noisy! Designed to attract attention like * real slots. * * ProgPercent(5%): The amount of gp played to be put into a progressive jackpot. See above for configuring * progressive jackpot pools. * * Random Max/Min: The amount of time a Random machine stays on one odds table. Used also for when a * player's luck has affected the odds table. * * ResetTotals: Used to reset the slots totals. Usually not recommended as you'll lose your stats. * * ShowPayback(false):Not recommended, but will show the slot's current payback amount to players. Note: GMs * or higher will always be able to see this figure on the slot. * * SlotTheme: The current slot's theme. See Above. * * TotalCollected: Total amount collected by this slot. * TotalNetProfit: The Casino's "Take". * TotalSpins: The number of times the slot has been played. * TotalWon: The amount of gp payed out to players. * * w_Percentage: Statistical odds of the machine. * WinningPercentage: Real "current" odds of the machine. * * zJackpotStats0-S2: The # of times a particular jackpot has been hit. Jackpot 0 is the * top line, S1 and S2 are scatter counters. * zReelOne,ReelTwo,ReelThree: The current symbol line. * * * Profiling/Creating your own machine. * * While there are already 14 themes to choose from, you might find yourself bored one day * and decide to create your own unique machine. This can be as simple as changing the symbols * and odds table to as complex as creating new rewards. To start you will need to remove the comments on * the line "#define PROFILE". This option will present you with additional properties and let you * put the machine into "test" mode. This IS NOT recommended for live shards as it has the potentional * to be abused and turn your slots into a gold farmers dream or admin's nightmare! * * Building a new theme can also be quite complicated the first time, but after a few times you * can usually create an all new theme in under an hour. I won't go over all the details on doing * this, you're on your own except for any posts/info I may give in the script's thread. You should * have a good grasp of how the slots work and especially what payback odds mean as well as generating * profiling data to verify you're not creating a gold farm. * * ------------------------------------------------------------------- * Top Ten Board. * * I've also included a nice litte message board that players can click on to see a list of * players that have recently won jackpots and encourage play. Put them at your banks and/or casino. * GMs and above will also have an extra icon that takes you to a shard-wide information gump that * will display all slots and totals/etc of your casino. Very helpful for an overall view of the * slots and how much gold they have removed from your economy. It also allows you to get properties of * a slot machine and zip quickly to a slot machine. You can also set a slot's Active (offline/online) * property from this gump. * * Usage: ]add TurboSlotStats * ------------------------------------------------------------------- * Casino Tokens. * * This item allows a player to play the slots for free up until uses remaining hits 0, which it * then self deletes. A nice way to get people playing your slots is to drop one of these in their * backpacks while online, or include it your new player startup pack. Defaults to 10 uses, but can * be setup to do more then that. * * Usage: ]add CasinoToken {uses} {hue} * ------------------------------------------------------------------- * Acknowledgements: Thanks to RoninGT for the original miner madness slot. Installation: Unzip CEOTurboSlots.zip into your custom script folder and restart. Usage: ]add TurboSlot */ // Only use PROFILE options on a test shard!
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 07:42 PM. |
|
|
|
|
|
#2 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
* -------------------------------------------------------------------
* Top Ten Board. * * I've also included a nice litte message board that players can click on to see a list of * players that have recently won jackpots and encourage play. Put them at your banks and/or casino. * GMs and above will also have an extra icon that takes you to a shard-wide information gump that * will display all slots and totals/etc of your casino. Very helpful for an overall view of the * slots and how much gold they have removed from your economy. It also allows you to get properties of * a slot machine and zip quickly to a slot machine. You can also set a slot's Active (offline/online) * property from this gump. * * ]add TurboSlotStats * ------------------------------------------------------------------- * Casino Tokens. * * This item allows a player to play the slots for free up until uses remaining hits 0, which it * then self deletes. A nice way to get people playing your slots is to drop one of these in their * backpacks while online, or include it your new player startup pack. Defaults to 10 uses, but can * be setup to do more then that. * * ]add CasinoToken {uses} {hue} * -------------------------------------------------------------------
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 01:46 PM. |
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
*reserved*
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 01:47 PM. |
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
Join Date: Jan 2003
Location: California
Age: 41
Posts: 3,259
|
Awesome I love these..thanks for the update!
__________________
My Scripts: HoodableRobe CellarAddon SeigeUpdates Refresh/CloneMe Commands VooDoo Dolls Lost Alchemy SVN 187 Updates: Bard System + Upgrade Ultima VII |
|
|
|
|
|
#9 (permalink) |
|
Newbie
|
all nice but i got crash look :
Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Server.Items.TurboSlot.OnMovement(Mobile m, Point3D oldLocation) at Server.Mobile.Move(Direction d) at Server.Mobiles.PlayerMobile.Move(Direction d) at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc) at Server.Network.MessagePump.HandleReceive(NetState ns) at Server.Network.MessagePump.Slice() at Server.Core.Main(String[] args) can somone help? |
|
|
|
|
|
#12 (permalink) |
|
Forum Master
Join Date: Aug 2003
Posts: 5,688
|
I think that you just need to change the OnMovement method in turboslot.cs from this
Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_InUseBy != null)
{
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal)
{
m_InUseBy.CloseGump(typeof(TurboSlotGump));
m_InUseBy.CloseGump(typeof(NewMinerBonusGump));
m_InUseBy.CloseGump(typeof(TurboSlotPayTableGump));
m_InUseBy.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
m_InUseBy.PlaySound(52);
m_InUseBy.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(m_InUseBy); // Give them their winnings
}
InUseBy = null;
}
}
}
Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_InUseBy != null)
{
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal)
{
Mobile from = m_InUseBy;
from.CloseGump(typeof(TurboSlotGump));
from.CloseGump(typeof(NewMinerBonusGump));
from.CloseGump(typeof(TurboSlotPayTableGump));
from.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
from.PlaySound(52);
from.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(from); // Give them their winnings
}
InUseBy = null;
}
}
}
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. " For questions, information, and support for XmlSpawner and its addons, visit the XmlSpawner Support Forum |
|
|
|
|
|
#13 (permalink) | |
|
Forum Expert
|
Quote:
How to run your server in DEBUG I usually just run my server in debug mode all the time for a while after I've added a new script or package.
__________________
In some cases stupid makes you win-Radwen |
|
|
|
|
|
|
#15 (permalink) | |
|
Forum Novice
|
Quote:
Also you can solve the problem by this way: Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_InUseBy != null)
{
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal)
{
if (m_Won != 0)
{
m_InUseBy.PlaySound(52);
m_InUseBy.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(m_InUseBy); // Give them their winnings
}
m_InUseBy.CloseGump(typeof(TurboSlotGump));
m_InUseBy.CloseGump(typeof(NewMinerBonusGump));
m_InUseBy.CloseGump(typeof(TurboSlotPayTableGump));
m_InUseBy.SendMessage("You have walked away from the slot machine, others may now use it.");
InUseBy = null;
}
}
}
Last edited by Prohor Meletevich; 08-14-2006 at 06:15 PM. |
|
|
|
|
|
|
#16 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Odd, this worked fine before. I'll look into it asap, and have a fix shortly if it's reproducable.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 06:42 PM. |
|
|
|
|
|
#17 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
Why does it get set to null though and from doesn't? Something in the way the gumps close I guess. I should close the gumps after the cash payout I'm guessing... Edit: Aw yes, I see. the CloseGump function I don't believe in 1.0 sent a 'close' to OnResponse in the gump before, now it does, which I have code in there to also close and payout.... So it's executing the gumps onclose as well. Here's what I've got, to keep it 1.0/2.0 compat: Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_InUseBy != null)
{
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal)
{
m_InUseBy.CloseGump(typeof(TurboSlotGump));
#if !RUNUO2RC1
m_InUseBy.CloseGump(typeof(NewMinerBonusGump));
m_InUseBy.CloseGump(typeof(TurboSlotPayTableGump));
m_InUseBy.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
m_InUseBy.PlaySound(52);
m_InUseBy.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(m_InUseBy); // Give them their winnings
}
#endif
InUseBy = null;
}
}
}
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 06:53 PM. |
|
|
|
|
|
|
#18 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Updated to 1.0c to fix the way gumps close with 2.0, didn't even think to test that. Sorry about that. This might affect other close operations that I'll need to check.
![]() Edit. Bumped again to 1.0d. Fixed one other closegump possible crash, but only when profiling a new slot, which should only be done on a non-live shard anyways.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 08-14-2006 at 07:22 PM. |
|
|
|
|
|
#19 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Also, please make sure you've commented out the "#define PROFILE" line, I've changed it and reuploaded 1.0e, as I've distributed the default with that undefined in the past, but didn't turn it off again while testing. You do not want PROFILE defined on a live shard, GMs have a potentional to 'profile' a theme and produce huge checks when cashing out, not to mention it'll stall the server for about 30 seconds+ while profiling! Of course, all the GMs we hire are honest, but just in case....
![]()
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
#20 (permalink) | |
|
Forum Master
Join Date: Aug 2003
Posts: 5,688
|
Quote:
Then any other code, such as the gump code, that could subsequently change m_InUseBy, wont make any difference because you dont refer to InUseBy after that point. If you leave the references to m_InUseBy, then there will always be the possibility of crashing since InUseBy is publicly accessible and so cannot be guaranteed to have the non-null value that initially passed the check since anyone can change it. Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m_InUseBy != null)
{
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal)
{
Mobile from = m_InUseBy;
from.CloseGump(typeof(TurboSlotGump));
from.CloseGump(typeof(NewMinerBonusGump));
from.CloseGump(typeof(TurboSlotPayTableGump));
from.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
from.PlaySound(52);
from.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(from); // Give them their winnings
}
InUseBy = null;
}
}
}
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. " For questions, information, and support for XmlSpawner and its addons, visit the XmlSpawner Support Forum |
|
|
|
|
|
|
#21 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Yeah, I thought about that later, but after updating so many times I'll leave it until the next update that'll add a couple more themes. One fix I made did do exactly that too, using a private var. And it doesn't cause much overhead trying to close a gump that isn't there.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
#22 (permalink) |
|
Forum Novice
|
How can I make them flipable? right now they only face one direction...but id like to put them facing all dris (to go along walls) I love this sys btw, great work!
__________________
(\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. |
|
|
|
|
|
#23 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
Code:
namespace Server.Items
{
public class TurboSlot : Item
Code:
namespace Server.Items
{
[DynamicFliping]
[Flipable(3803, 3804)]
public class TurboSlot : Item
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
|
#25 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
![]()
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|