Exemple #1
0
FUNCTION void Q4E8(obj user, obj Q66M, int Q4QY, string name)
{
  if(isAtHome(this))
  {
    systemMessage(user, "You can't use that, it belongs to someone else.");
    return;
  }
  int Q66P = getObjType(Q66M);
  if(Q4Z2(Q66P))
  {
    if(!testSkill(user, 0x0D))
    {
      systemMessage(user, "You burn the food to a crisp! It's ruined.");
      destroyOne(this);
      return;
    }
    if(name != "default")
    {
      if(hasObjVar(this, "NAME"))
      {
        removeObjVar(this, "NAME");
        setObjVar(this, "NAME", name);
      }
    }
    if(random(0x00, 0x01))
    {
      barkTo(user, user, "Looks delicious.");
    }
    else
    {
      barkTo(user, user, "Mmmm, smells good.");
    }
    obj Q47F = getBackpack(user);
    int Q4TM;
    obj Q5CN = createGlobalObjectOn(this, Q4QY);
    if(!isInContainer(this))
    {
      if(canHold(Q47F, Q5CN))
      {
        Q4TM = putObjContainer(Q5CN, Q47F);
        systemMessage(user, "You put the cooked food into your backpack.");
      }
      else
      {
        Q4TM = teleport(Q5CN, getLocation(user));
        systemMessage(user, "You put the cooked food on the ground.");
      }
    }
    destroyOne(this);
  }
  else
  {
    systemMessage(user, "You can't cook on that.");
  }
  return;
}
Exemple #2
0
void CDttSP::process()
{
	while (m_running) {
		m_buffer->Wait();

		while (canHold()) {
			getHold();

			m_update->Wait();

			switch (m_state) {
				case RUN_PLAY:
					runPlay();
					break;
				case RUN_SWITCH:
					runSwitch();
					break;
			}

			m_update->Post();
		}
	}
}
Exemple #3
0
FUNCTION int Q659(obj user)
{
  int Q62A = getObjType(this);
  if(hasObjVar(this, "fuel"))
  {
    int fuel = getObjVar(this, "fuel");
  }
  switch(Q62A)
  {
  case 0x0A26:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x0B1A);
    break;
  case 0x0A27:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x0B1D);
    break;
  case 0x0A29:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x0B26);
    break;
  case 0x1853:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x1854);
    break;
  case 0x1857:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x1858);
    break;
  case 0x1849:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x184A);
    break;
  case 0x184D:
    setObjVar(this, "burning", 0x01);
    setType(this, 0x184E);
    break;
  case 0x0A28:
    int Q527;
    obj Q47F = getBackpack(user);
    obj Q5BO = requestCreateObjectAt(0x0A0F, getLocation(user));
    setObjVar(this, "fuel", 0x64);
    setObjVar(Q5BO, "burning", 0x01);
    attachscript(Q5BO, "torch");
    callback(Q5BO, 0x1E, 0x39);
    if(!isInContainer(this))
    {
      Q527 = teleport(Q5BO, getLocation(this));
      if(getQuantity(this) > 0x01)
      {
        destroyOne(this);
        if(canHold(Q47F, this))
        {
          systemMessage(user, "You put the remaining unlit candles into your backpack.");
          Q527 = putObjContainer(this, Q47F);
        }
        else
        {
          systemMessage(user, "You put the remaining unlit candles at your feet.");
          Q527 = teleport(this, getLocation(user));
        }
      }
    }
    else
    {
      destroyOne(this);
      if(getItemAtSlot(user, 0x02) != NULL())
      {
        systemMessage(user, "You cannot hold the candle, so it has been placed at your feet.");
      }
      else
      {
        Q527 = equipObj(Q5BO, user, 0x02);
        systemMessage(user, "You put the candle in your left hand.");
      }
    }
    if(getQuantity(this) == 0x01)
    {
      destroyOne(this);
    }
    break;
  case 0x0F64:
  case 0x0F6B:
    Q47F = getBackpack(user);
    obj Q5CB = requestCreateObjectAt(0x0A12, getLocation(user));
    setObjVar(this, "fuel", 0x64);
    setObjVar(Q5CB, "burning", 0x01);
    attachscript(Q5CB, "torch");
    callback(Q5CB, 0x1E, 0x39);
    if(!isInContainer(this))
    {
      Q527 = teleport(Q5CB, getLocation(this));
      if(getQuantity(this) > 0x01)
      {
        destroyOne(this);
        if(canHold(Q47F, this))
        {
          systemMessage(user, "You put the remaining unlit torches into your backpack.");
          Q527 = putObjContainer(this, Q47F);
        }
        else
        {
          systemMessage(user, "You put the remaining unlit torches at your feet.");
          Q527 = teleport(this, getLocation(user));
        }
      }
    }
    else
    {
      destroyOne(this);
      if(getItemAtSlot(user, 0x02) != NULL())
      {
        systemMessage(user, "You cannot hold the torch, so it has been placed at your feet.");
      }
      else
      {
        Q527 = equipObj(Q5CB, user, 0x02);
        systemMessage(user, "You put the torch in your left hand.");
      }
    }
    if(getQuantity(this) == 0x01)
    {
      destroyOne(this);
    }
    break;
  case 0x0A18:
  case 0x0A1D:
  case 0x0A25:
    if(fuel > 0x00)
    {
      setObjVar(this, "burning", 0x01);
      callback(this, 0x1E, 0x39);
      setType(this, Q62A - 0x03);
    }
    else
    {
      systemMessage(user, "The lantern is out of fuel.");
    }
    break;
  default:
    return(0x00);
    break;
  }
  sfx(getLocation(this), 0x47, 0x00);
  return(0x01);
}