[@EvilSpirit1]
#IF
#ACT
Mov  D0  3                                                              ;This is how many points you get for this mob
FormatStr "FLD_CHARACTER='%s'" %USERNAME                                ;Makes a String (A9) that says "FLD_CHARACTER=CHARNAME"
DelayGoto [Grobal] 1 @SpawnES2 
ReadValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" @AddPoints  ;Reads the SQL line where FLD_CHARACTER=CHARNAME

[@SpawnES2]
#ACT
mov A0 %USERMAP
mov A1 %USERX
mov A2 %USERY
ForMatStr "%s,%s,%s,0" %A0 %A1 %A2
Param1 %A0
Param2 %A1
Param3 %A2
SetMission
MonGenP %A9 EvilSpirit2 1
Break

[@EvilSpirit2]
#IF
#ACT
Mov  D0  2
FormatStr "FLD_CHARACTER='%s'" %USERNAME
DelayGoto [Grobal] 1 @SpawnES3 
ReadValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" @AddPoints


[@SpawnES3]
#ACT
mov A0 %USERMAP
mov A1 %USERX
mov A2 %USERY
ForMatStr "%s,%s,%s,0" %A0 %A1 %A2
Param1 %A0
Param2 %A1
Param3 %A2
SetMission
MonGenP %A9 EvilSpirit3 1
Break

[@EvilSpirit3]
#IF
#ACT
Mov  D0  1
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" @AddPoints

[@VampireBat]
#IF
#ACT
Mov  D0  1
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" @AddPoints

[@WereWolf]
#IF
#ACT
Mov  D0  5
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" @AddPoints


[@AddPoints()]
#ACT
Mov A0 %ARG(1)                                                     ;Puts the 1st Argument into A0 - See Above, its asks for 2 Arguments to be returned 
Mov D1 %ARG(2)                                                     ;Puts the 2nd Argument into D1
Mov D2 %ARG(3)
#IF      
Equal  A0  ""                                                      ;If it doesn't return your username its because you haven't killed anything before and your name isn't in the table
#ACT                                                               ;So.. its add it
FormatStr "'%s',%s,%s" %USERNAME %D0 %D0                                 ;Makes a String like this > > 'CHARNAME,1'
Mov A8 %A9                                                         ;Puts that string into A8
FormatStr "FLD_CHARACTER='%s'" %USERNAME                           ;Makes a String like this > > FLD_CHARACTER=CHARNAME
WriteValueSql "TBL_HALLOWEEN" %A9 "FLD_CHARACTER,FLD_POINTS,FLD_TOTAL" %A8   ;Writes a NEW line into the SQL with the Details CHARNAME,1 (username and 1 point)
sysmsg "You have <$OUTPUT(D0)> Halloween Slayer Points"            ;Gives you a message with how many points you have so far.
Break                                                              ;Breaks
#ELSEACT                                                           ;If it DOES find you username, you just have killed something before and your name will be in the table
Inc D1  %D0                                                        ;So it adds %D0 points (you set above in the individual mob section
Inc D2  %D0                                                        ;So it adds %D0 points (you set above in the individual mob section
FormatStr "FLD_POINTS=%s,FLD_TOTAL=%s" %D1 %D2                                      ;Makes a String like this > > FLD_Points=QTYofD1
Mov A8 %A9                                                         ;Puts it into D8
FormatStr "FLD_CHARACTER='%s'" %USERNAME                           ;Makes a String like this > > FLD_CHARACTER=CHARNAME
UpdateValueSql "TBL_HALLOWEEN" %A9 %A8                             ;Updates the Line in the SQL that matches FLD_CHARACTER=CHARNAME with FLD_POINTS=D1
sysmsg "You have <$OUTPUT(D1)> Halloween Slayer Points"            ;Gives you a message with how many points you have so far.
Break                                                              ;Breaks
