Difference between revisions of "Script: L1trig4trap"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"trapCheck"</span>) { <span style="color:#0000FF">list</span> Q5IT; <span style="color:#...")
 
 
Line 8: Line 8:
 
     for(<span style="color:#0000FF">int</span> i = 0x00; i < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5IT); i++)
 
     for(<span style="color:#0000FF">int</span> i = 0x00; i < [[Engine Function:_numInList|<span style="color:#FF0000;font-weight:bold">numInList</span>]](Q5IT); i++)
 
     {
 
     {
       damage = [[dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x03, 0x05);
+
       damage = [[Engine Function:_dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x03, 0x05);
 
       [[Engine Function:_setCurHP|<span style="color:#FF0000;font-weight:bold">setCurHP</span>]](Q5IT[i], [[Engine Function:_getCurHP|<span style="color:#FF0000;font-weight:bold">getCurHP</span>]](Q5IT[i]) - damage);
 
       [[Engine Function:_setCurHP|<span style="color:#FF0000;font-weight:bold">setCurHP</span>]](Q5IT[i], [[Engine Function:_getCurHP|<span style="color:#FF0000;font-weight:bold">getCurHP</span>]](Q5IT[i]) - damage);
 
     }
 
     }

Latest revision as of 21:22, 18 October 2018

trigger message("trapCheck")
{
  list Q5IT;
  int damage;
  if (!hasObjVar(this, "disarmed"))
  {
    getPlayersInRange(Q5IT, getLocation(this), 0x03);
    for(int i = 0x00; i < numInList(Q5IT); i++)
    {
      damage = dice(0x03, 0x05);
      setCurHP(Q5IT[i], getCurHP(Q5IT[i]) - damage);
    }
  }
  return (0x00);
}
trigger message("PPdisarm")
{
  int Q5DQ;
  if (!hasObjVar(this, "disarmed"))
  {
    setObjVar(this, "disarmed", Q5DQ);
  }
  return (0x00);
}
trigger message("PPreload")
{
  if (hasObjVar(this, "disarmed"))
  {
    removeObjVar(this, "disarmed");
  }
  return (0x00);
}