;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntNewHorse]
{
#IF
;checklevel 44
#SAY
Sorry, I need to fix this first :)
#ACT
Break

#IF
#SAY
Horse Upgrades give the benefit of owning a\
nice new Horse before the normal level\
requirement\
1. 10000 Integral will get you to Purchase a Red Horse\
___This will give you 200 Bag Weight and \
___2-5 DC or SC or MC attack\
2. 15000 Integral will get you to Purchase a Black Horse\
___This will give you 300 Bag Weight, 20 Hand Weight \
___and 3-8 DC or SC or MC attack\
<[ Buy Red Horse ]/@BuyRedHorse(RedHorse,Horse3,44,10000)> Level 44 (Normally 52)\
<[ Buy Black Horse ]/@BuyRedHorse(BlackHorse,Horse4,60,15000)> Level 60 (Normally 70)\
<[ Main Menu ]/@main>\\\\\\\\\
#ELSESAY
You must be at least {FCOLOR/1}level 44{FCOLOR/12} to use this service.\
<Back/@IntegralMainMenu>

[@BuyRedHorse()]
#ACT
  Mov        A1       %ARG(1)
  Mov        A2       %ARG(2)
  Mov        D1       %ARG(3)
  Mov        D2       %ARG(4)
#IF
CheckLevel  %D1
#SAY
Are you sure you want to buy a <$OUTPUT(A1)>?\
This will cost you <$OUTPUT(D2)> Integral\
<[ Confirm ]/@CheckExIntRedHorse>\
<[ Back ]/@IntegralMainMenu>

[@CheckExIntRedHorse]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckExIntRedHorse2]
[@CheckExIntRedHorse2()]
#IF
#ACT
   mov    D3      %ARG(2)
#IF
   Esmall D2 %D3
   !CheckHorse  
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   mov   A8     %A9
   dec   D3     %D2
   mov   D4     %D3
   FormatStr "FLD_INTEGRAL='%s'" %D4
   UPDATEVALUESQL "TBL_INTEGRAL" %A8 %A9
   Horsecall %A2
   mov     A7  ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ","
   AddStr  A7 %A1
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
Press 'M' to ride your new horse\\
Your current Integral is {FCOLOR/10}<$OUTPUT(D4)>{FCOLOR/12}\
<Back/@IntegralMainMenu>
#ELSESAY
You do not have enough Integral Points\
Or you already have a horse\
Your current Integral is {FCOLOR/10}<$OUTPUT(D3)>{FCOLOR/12}\
<Back/@IntegralMainMenu>
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;