Skip to content

Commit

Permalink
moved party function into a shared library, implemented stealth, anim…
Browse files Browse the repository at this point in the history
…al empathy, pickpocket, and dialogue skill xp

closes #630
closes #239
  • Loading branch information
b5635 committed Sep 22, 2023
1 parent d4b9784 commit 4cdfc06
Show file tree
Hide file tree
Showing 35 changed files with 430 additions and 178 deletions.
5 changes: 5 additions & 0 deletions src/nss/ai_onheartb.nss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ void main()

int nCombat = GetIsInCombat(OBJECT_SELF);

if (!nCombat && !GetHasFeat(FEAT_KEEN_SENSE) && !GetHasFeat(FEAT_BLINDSIGHT_60_FEET))
{
SetActionMode(OBJECT_SELF, ACTION_MODE_DETECT, TRUE);
}

object oPC = GetFirstPC();

int bEnemyPCSeen = FALSE;
Expand Down
5 changes: 5 additions & 0 deletions src/nss/ai_onspawn.nss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ void main()
//set action matrix
gsAISetActionMatrix(gsAIGetDefaultActionMatrix());

if (!GetHasFeat(FEAT_KEEN_SENSE) && !GetHasFeat(FEAT_BLINDSIGHT_60_FEET))
{
SetActionMode(OBJECT_SELF, ACTION_MODE_DETECT, TRUE);
}

//set random facing
//SetFacing(IntToFloat(Random(360)));

Expand Down
5 changes: 4 additions & 1 deletion src/nss/dlg_adventp1c.nss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "inc_adv_assassin"
#include "inc_ai_combat"
#include "inc_ctoken"
#include "inc_xp"

string GenerateInsult(object oPC)
{
Expand Down Expand Up @@ -168,8 +169,10 @@ int StartingConditional()

if (GetScriptParam("pcintimidate") != "")
{
if (GetIsSkillSuccessful(oPC, SKILL_INTIMIDATE, 18 + GetHitDice(OBJECT_SELF)))
int nDC = 18 + GetHitDice(OBJECT_SELF);
if (GetIsSkillSuccessful(oPC, SKILL_INTIMIDATE, nDC))
{
GiveDialogueSkillXP(oPC, nDC, SKILL_INTIMIDATE);
sMessage = "You know, I think " + (nAdventurerPartySize > 1 ? "we" : "I") + " might have bitten off a bit more than " + (nAdventurerPartySize > 1 ? "we" : "I") + " can chew this time. Farewell... for now.";
SetCustomToken(CTOKEN_ADVENTURER_DIALOGUE, sMessage);
int i;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_avista_pers.nss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "inc_gold"
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -20,6 +21,7 @@ int StartingConditional()
}
else
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
TakeGoldFromCreature(nCost, oPC, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_bluf_chk.nss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -15,6 +16,7 @@ int StartingConditional()
}
else
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
return TRUE;
}
Expand Down
3 changes: 3 additions & 0 deletions src/nss/dlg_chk_bluf.nss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

// Bluff against bluff_dc local variable, offer 1 attempt per 15min
// set script param "dc" to use that instead

Expand All @@ -26,6 +28,7 @@ int StartingConditional()
SetTemporaryInt(GetPCPublicCDKey(oPC, TRUE)+GetName(oPC)+"_"+GetTag(OBJECT_SELF)+"_bluf", 1, 900.0);
return FALSE;
}
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
return TRUE;
}
4 changes: 3 additions & 1 deletion src/nss/dlg_chk_blufrob.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "inc_persist"
#include "inc_xp"

// Bluff against bluff_dc local variable, offer 1 attempt per 15min
// set script param "dc" to use that instead

Expand All @@ -19,7 +21,7 @@ int StartingConditional()
{
return FALSE;
}

GiveDialogueSkillXP(oPC, nDC, nSkill);
int nGold = StringToInt(GetScriptParam("gold"));

GiveGoldToCreature(oPC, nGold);
Expand Down
3 changes: 3 additions & 0 deletions src/nss/dlg_chk_inti.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "inc_persist"
#include "inc_xp"

// Intimidate against intimidate_dc local variable, offer 1 attempt per 15min
// set script param "dc" to use that instead

Expand All @@ -21,5 +23,6 @@ int StartingConditional()
return FALSE;
}

GiveDialogueSkillXP(oPC, nDC, nSkill);
return TRUE;
}
3 changes: 3 additions & 0 deletions src/nss/dlg_chk_inticrim.nss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "inc_xp"

//#include "inc_general"
// DC is 11 + level
// set script param "dc" to use that instead
Expand All @@ -21,5 +23,6 @@ int StartingConditional()
return FALSE;
}
//IncrementPlayerStatistic(oPC, "intimidate_succeeded");
GiveDialogueSkillXP(oPC, nDC, nSkill);
return TRUE;
}
3 changes: 3 additions & 0 deletions src/nss/dlg_chk_pers.nss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

// Persuade against persuade_dc local variable, offer 1 attempt per 15min
// set script param "dc" to use that instead

Expand All @@ -22,6 +24,7 @@ int StartingConditional()
SetTemporaryInt(GetPCPublicCDKey(oPC, TRUE)+GetName(oPC)+"_"+GetTag(OBJECT_SELF)+"_pers", 1, 900.0);
return FALSE;
}
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
return TRUE;
}
2 changes: 2 additions & 0 deletions src/nss/dlg_chk_perscrim.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_general"
#include "inc_xp"
// DC is 13 + level
// set script param "dc" to use that instead

Expand All @@ -20,6 +21,7 @@ int StartingConditional()
IncrementPlayerStatistic(oPC, "persuade_failed");
return FALSE;
}
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
return TRUE;
}
2 changes: 2 additions & 0 deletions src/nss/dlg_divine_pers.nss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "inc_gold"
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -21,6 +22,7 @@ int StartingConditional()
}
else
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
TakeGoldFromCreature(nCost, oPC, TRUE);
location lLocation = GetLocation(GetObjectByTag(GetLocalString(OBJECT_SELF, "warden_tele_wp")));
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_ferry_pers.nss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "inc_gold"
#include "inc_persist"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -21,6 +22,7 @@ int StartingConditional()
}
else
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
TakeGoldFromCreature(nCost, oPC, TRUE);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
IncrementPlayerStatistic(oPC, "gold_spent_on_ferries", nCost);
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -10,6 +11,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, nTarget, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb1.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 1, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb2.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 2, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb3.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 3, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb4.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 4, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb5.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 5, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb6.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 6, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb7.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 7, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb8.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 8, TRUE);
return TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_q_chk_advb9.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_quest"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -9,6 +10,7 @@ int StartingConditional()
AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, BLUFF_CHAOS_SHIFT, FALSE);
if(GetIsSkillSuccessful(oPC, nSkill, nDC))
{
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "bluff_succeeded");
AdvanceQuest(OBJECT_SELF, oPC, 9, TRUE);
return TRUE;
Expand Down
3 changes: 3 additions & 0 deletions src/nss/dlg_rob_intim.nss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "inc_persist"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -16,6 +17,8 @@ int StartingConditional()
}
else
{
GiveDialogueSkillXP(oPC, nDC, nSkill);

int nGold = StringToInt(GetScriptParam("gold"));

GiveGoldToCreature(oPC, nGold);
Expand Down
3 changes: 2 additions & 1 deletion src/nss/dlg_ship_pers1.nss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "inc_persist"
#include "inc_ship"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -15,7 +16,7 @@ int StartingConditional()
IncrementPlayerStatistic(oPC, "persuade_failed");
return FALSE;
}

GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
PayShipAndTravel(OBJECT_SELF, GetPCSpeaker(), 1, TRUE);

Expand Down
2 changes: 2 additions & 0 deletions src/nss/dlg_ship_pers2.nss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "inc_persist"
#include "inc_ship"
#include "inc_general"
#include "inc_xp"

int StartingConditional()
{
Expand All @@ -15,6 +16,7 @@ int StartingConditional()
IncrementPlayerStatistic(oPC, "persuade_failed");
return FALSE;
}
GiveDialogueSkillXP(oPC, nDC, nSkill);
IncrementPlayerStatistic(oPC, "persuade_succeeded");
PayShipAndTravel(OBJECT_SELF, GetPCSpeaker(), 2, TRUE);

Expand Down
Loading

0 comments on commit 4cdfc06

Please sign in to comment.