Trying to make a script that adds +skill points

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

Moderator: POL Developer

Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Trying to make a script that adds +skill points

Post by Poi »

So I am trying to make a piece of jewelry that when equiped adds points to a skill and when removed gets rid of the points..
Ran into a few problems, but first off here is my equip script:

Code: Select all

use uo;
use os;
use cfgfile;

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

program equipcraftingjewel(who, item)

var skilladd := getobjproperty(item, "skill");

if(skilladd)
var skill := "SKILLID_" + upper(skilladd);
var addskill:= AwardRawSkillPoints(who, SKILLID_TAILORING, 200);
sendsysmessage(who, addskill);
endif

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

endprogram
So #1:
The var skill returns SKILLID_TAILORING (I have the prop skill set to tailoring on the item)
but when I try to do this: AwardRawSkillPoints(who, skill, 200);
it doesn't do anything, doesn't return any errors or anything either =/
So I need to figure out why that isn't working, any help is greatly appreciated :)


Now #2:
When I use AwardRawSkillPoints, it does not allow it to go past 100, so I need a way to let it go past 100 :)




Now for the unequip script:

Code: Select all

use uo;
use os;
use cfgfile;

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

program unequipcraftingjewel(who, item)

var skilladd := getobjproperty(item, "skill");

if(skilladd)
var skill := "SKILLID_" + upper(skilladd);
var amt := "-200";
Sendsysmessage(who, AwardRawSkillPoints(who, SKILLID_TAILORING, amt));
endif

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

endprogram
The only problem I have right now is it doesn't subtract the skill, is there some sort of removeskillpoints function?
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Trying to make a script that adds +skill points

Post by RusseL »

You should use:

SetAttributeTemporaryMod(who, attrname, skill_adj);
Post Reply