#keep level 2 treasure #1

from APIUtils import *

rtkeep2treas1 = 0
rtmelvinFlag = 0

def fireEvent(e):
   global rtkeep2treas1
   global rtmelvinFlag
   rtmelvinFlag = getTag(e, "rtmelvinFlag")
   rtkeep2treas1 = getTag(e, "rtkeep2treas1")
   if ((rtkeep2treas1 == 1) or (rtmelvinFlag > 2)):
      return 1
   else:
      showMessage(e, ["There are coins scattered across the floor here."])
      chest(e, -1, 0, dice(225, 4, 1), [], 0, "Treasure")
      rtkeep2treas1 = 1
      setTag(e, "rtkeep2treas1", rtkeep2treas1)
      return 1
