#Trap #72  Poison needles
#Added with Tales of the North MOD
#poison 5d4+3 for 20 ticks, save vs. poison
from eventAPI import *
from APIUtils import *

def fireEvent(e):
   lFlagS = getTag(e, "lFlagS")
   if (not issetany(lFlagS, 0x00000300)):
      return 1
   if (isclearall(lFlagS, 0x00000002)):
      showMessage(e, ["You hear a faint click and poison needles shoot from the walls."], optionInput)
      for partyIdx in range(getPartyCount(e)):
         if (savingThrow(e, "poison", partyIdx, 0)):
            poison(e, partyIdx, 5, 4, 3, 2, 0, 40)
   return 1
