Difference between revisions of "Script: Dec1 floor blade"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> message(<span style="color:#800000">"saws_on"</span>) { <span style=...")
 
 
Line 16: Line 16:
 
   <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"armed"</span>))
 
   <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"armed"</span>))
 
   {
 
   {
     [[Engine Function:_loseHP|<span style="color:#FF0000;font-weight:bold">loseHP</span>]](target, [[dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x0A, 0x14));
+
     [[Engine Function:_loseHP|<span style="color:#FF0000;font-weight:bold">loseHP</span>]](target, [[Engine Function:_dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x0A, 0x14));
 
   }
 
   }
 
   <span style="color:#0000FF">return</span> (0x01);
 
   <span style="color:#0000FF">return</span> (0x01);
Line 31: Line 31:
 
       <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"armed"</span>))
 
       <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"armed"</span>))
 
       {
 
       {
         [[Engine Function:_loseHP|<span style="color:#FF0000;font-weight:bold">loseHP</span>]](Q67G[i], [[dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x0A, 0x14));
+
         [[Engine Function:_loseHP|<span style="color:#FF0000;font-weight:bold">loseHP</span>]](Q67G[i], [[Engine Function:_dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x0A, 0x14));
 
       }
 
       }
 
     }
 
     }

Latest revision as of 22:30, 18 October 2018

inherits globals;
trigger message("saws_on")
{
  if (!hasObjVar(this, "armed"))
  {
    setType(this, 0x11B2);
    setObjVar(this, "armed", 0x01);
    callback(this, 0x01, 0x24);
  }
  return (0x00);
}
trigger enterrange(0x01)
{
  if (hasObjVar(this, "armed"))
  {
    loseHP(target, dice(0x0A, 0x14));
  }
  return (0x01);
}
trigger callback(0x24)
{
  list Q67G;
  getPlayersInRange(Q67G, getLocation(this), 0x01);
  if (!numInList(Q67G) == 0x00)
  {
    for(int i = 0x00; i < numInList(Q67G); i++)
    {
      if (hasObjVar(this, "armed"))
      {
        loseHP(Q67G[i], dice(0x0A, 0x14));
      }
    }
    callback(this, 0x01, 0x24);
    return (0x00);
  }
  clearList(Q67G);
  getPlayersInRange(Q67G, getLocation(this), 0x1E);
  if (numInList(Q67G) == 0x00)
  {
    setType(this, 0x11B1);
    if (hasObjVar(this, "armed"))
    {
      removeObjVar(this, "armed");
    }
  }
  else
  {
    callback(this, 0x01, 0x24);
  }
  return (0x00);
}