Script Function: Q4LV

From Ultima Online: The Second Age
Revision as of 22:27, 11 October 2018 by Grimoric (talk | contribs) (Created page with " <span style="color:#0000FF">function</span> <span style="color:#0000FF">int</span> Q4LV(<span style="color:#0000FF">obj</span> user, <span style="color:#0000FF">obj</span> u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 function int Q4LV(obj user, obj usedon)
 {
   int Q5NC = 0x00;
   if (Q50G(usedon))
   {
     int Q4NC;
     int defenseBonus;
     loc Q4VS = getLocation(user);
     loc there = getLocation(usedon);
     faceHere(user, getDirectionInternal(Q4VS, there));
     if (!hasScript(usedon, "remprtct"))
     {
       doMobAnimation(usedon, 0x375A, 0x09, 0x14, 0x00, 0x00);
       sfx(there, 0x01ED, 0x00);
       if (hasObjVar(this, "magicItemModifier"))
       {
         int Q52W = getObjVar(this, "magicItemModifier");
         Q4NC = 0x06 * Q52W;
         defenseBonus = 0x07;
       }
       else
       {
         defenseBonus = (getSkillLevel(user, 0x19) / 0x0A);
         Q4NC = 0x06 * getSkillLevel(user, 0x19) / 0x05;
       }
       setNaturalAC(usedon, getNaturalAC(usedon) + defenseBonus);
       setObjVar(usedon, "defenseBonus", defenseBonus);
       attachScript(usedon, "remprtct");
       int Q527 = Q41J(user, usedon, 0x00, this);
       callback(usedon, Q4NC, 0x13);
       Q5NC = 0x01;
     }
   }
   Q5UQ(this);
   return (Q5NC);
 }