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!

Gambler NPC - 2D/3D version *updated*

Status
Not open for further replies.

Zulu

Wanderer
Gambler NPC - 2D/3D version *updated*

Summary:
Gambler NPC that will play Blackjack AND Poker against the player. This is my first script based on my POL NPC Gambler. I have added poker to this version.

Nov 16 - updates
- Added new variable to set standard / new card version.
- Removed the blackjack/poker restart.
- Fixed new cards in verdata(2D)/3D version to put them in order.
- Cleaned up some of the code to optimize it.
- Created functions for color of suit.
- Moved close button.


Download
Download(13K) Gambler (b34 and b35, standard/new card support, all 2D/3D clients)
If you use the new card version, you need to download the cards from below.
Only standard card graphics are included.

New card graphics for 2D / 3D version
Download(368K) new cards for ALL 2D versions of Ultima Online. readme2d.txt
Download(11,393K) new cards for ALL 3D versions of Ultima Online. readme3d.txt

Standard Version Cards


New Version Cards
This requires all players to have either 2D or 3D version of cards.


Showing the new cards.
Load the script gambler.cs in your favorite editor...then go to line 14. Make your changes and save the code and re-start runuo.

[code:1] private const bool NewCards = false;[/code:1]
The above code means the script will NOT show the new cards. The is the default setting.

[code:1] private const bool NewCards = true;[/code:1]
The above code means the script will show the new cards.
 

mikemaz

Wanderer
awsome

was just thinking about Blackjack for last night didnt really know much on how to script it , but this looks awsome cant wait to try it out thanks alot. :D

how do i post a pic here i lost when the dealer got 25 i had19 so there is a little mistake somewhere hehe but i love this awsome awsome awsome..
It would also be nice if you can change the bet . but im not sure if that could be done. I love it as is just adding my points in hope that i dont come across the wrong way
 

mikemaz

Wanderer
and on 26 i just got blackjack hehe is that American thing? seems kinda wierd to me also he wins on 22 hehe i still love this its my fav game . im also bet 4oo at a time now i dunno must be a bug or something when you double down it doesnt reset you back to 100 now im bet 800a game.
 

Zulu

Wanderer
mikemaz, when you double down, if it is below 1000, then it will not reset.

Anyone who uses the script can change the zuluhotel tag info in the script.

CLICK the BET button and it will change your bet!!
 
*takes a quick glance*

interesting script indeed... took a glance at the previous mentioned problems and it might be in the following code snippet:
[code:1]
if (playervalue>21 || (dealervalue>playervalue))
{// dealer won
m_From.gamestats[0] += 1;
m_From.pokermsg = "Dealer Wins.";[/code:1]

Try changing it to

[code:1]
if ( ( playervalue > 21 ) || ( dealervalue > playervalue ) && ( dealervalue < 22 ))
{// dealer won
m_From.gamestats[0] += 1;
m_From.pokermsg = "Dealer Wins.";[/code:1]




Haven't had a chance to actually try it but it seems this should do the trick.
Give it a go and see if it helps...
Seems that any dealervalue that is higher than the playervalue on the final deal will cause the dealer to win... the extra check should ensure that the dealer at least does not get declared a winner automatically.


I assume you'll have to add an extra check to see wether the dealer and the player now are 'bust' (over 21) but I am too lazy to read the rest of the script and people in this forum will happily confirm that I know nothing hehe
 

Zulu

Wanderer
Captain The First, there are 2 locations that need a fix. I have posted an updated script.

Old code found in 2 locations
[code:1]if (playervalue>21 || (dealervalue>playervalue))
{// dealer won
m_From.gamestats[0] += 1;
m_From.pokermsg = "Dealer Wins.";
}[/code:1]

Should be:
[code:1]if (playervalue>21 || (dealervalue>playervalue && dealervalue<=21))
{// dealer won
m_From.gamestats[0] += 1;
m_From.pokermsg = "Dealer Wins.";
}[/code:1]

Download fix from http://142.179.148.248/gambler.zip

***If you click the Bet button, your bet will go up by $100 each time. at $1000.00 it will cycle back to $100. ***
 

raistlin

Wanderer
Little expliot here: when you double down it doubles your bet but it doesnt give you another card. Normaly when you double down, your wager is doubled and you get one additional card and one card only.

The way it is now, makes it really easy to make alot of cash.

Most players use double down when the dealer has a bad card like a 5 or 6 showing and they have like 9, 10, or 11 and they are hoping to catch a face card to give themselves 19, 20, or 21.
 

Zulu

Wanderer
raistlin, I am not sure which version you downloaded. The new version does not do that.

I also just added the words keep under the check boxes in the poker section to make it more understandable.

the : 0 by the player shows you how many moves you have left.

JUST added a new statics sections that keeps stats for both games.
 

mikemaz

Wanderer
hmm

why does it not show all the info like i only see my cards i dont see the gumps for tie ,win,lose ect and i dont see the dealers cards either. any idea its a fresh download of your game.
 
Status
Not open for further replies.
Top