Difference between revisions of "Script: Trap mushroom"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">trigger</span> enterrange(0x02) { <span style="color:#0000FF">if</span> (<span style="color:#FF0000;font-weight:bold">isDead</span>...")
 
 
Line 10: Line 10:
 
     [[Engine Function:_callback|<span style="color:#FF0000;font-weight:bold">callback</span>]](this, 0x02, 0x01);
 
     [[Engine Function:_callback|<span style="color:#FF0000;font-weight:bold">callback</span>]](this, 0x02, 0x01);
 
     [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), 0x1126, 0x03, 0x09, 0x00, 0x00);
 
     [[Engine Function:_doLocAnimation|<span style="color:#FF0000;font-weight:bold">doLocAnimation</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](this), 0x1126, 0x03, 0x09, 0x00, 0x00);
     [[Engine Function:_loseHP|<span style="color:#FF0000;font-weight:bold">loseHP</span>]](target, [[dice|<span style="color:#FF0000;font-weight:bold">dice</span>]](0x02, 0x04));
+
     [[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>]](0x02, 0x04));
 
   }
 
   }
 
   <span style="color:#0000FF">return</span> (0x01);
 
   <span style="color:#0000FF">return</span> (0x01);

Latest revision as of 22:20, 18 October 2018

trigger enterrange(0x02)
{
  if (isDead(target))
  {
    return (0x01);
  }
  if (!hasObjVar(this, "working"))
  {
    setObjVar(this, "working", 0x01);
    callback(this, 0x02, 0x01);
    doLocAnimation(getLocation(this), 0x1126, 0x03, 0x09, 0x00, 0x00);
    loseHP(target, dice(0x02, 0x04));
  }
  return (0x01);
}
trigger callback(0x01)
{
  if (hasObjVar(this, "working"))
  {
    removeObjVar(this, "working");
  }
  return (0x00);
}