;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Quest Rank System - NPC Bit;;; Provided by CheekyVimto - Xtreme Servers ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@Main]
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_RANKSYSTEM" %A9 "FLD_CHARACTER,FLD_RANK" [@AddRank1]
[@AddRank1()]
#IF
#ACT
mov A0 %ARG(1)
; Put Characer name in variable A0
mov D1 %ARG(2)
; Put Quest Rank in variable D1
; The Above is just reading information straight from your tableTBL_RANKSYSTEM
#IF
EQUAL D1 0
; If Quest Rank equals 0
#SAY
<$USERNAME>, your QuestRank is {FCOLOR/5}<OUTPUT(D1)>{FCOLOR/12}\
These Quests are available to you at this time.
;--- List quests for Rank '0'---
<
Exit/@Exit>
#ACT
break
; Below will only be added if Quest Rank is 1 or above.
#IF
LARGE D1 1
#SAY
#INCLUDE
;--- List quests for Rank '1'---
<
Exit/@Exit>
#ACT
break
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Quest Scripts bit;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Use the Mapquest.txt [MonDie] trigger to load a script on monster death
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This script will set the quest rank in the table TBL_QUESTRANK to whatever is set in variable D5
#IF
#ACT
mov D5 1
;this sets variable D5 to 1
mov A1 "%USERNAME"
;this stores character name in A1
#IF
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
; Gets characters name
mov A8 %A9
; Puts above string in variable A8
FormatStr "FLD_RANK='%s'" %D5
; Remember FormatStr always stores to A9
UPDATEVALUESQL "TBL_QUESTRANK" %A8 %A9
; Update sets FLD_CHARACTER to %USERNAME, and FLD_RANK to %D5
#IF
#SAY
Well Done your Quest Rank has increased to {FCOLOR/10}<$OUTPUT(D5)>{FCOLOR/12}\
Please goto the Quest NPC to see newly available quests!\
<
Exit/@Exit>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;