Difference between revisions of "Script: Bountytest"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">inherits</span> globals; <span style="color:#0000FF">trigger</span> lookedat { <span style="color:#0000FF">if</span> (!hasObjVar|<span...") |
|||
Line 52: | Line 52: | ||
<span style="color:#0000FF">list</span> args = player, 0x029A, 0x00, Q5IU; | <span style="color:#0000FF">list</span> args = player, 0x029A, 0x00, Q5IU; | ||
[[Engine Function:_message|<span style="color:#FF0000;font-weight:bold">message</span>]](bountyInfo, <span style="color:#800000">"addBounty"</span>, args); | [[Engine Function:_message|<span style="color:#FF0000;font-weight:bold">message</span>]](bountyInfo, <span style="color:#800000">"addBounty"</span>, args); | ||
− | <span style="color:#0000FF">int</span> Q4Q1 = [[ | + | <span style="color:#0000FF">int</span> Q4Q1 = [[Engine Function:_teleport|<span style="color:#FF0000;font-weight:bold">teleport</span>]](bountyInfo, [[Engine Function:_getRelayLoc|<span style="color:#FF0000;font-weight:bold">getRelayLoc</span>]](player)); |
<span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](bountyInfo)) | <span style="color:#0000FF">if</span> ([[Engine Function:_isValid|<span style="color:#FF0000;font-weight:bold">isValid</span>]](bountyInfo)) | ||
{ | { |
Latest revision as of 07:42, 19 October 2018
inherits globals;
trigger lookedat { if (!hasObjVar(this, "bountyPlayer")) { return (0x01); } obj player = getObjVar(this, "bountyPlayer"); barkTo(this, looker, "RelayLoc=" + getRelayLoc(player)); return (0x00); }
trigger targetobj { if (usedon == NULL()) { removeObjVar(this, "bountyPlayer"); removeObjVar(this, "bountyPlayerName"); return (0x00); } if (!isPlayer(usedon)) { removeObjVar(this, "bountyPlayer"); removeObjVar(this, "bountyPlayerName"); return (0x00); } systemMessage(user, getName(usedon) + " selected."); setObjVar(this, "bountyPlayer", usedon); setObjVar(this, "bountyPlayerName", getName(usedon)); return (0x00); }
trigger use { obj player = user; if (!hasObjVar(this, "bountyPlayer")) { systemMessage(user, "Select player to bounty:"); targetObj(user, this); return (0x00); } string Q5IU = "PD BugKiller"; if (hasObjVar(this, "bountyPlayerName")) { Q5IU = getObjVar(this, "bountyPlayerName"); } systemMessage(user, "creating bounty for (" + objtoint(player) + "."); obj bountyInfo = createNoResObjectAt(0x01, getLocation(user)); setObjVar(bountyInfo, "subject", player); attachScript(bountyInfo, "bountyinfo"); list args = player, 0x029A, 0x00, Q5IU; message(bountyInfo, "addBounty", args); int Q4Q1 = teleport(bountyInfo, getRelayLoc(player)); if (isValid(bountyInfo)) { clearList(args); message(bountyInfo, "teleported", args); } args = getAdjFame(user); systemMessage(user, "MurderReport: Messaging via probe to " + objtoint(user) + "."); Q56V(player, "murderReport", args); obj head = createNoResObjectIn(0x1DA0, getBackpack(user)); setObjVar(head, "nameVar", Q5IU); setObjVar(head, "controller", player); return (0x00); }