View Single Post
Old 29.07.2005, 21:12   #11
Fulminus
Архивный участник
 
Join Date: Jul 2005
Posts: 23
Default

MSSQL supports triggers. You can write a bit of TSQL code that triggers every time the adena ammount is added and limit it. It's not as easy as it may sound...The event will be triggered every time an item is picked up and you'll have to check if it's adena and change the ammount to something no larger than your limit.
Of course, this is a very dirty fix, as money will be lost this way...For example, during trades, etc, the transaction will be completed but some of the money will go to thin air.
A better solution would be to split the amount such that part of the money gets transfered and what can't go to the user falls on the ground...but that's day dreaming :P The SQL's trigger can take care of splitting the ammount and inserting a zero-user (owner) item to the table, but getting that entry to be shown in the game and at the right place (near the player) is beyond the scope of SQL.
In any case...as far as limitting the amount to avoid negatives goes, a trigger will work.
Fulminus is offline