Skip to content

Commit

Permalink
added pickpocket check to prevent pickpocket xp from creatures that d…
Browse files Browse the repository at this point in the history
…ont have pickpocketable items
  • Loading branch information
b5635 committed Sep 22, 2023
1 parent 4cdfc06 commit 2d1721e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/nss/ai_onspawn.nss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void GeneratePickpocketItem(string sType = "")
object oItem = GenerateTierItem(GetHitDice(OBJECT_SELF), GetLocalInt(GetArea(OBJECT_SELF), "area_cr"), OBJECT_SELF, sType);
SetDroppableFlag(oItem, FALSE);
SetPickpocketableFlag(oItem, TRUE);
SetLocalInt(OBJECT_SELF, "pickpocket_xp", 1);
}

//const int GS_TIMEOUT = 7200; //2 hours
Expand Down
6 changes: 5 additions & 1 deletion src/nss/on_pc_skilla.nss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ void main()
IncrementPlayerStatistic(OBJECT_SELF, "pickpockets_succeeded");

object oTarget = StringToObject(NWNX_Events_GetEventData("TARGET_OBJECT_ID"));
GiveSkillXP(oTarget, OBJECT_SELF, "Pick Pocketing");
if (GetLocalInt(oTarget, "pickpocket_xp") == 1)
{
GiveSkillXP(oTarget, OBJECT_SELF, "Pickpocketing");
DeleteLocalInt(oTarget, "pickpocket_xp");
}
}
else
{
Expand Down

0 comments on commit 2d1721e

Please sign in to comment.