//////////////////////////////////////////////////////////////////////////////// //: //: Script: it_shrp_stn_add (Item Sharpening Stone Add Property) //: //: Date: 7.31.12 //: //: Created By: Birdman076 //: //: Use: This script will keep track of a quasi-skill called "Sharpening" //: as the "skill" int is incremented the ability will improve for sharpening //: weapons and will become permanent over a period of 500+ uses //: //: Associated Scripts: it_sharpeningsto (tag based script to activate conversation //: Associated Files: Conversation File "sharpening_stone" //: //////////////////////////////////////////////////////////////////////////////// #include "x2_inc_itemprop" void main() { object oItem; itemproperty ipAdd; // Get the PC who is in this conversation. object oPC = GetPCSpeaker(); // Get the DB item the player has in inventory object oDatabase = GetItemPossessedBy(oPC,"Database"); // Get the skill on the DB item. int nSkill = GetLocalInt(oDatabase, "sharpening_skill"); // Increment the skill on the DB item by 1 nSkill = nSkill+1; SetLocalInt(oPC, "sharpening_skill", nSkill); // Make sure the skill is greater then 0. (sanity check) if (nSkill) { // We at least have a skill, //Take care of the things that always happen at this point. oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC); SetPlotFlag(oItem, TRUE); SetStolenFlag(oItem, TRUE); ipAdd = ItemPropertyKeen(); // calculate the duration float nDur; if (nSkill > 500)nDur = 0.0; else nDur = (nSkill / 100) * 600.0; // Add the property IPSafeAddItemProperty(oItem, ipAdd, nDur); } }