In trainSkill.inc after the vendor has determined that you can be trained in a particular skill and has accepted your gold the script uses a strange construct (strange to me anyway) to set the skill. Can someone explain why the following code is used rather than SetAttributeBaseValue?
I could also use an explanation of what exactly is happening there too if you don't mind.
Code: Select all
var pid := getprocess(GetObjProperty(who, "cap_pid"));
var k := struct;
k.+skid := attributeid;
k.+type := EVID_SKILLCAP;
k.+base := new_level;
pid.sendevent(k);
DoRecalcVitals(who);