View Full Version : One more version of Gamble NPC
Small share.
This version of Gamble NPC not use recipe.txt, it is use ai.obj.
It plays only to the money - from 100 to 1000000 adena.
Sorry for my bad English. I'm from Russia :)
ps. ok i fixed 1 bug, please reload the archive :)
1)
s h i f t _ s p 1
p u s h _ e v e n t / / t a l k e r
p u s h _ c o n s t 3 2
a d d
f e t c h _ i
p u s h _ c o n s t 5 7
f u n c _ c a l l 8 1 / / f u n c [ O w n I t e m C o u n t ]
s h i f t _ s p - 2
p u s h _ c o n s t 1 0 0
g r e a t e r
b r a n c h _ f a l s e L 7 9 2 1 4
u have to use equal or greater.
2)
s h i f t _ s p 1
p u s h _ c o n s t 1 0 0 0 0 0
f u n c _ c a l l 5 5 / / f u n c [ R a n d ]
s h i f t _ s p - 1
p u s h _ c o n s t 4 6 4 5 4 3
e q u a l
b r a n c h _ f a l s e L 7 9 2 1 6
LOL!!!
3) probabilities are to high to win something
You wrong, there is all right. First you post of cod - is cheking of have a talker > x adena, if hi has = x adena, he can not play, but if talker has = x+1 adena he can play...
x - amount of adena to play...
Jackpot chance - 1/1000000
x - amount of adena to play...
sorry for my bad English again... )) this cod compiled in nasc and no have bugs for me... all work fine...
if the adena required is 100 why re u checking for 101+?
this is wrong
s h i f t _ s p 1
p u s h _ c o n s t 1 0 0 0 0 0
f u n c _ c a l l 5 5 / / f u n c [ R a n d ]
s h i f t _ s p - 1
p u s h _ c o n s t 4 6 4 5 4 3
e q u a l
b r a n c h _ f a l s e L 7 9 2 1 6
ur never going to have a random number from 0 to 100000 equal to 464543, why? 464543 > 100000
>_>
ok. i fogot 0, but checking need becose if you loose and you adena amount = 0, cashd give you some error about state null in the function.. i check just amount of adena in the bag....