Skill Increase/Descrease.

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Skill Increase/Descrease.

Post by Damien »

Hello, I got a problem.
I will thank the people who helped me this far.

Ok, I was creating a "anatomy ring" who gives +10 in anatomy.
But when i unequip the ring, my anatomy still is 110.

So how should i do so those +10 anatomy dissapears? :O

This is the codes i got in Equip.inc, Unequip.src, Anatomy.src and Itemdesc.

Code: Select all

EQUIP.INC
/////////////////////////////////////////////////
  case(type)
    "accuracy":     val := accuracy(who,item);
    "cursed":       val := cursed(who,item);
    "sight":        val := sight(who,item);
    "reflect":      val := reflect(who,item);
    "protection":   val := protection(who,item);
    "wizzohat":     val := wizzohat(who,item);
    "strength":     val := strength(who,item);
    "invisibility": val := invisibility(who,item);
    "anatomy":      val := anatomy(who,item);
    default:        val := 1;
  endcase

-----------------------------------------------------

function anatomy(who,item)
  var amt := CInt(GetObjProperty(item,"type"));
  if((!amt) || (amt == 0))
    amt := 5;
  endif
  var cfg := ReadConfigFile(":combat:itemdesc");
  var attrib := cfg[item.objtype].Attribute;
  case(attrib)
    "Anatomy":      ModifyAttributeTemporaryMod(who, ATTRIBUTEID_ANATOMY,  amt);
  endcase
  SetObjProperty(item, "#equipped", who.serial);
  return 1;
endfunction

////////////////////////////////////////////////////////
//////////////////UNEQUIP.SRC/////////////////////
///////////////////////////////////////////////////

  case(type)
    "accuracy":     val := accuracy(who,item);
    "cursed":       val := cursed(who,item);
    "sight":        val := sight(who,item);
    "reflect":      val := reflect(who,item);
    "protection":   val := protection(who,item);
    "wizzohat":     val := wizzohat(who,item);
    "strength":     val := strength(who,item);
    "invisibility": val := invisibility(who, item);
    "anatomy":      val := anatomy(who, item);
     default:        val := 1;
  endcase

------------------------------------------------------

function anatomy(who,item)
  if(GetObjProperty(item, "#equipped") == who.serial)
    var amt := CInt(GetObjProperty(item,"type"));
    amt := (0 - amt);
    if((!amt) || (amt == 0))
      amt := (0 - 5);
    endif
    var cfg := ReadConfigFile(":combat:itemdesc");
    var attrib := cfg[item.objtype].Attribute;
    case(attrib)
      "anatomy":      ModifyAttributeTemporaryMod(who, ATTRIBUTEID_ANATOMY,  amt);
    endcase
    EraseObjProperty(item, "#equipped");
    return 1;
  else
    return 1;
  endif

endfunction

///////////////////////////////////////////////////////
///////////////ANATOMY.SRC/////////////////////////
///////////////////////////////////////////////////

use uo;
use os;
use cfgfile;

include "include/client";
include "include/attributes";
include "equip";

program finring(who, item)

SetAttributeTemporaryMod( who, ATTRIBUTEID_ANATOMY, 100 );

  var val := HandleMods(who, item);
  return val;
endprogram

///////////////////////////////////////////////////////
/////////////////ITEMDESC///////////////////////////
/////////////////////////////////////////////////////

Item  0x9030
{
    Name            Anatomy Ring 
    Desc             Anatomy ring 
    Graphic         0x108a 
    VendorSellsFor  150000 
    VendorBuysFor   50000 
    maxhp           20 
    dyeable         0 
    equipscript     :combat:anatomy 
    unequipscript   :combat:unequip
    controlscript   :combat:itemControl 
    destroyscript   :combat:destroy    
    cprop type sanatomy
} 

/////////////////////////THE END/////////////////////////
I appreciate all help :)
Thanks.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO »

unequipscript :combat:unequip
that would be where you remove it.
Ultimate`
New User
Posts: 23
Joined: Fri Jul 07, 2006 9:54 pm

Post by Ultimate` »

That's a good script.. I actually want to make one too but I'm new so I need tons of help lol. Couldn't you just make it so in the UnEquip script you minus the temp attribute to anatomy?
Beliyp
New User
Posts: 1
Joined: Mon Jun 29, 2009 1:50 pm

Re:

Post by Beliyp »

CWO wrote:
unequipscript :combat:unequip
that would be where you remove it.
Help Please!!!! :( :( :( :(
Post Reply