void main() { if (GetTag(GetItemActivated()) == "ohswhtkeygen") { object oTarget = GetItemActivatedTarget(); if (!GetIsObjectValid(oTarget)) return; // Apply effects AssignCommand(oTarget, ClearAllActions()); CreateItemOnObject("ohstowerkey", oTarget); CreateItemOnObject("whiteapprentice", oTarget); } }