Difference between revisions of "Script Function: postKillerToBB"

From Ultima Online: The Second Age
Jump to: navigation, search
(Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> postKillerToBB(<span style="color:#0000FF">obj</span> killer) { <span style="color:#00...")
(No difference)

Revision as of 09:11, 21 October 2018

function void postKillerToBB(obj killer)
{
  if (!hasObjListVar(killer, "killcount"))
  {
    detachScript(this, "bounty");
    return ();
  }
  list Q51M;
  getObjListVar(Q51M, killer, "killcount");
  obj Q47Z = findClosestBBoard(getLocation(this));
  obj Q58D;
  Q58D = Q5K6(Q47Z, killer);
  if (Q58D == NULL())
  {
    Q58D = createNoResObjectIn(0x0EB0, Q47Z);
  }
  setObjVar(Q58D, "killer", killer);
  obj bank = getItemAtSlot(killer, 0x1D);
  obj Q5NR = doTakeMoney(bank, 0x0EED, 0xC350);
  if (Q5NR == NULL())
  {
    if (0x00)
    {
      bark(killer, "NULL reward!");
    }
  }
  string reward = "alas, zero";
  if (Q5NR != NULL())
  {
    int Q48S = teleport(Q5NR, getLocation(killer));
    int Q463;
    int blah = getResource(Q463, Q5NR, "gold", 0x03, 0x02);
    if (0x00)
    {
      reward = Q463;
      systemMessage(killer, "Gold resource from bank:");
      systemMessage(killer, reward);
    }
    transferResources(Q58D, Q5NR, Q463, "gold");
    if (0x00)
    {
      blah = getResource(Q463, Q5NR, "gold", 0x03, 0x02);
      reward = Q463;
      systemMessage(killer, "Gold resource on gold after transfer:");
      systemMessage(killer, reward);
    }
    blah = getResource(Q463, Q58D, "gold", 0x03, 0x02);
    if (0x00)
    {
      reward = Q463;
      systemMessage(killer, "Gold resource from board:");
      systemMessage(killer, reward);
    }
    reward = Q463;
    if (0x00)
    {
      bark(killer, "reward!");
      bark(killer, reward);
    }
    deleteObject(Q5NR);
  }
  string Q5Y5;
  string Q5Y6;
  string Q67E;
  string Q67F;
  switch (random(0x00, 0x05))
  {
  case 0x00
  default
    Q5Y5 = "Bounty for ";
    Q5Y6 = "!";
    break;
  case 0x01
    Q5Y5 = "";
    Q5Y6 = " must die!";
    break;
  case 0x02
    Q5Y5 = "A price on ";
    Q5Y6 = "!";
    break;
  case 0x03
    Q5Y5 = "";
    Q5Y6 = " outlawed!";
    break;
  case 0x04
    Q5Y5 = "Execute ";
    Q5Y6 = "!";
    break;
  case 0x05
    Q5Y5 = "WANTED: ";
    Q5Y6 = "!";
    break;
  }
  Q67E = Q51M[random(0x00, numInList(Q51M) - 0x01)];
  Q67F = Q51M[random(0x00, numInList(Q51M) - 0x01)];
  int Q600 = Q4S2(killer);
  string dead = Q600;
  list postText = Q5Y5 + getName(killer) + Q5Y6, "  The foul scum known as", getName(killer), Q4RY(killer), "For " + getHeShe(killer) + " is guilty of " + dead, "murders, among them those", "of " + Q67E + " and ", Q67F + ".", Q4J2(killer), "of " + reward + " gold pieces", "for " + getHisHer(killer) + " head!", "  A description:", "    - " + Q4RW(killer) + " hair", "    - " + Q4RX(killer), "    - " + Q4SU(killer) + " skin", "  If you kill " + getHimHer(killer) + ", bring the", "head to a guard here in this", "city to claim your reward.";
  setObjVar(Q58D, "postText", postText);
  return ();
}