Map Entry issue

gandy

Dedicated Member
Dedicated Member
May 13, 2003
94
0
102
Hi all i recently dug up an old server i made and im trying to fix one of the issues i could never resolve with map entry.

Its a reasonably simple script in that when D0 is 0 then it fails and calls a script, when D0 is 1 and wearing a certain armour is lets the user through, when d0 is 1 and not wearing armour it fails.

Code:
[@Main]
#IF
#ACT
FormatStr "FLD_CHAR='%s'" %USERNAME
ReadValueSql "TBL_DoorDB" %A9 "FLD_Position" [@Check]

[@Check()]
#ACT
MOV D0 %ARG(1)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;STARTS TASK IS HASNT STARTED, D0=1 AFTER SCRIPT RUNS
#IF
EQUAL D0 0
#ACT
enter_fail
SYSMSG "<$OUTPUT(d0)> Enter_Fail"
goto @Start0
break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ALLOWED THROUGH DOOR WHEN D0=1 AND WEARING M ARMOUR
#IF
EQUAL D0 1
CHECKITEMW ClothRobe(M)
#ACT
enter_ok
SYSMSG "<$OUTPUT(d0)>, Enter_OK, M Armour"
close
break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ALLOWED THROUGH DOOR WHEN D0=1 AND WEARING F ARMOUR
#IF
EQUAL D0 1
CHECKITEMW ClothRobe(F)
#ACT
enter_ok
SYSMSG "<$OUTPUT(d0)>, Enter_OK, F Armour"
close
break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;NOT ALLOWED THROUGH DOOR WHEN D0=1 AND WEARING NO ARMOUR
#IF
EQUAL D0 1
#ACT
enter_fail
SYSMSG "<$OUTPUT(d0)> Enter_Fail, No Armour"
close
break
#SAY
Give message about needing to wear ClothRobe(M/F)
<Exit/@exit>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ALLOWED THROUGH DOOR WHEN D0 IS ANYTHING BUT 0 OR 1
#IF
#ACT
enter_ok
SYSMSG "<$OUTPUT(d0)> Enter_OK via ELSEACT"
close
break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CALLS SCRIPT TO START AND SET D0=1

[@Start0]
#CALL [Door\0_0.txt] @Start0_0

Im getting to the correct section as the correct SYSMSG appears, and the DB shows the correct values.

If i run it all from the same section like below:
Code:
[@Main]
#IF
#ACT
FormatStr "FLD_CHAR='%s'" %USERNAME
ReadValueSql "TBL_DoorDB" %A9 "FLD_Position" [COLOR="#FF0000"]<Removed forwarder to @Check[/COLOR]
MOV D0 %ARG(1) 

#IF
#ACT
etc etc
Then the doors work but i have to bump into them twice, the first time runs the previous script. EG if im on D0=1 with no armour and walk through the door it fails with the correct message, then i put armour on, walk through and it fails again with the no armour message, walk through again and its ok. I suppose if i cant figure it out all have to use flags but i couldnt really be bothered re-writing the linked scripts. Also does anyone know the command to reload mapquest scripts?

PS theres a few unessesary 'close' etc commands as i was trying a few different fixes

PPS Just found the command to re-load the mapquest scripts by trial and error so dont need this now
 
Last edited: