Script Function: Q65E

From Ultima Online: The Second Age
Jump to: navigation, search
 function int Q65E(obj user)
 {
   loc Q4VS = getLocation(user);
   loc there = getLocation(this);
   loc Q62J = getLocation(user);
   obj Q47F = getBackpack(user);
   if (isAtHome(this))
   {
     systemMessage(user, "You can't ignite that, it belongs to someone else.");
     return (0x00);
   }
   if (isInContainer(this))
   {
     if (!findGoodSpotNearWithElev(Q62J, getZ(Q4VS) - 0x08, getZ(Q4VS) + 0x08, 0x02, 0x02, 0x01))
     {
       systemMessage(user, "There is not a spot nearby to place your campfire.");
       return (0x00);
     }
   }
   else
   {
     Q62J = there;
   }
   if (!testSkill(user, 0x0A))
   {
     barkTo(this, user, "You fail to ignite the campfire.");
     return (0x00);
   }
   obj fire = createGlobalObjectAt(0x0DE3, Q62J);
   setObjVar(fire, "campfire_burning", 0x01);
   attachScript(fire, "campfire");
   destroyOne(this);
   if (!isInContainer(this))
   {
     if (canHold(Q47F, this))
     {
       int Q4Q1 = putObjContainer(this, Q47F);
     }
     else
     {
       deleteObject(this);
     }
   }
   return (0x00);
 }