tass23

Member
Indeed I did!!! Now, this isn't your ordinary betting, oh, no! This is Betting via Xmlspawner! I've created a GamblingBook to go along with this release as well. You'll want to edit this for your shard before you hand it out though. This is very diverse! You can use this really anywhere you want, for anything! Just add the spawner (change whatever you need) and away you go! Basically the way it all works is:
1. Player drops a bank check onto the Gambling Book.
2. The Current Bet Amount becomes the amount of the check the player dropped onto the book.
3. The BettingSpawner does all the legwork.
A. Betting Spawner sets the WinningAmount=Current Bet
B. Betting Spawner multiplies the WinningAmount by 10% (This can be ANY percentage you want)
C. Betting Spawner increases the value of WinningAmount by the CurrentBet Amount (WinningAmount*.10)+CurrentBet
4. Player enters the WinningAmount value using the number keys on the right and gets a check for the WinningAmount.

5. An additional step would be to reset the CurrentBet to 0, but that's up to you.

Here is the BettingSpawner code by line entry:
Code:
SETONCARRIED,The Betting Book,GamblingBook/WinningAmount,{GETONCARRIED,The Betting Book,GamblingBook,CurrentBet}
Code:
SETONCARRIED,The Betting Book,GamblingBook/WinningAmount/MUL,0.1
Code:
SETONCARRIED,The Betting Book,GamblingBook/WinningAmount/INC,{GETONCARRIED,The Betting Book,GamblingBook,CurrentBet}

NOTE: Rename the extension for BettingSpawner from .txt to .xml (Since we can't upload .xml files)
Thanks to @Sorthious as well! :)

You do not have my permission to repost this anywhere else. This is a ServUO exclusive! ;)
 

Attachments

  • GamblingBook.cs
    8.7 KB · Views: 20
  • BettingSpawner.txt
    1.9 KB · Views: 22
Last edited:
I changed the BettingSpawner ext to .xml and added it to my Data directory. Rebooted the server, got out the Gamblinging Book, put 10 blank scrolls in it, added a bankcheck of $5000 gold. Everytime I click accept it says: A check for the amount of ZERO? Why?
What am I doing wrong?
 
This uses SETONCARRIED which I believe is one of the things servuo removed from xmlspawner a few months ago, are you using a new or older repo?
 
Hi @jayates
Sorry this is not working for you. When it was written, Xmlspawner was beginning to die off and I am not sure what has been removed from the system. If Xmlspawner is installed correctly, SetOnCarried should handle all the functionality. Feel free to PM me, if you are still stuck.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back