Difference between revisions of "Script: Range"
From Ultima Online: The Second Age
(Created page with " <span style="color:#0000FF">trigger</span> enterrange(0x03) { <span style="color:#0000FF">int</span> actret = 0x01; <span style="color:#0000FF">if</span> (isPlayer|<...") |
|||
Line 6: | Line 6: | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"actret"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"actret"</span>)) | ||
{ | { | ||
− | actret = [[ | + | actret = [[Engine_Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"actret"</span>); |
} | } | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"acttext"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"acttext"</span>)) | ||
{ | { | ||
− | <span style="color:#0000FF">string</span> acttext = [[ | + | <span style="color:#0000FF">string</span> acttext = [[Engine_Function:_getobjvar_str|<span style="color:#FF0000;font-weight:bold">getobjvar_str</span>]](this, <span style="color:#800000">"acttext"</span>); |
[[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, acttext); | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, acttext); | ||
} | } | ||
Line 25: | Line 25: | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deactret"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deactret"</span>)) | ||
{ | { | ||
− | deactret = [[ | + | deactret = [[Engine_Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"deactret"</span>); |
} | } | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deacttext"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deacttext"</span>)) | ||
{ | { | ||
− | <span style="color:#0000FF">string</span> deacttext = [[ | + | <span style="color:#0000FF">string</span> deacttext = [[Engine_Function:_getobjvar_str|<span style="color:#FF0000;font-weight:bold">getobjvar_str</span>]](this, <span style="color:#800000">"deacttext"</span>); |
[[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, deacttext); | [[Engine Function:_bark|<span style="color:#FF0000;font-weight:bold">bark</span>]](this, deacttext); | ||
} | } | ||
Line 42: | Line 42: | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"act"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"act"</span>)) | ||
{ | { | ||
− | <span style="color:#0000FF">int</span> act = [[ | + | <span style="color:#0000FF">int</span> act = [[Engine_Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"act"</span>); |
Q69E = [[Engine Function:_changeRange|<span style="color:#FF0000;font-weight:bold">changeRange</span>]](this, 0x00, 0x03, act); | Q69E = [[Engine Function:_changeRange|<span style="color:#FF0000;font-weight:bold">changeRange</span>]](this, 0x00, 0x03, act); | ||
} | } | ||
<span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deact"</span>)) | <span style="color:#0000FF">if</span> ([[Engine Function:_hasObjVar|<span style="color:#FF0000;font-weight:bold">hasObjVar</span>]](this, <span style="color:#800000">"deact"</span>)) | ||
{ | { | ||
− | <span style="color:#0000FF">int</span> deact = [[ | + | <span style="color:#0000FF">int</span> deact = [[Engine_Function:_getobjvar_int|<span style="color:#FF0000;font-weight:bold">getobjvar_int</span>]](this, <span style="color:#800000">"deact"</span>); |
Q69E = [[Engine Function:_changeRange|<span style="color:#FF0000;font-weight:bold">changeRange</span>]](this, 0x01, 0x03, deact); | Q69E = [[Engine Function:_changeRange|<span style="color:#FF0000;font-weight:bold">changeRange</span>]](this, 0x01, 0x03, deact); | ||
} | } |
Latest revision as of 02:43, 21 October 2018
trigger enterrange(0x03) { int actret = 0x01; if (isPlayer(target)) { if (hasObjVar(this, "actret")) { actret = getobjvar_int(this, "actret"); } if (hasObjVar(this, "acttext")) { string acttext = getobjvar_str(this, "acttext"); bark(this, acttext); } processTriggerCmds(this, "a"); } return (actret); }
trigger leaverange(0x03) { int deactret = 0x01; if (isPlayer(target)) { if (hasObjVar(this, "deactret")) { deactret = getobjvar_int(this, "deactret"); } if (hasObjVar(this, "deacttext")) { string deacttext = getobjvar_str(this, "deacttext"); bark(this, deacttext); } processTriggerCmds(this, "d"); } return (deactret); }
function void Q5RH(obj this) { int Q69E; if (hasObjVar(this, "act")) { int act = getobjvar_int(this, "act"); Q69E = changeRange(this, 0x00, 0x03, act); } if (hasObjVar(this, "deact")) { int deact = getobjvar_int(this, "deact"); Q69E = changeRange(this, 0x01, 0x03, deact); } return; }
trigger creation { Q5RH(this); return (0x00); }
trigger objectloaded { Q5RH(this); return (0x00); }