#plain of water Ocean encounter
from eventAPI import *
from APIUtils import *

rtPOWOcean1 = 0

def fireEvent(e):
   global rtPOWOcean1
   rtPOWOcean1 = getTag(e, "rtPOWOcean1")
   if (rtPOWOcean1 == 3):
      questDone(e)
   elif (rtPOWOcean1 == 2):
      returnVisit(e)
   else:
      firstVisit(e)
   return 0

def firstVisit(e):
   showPicture(e, "Water_Elemental")
   showMessage(e, ["A pale blue figure sits upon a coral throne.  The beautiful figure seems in motion even though it sits as still as a statue."])
   showMessage(e, ["The world here seems unnaturally silent and still.", "", "The figure upon the throne does not appear to notice your presense."])
   showMessage(e, ["You speak, attempting to gain the beings' attention, but your words sound weak and are absorbed in the silence that surrounds you.", "", "You take your leave."])
   rtPOWOcean1 = 1
   setTag(e, "rtPOWOcean1", rtPOWOcean1)

def returnVisit(e):
   global rtPOWOcean1
   showMessage(e, ["This place is different than before.", "", "The unnatural silence has been lifted and the sounds of water now fill your ears.  The beautiful figure upon the throne now seems alive."])
   showPicture(e, "Water_Elemental")
   showMessage(e, ["\"Wind has told me what you have done.\" the figure sings.  Her voice is like a waterfall and at the mention of Wind there is a sound of rain."])
   playSpecAudio(e, "Thunder")
   showMessage(e, ["\"Yes, I know what it is that you seek.\"", "", "There is a clap of thunder and Ocean smiles.", "", "\"Wind is impatient, but he has been trapped for so very long and desires to stretch and run free.\""])
   showMessage(e, ["\"Go to the southern shore and speak the name of my daughter, Storm.  There do battle with the Kraken and take it's eye, it will protect you from Flame's wrath.\""])
   playSpecAudio(e, "Thunder")
   showMessage(e, ["Having been given new direction towards your goal, you take leave of Ocean.", "", "There is another clap of thunder and the sounds of rain can be heard.  Ocean laughs, and the sound is like that of waves crashing."])
   clearPicture(e)
   showMessage(e, ["In some ways, you feel as if a family has just been reunited."])
   rtPOWOcean1 = 3
   setTag(e, "rtPOWOcean1", rtPOWOcean1)

def questDone(e):
   showMessage(e, ["Menacing clouds fill the sky and you can see Ocean dancing.  It does not appear safe to move any closer."])
