How to mov usergold to variable?

budyniowski

Dedicated Member
Dedicated Member
Dec 16, 2007
149
0
63
Warsaw, Poland
its possible? i want make gold drop script on user die (user die -> system check how much gold user have -> take some % of usergold -> drop this % on user coords )
 

Alecs

SPQR
VIP
Jan 10, 2009
3,317
3
1,199
380
Europa
i heard something like that, when user die he lose a % of his gold but i'm not sure if you can drop it.

of topic: ur server has 199 users?
 
Upvote 0

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
Do you also know how to find how much gold a person has?

Once done that find the %age, make that number = D1 or something and drop it, then just take the gold.
 
Upvote 0

Omikkk

Dedicated Member
Dedicated Member
Jul 20, 2006
232
10
65
Poland
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_CHARACTER" %A9 "FLD_CHARACTER,FLD_GOLD" [@System]
Break

[@System()]
#ACT
Mov A2 %ARG(1)
Mov D1 %ARG(2) ;; tu masz gold
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
its updated like every 10minutes or so. so if someone made a large transaction and died, it probably would not work to his favor :)
though i found the customized sql tables you can make such as the guild gold storage script.. update rather quicker. i cant say if its instant, but im sure its not 10min, if anything its under 10 seconds.
i mean the concept is all do-able ommikk spelled it out pretty well.
though my knowledge is a bit hazy since i havent scripted for mir3 in over a year :) i cant recall that you can actually drop gold or not. i no there is a map drop command but you can only drop items as far as i remember, but not gold.
 
Upvote 0

budyniowski

Dedicated Member
Dedicated Member
Dec 16, 2007
149
0
63
Warsaw, Poland
00Default:
[@_DieScript]
#IF
HLSCRIPTCMD CHECKUNDEAD
#ACT
goto @playerrdead

[@playerrdead]
#CALL [HLSCRIPT\DieScript.TXT] @DieScriptExec

QuestDiary\HLSCRIPT\DieScript (ofc you can change to what you want):

[@DieScriptExec]
{
#ACT
mov P1 %USERGOLD
mov D1 100
mov D2 10
MOV A0 %USERMAP
MOV A1 %USERX
MOV A2 %USERY
mul P1 D2
mov P2 %P9
div P2 D1
mov N1 %P9
take gold %N1
inc A1 2
formatstr "%s,%s,%s,0" %A0 %A1 %A2
DropItemMap %A9 Gold %N1 1
CLOSE
}

This Script was written by Oxis - Thanks.
 
Upvote 0

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
#ACT
mov P1 %USERGOLD
MOV A0 %USERMAP
MOV A1 %USERX
MOV A2 %USERY
div P1 10
mov N1 %P9
take gold %N1
formatstr "%s,%s,%s,0" %A0 %A1 %A2
DropItemMap %A9 Gold %N1 1

This will give a 10% drop of gold. You can't increase xx or yy by 2 as it may be in a wall i think so why not just drop on char position? better still just add gold to player, don't bother dropping.
 
Upvote 0