enderalse/source/scripts/favordialoguescript.psc

130 lines
4.4 KiB
Plaintext
Raw Normal View History

Scriptname FavorDialogueScript extends Quest Conditional
{functions and properties used by favor dialogue}
GlobalVariable Property GameDaysPassed Auto
GlobalVariable Property IntimidateBribeDelayDays Auto
GlobalVariable Property FlatterDelayDays Auto
GlobalVariable Property BribeReward Auto
GlobalVariable Property FlatterReward Auto
GlobalVariable Property IntimidateReward Auto
GlobalVariable Property IntimidateCost Auto
{favor point cost from intimidating}
MiscObject Property Gold Auto
Keyword Property BrawlKeyword Auto
{used for brawl story event}
float Property SkillUsePersuade Auto Conditional
{skill uses for flatter (magnitude for AdvanceSkill)}
float Property SkillUseBribe Auto Conditional
{skill uses for flatter (magnitude for AdvanceSkill)}
float Property SkillUseIntimidate Auto Conditional
{skill uses for flatter (magnitude for AdvanceSkill)}
float Property SkillUseMultiplier Auto Conditional
{Base multiplier for skill uses. Formula is based off the skill use multiplier set in Speechcraftt}
float Property SkillUseGiveGiftMult = 1.0 Auto Conditional
{skill uses for flatter (multipler for for AdvanceSkill magnitude)}
GlobalVariable Property SpeechSkillMult Auto
{Global to determine skill uses}
import game
import debug
; call this to persuade target actor
Function Persuade(Actor pTarget)
2023-12-06 15:31:10 +00:00
;trace("Persuade: " + pTarget)
; give player skill uses
SkillUseMultiplier = SpeechSkillMult.value
2023-12-08 02:45:53 +00:00
SkillUsePersuade = SkillUseMultiplier * Game.GetPlayer().GetActorValue("Speechcraft")
2023-12-06 15:31:10 +00:00
;trace(self + "Current Skill uses given: " + SkillUsePersuade + " times the Skill Use Multiplier")
AdvanceSkill("Speechcraft", SkillUsePersuade)
Game.IncrementStat( "Persuasions" )
if ( Game.QueryStat( "Bribes" ) && Game.QueryStat( "Intimidations" ) )
AddAchievement(28)
endif
endFunction
Function ArrestPersuade(Actor pTarget)
2023-12-06 15:31:10 +00:00
;trace("Persuade: " + pTarget)
; give player skill uses
SkillUseMultiplier = SpeechSkillMult.value
2023-12-08 02:45:53 +00:00
SkillUsePersuade = SkillUseMultiplier * Game.GetPlayer().GetActorValue("Speechcraft")
AdvanceSkill("Speechcraft", SkillUsePersuade)
Game.IncrementStat( "Persuasions" )
if ( Game.QueryStat( "Bribes" ) && Game.QueryStat( "Intimidations" ) )
AddAchievement(28)
endif
; set bribed state
pTarget.SetBribed()
endFunction
; call this to bribe target actor
Function Bribe(Actor pTarget)
2023-12-06 15:31:10 +00:00
;trace("Bribe: " + pTarget)
SkillUseMultiplier = SpeechSkillMult.value
2023-12-08 02:45:53 +00:00
SkillUseBribe = SkillUseMultiplier * Game.GetPlayer().GetActorValue("Speechcraft")
2023-12-06 15:31:10 +00:00
;trace(self + "Current Skill uses given: " + SkillUseBribe + " times the Skill Use Multiplier")
if pTarget.GetBribeAmount() <= GetPlayer().GetGoldAmount()
; remove gold
GetPlayer().RemoveItem(Gold, pTarget.GetBribeAmount())
; put gold in target
pTarget.AddItem(Gold, pTarget.GetBribeAmount())
; set bribed state
pTarget.SetBribed()
; give player skill uses
AdvanceSkill("Speechcraft", SkillUseBribe)
; increment game stats
Game.IncrementStat( "Bribes" )
if ( Game.QueryStat( "Persuasions" ) && Game.QueryStat( "Intimidations" ) )
Game.AddAchievement(28)
endif
endif
endFunction
; call this to intimidate target actor
Function Intimidate(Actor pTarget)
2023-12-06 15:31:10 +00:00
;trace("Intimidate: " + pTarget)
SkillUseMultiplier = SpeechSkillMult.value
2023-12-08 02:45:53 +00:00
SkillUseIntimidate = SkillUseMultiplier * Game.GetPlayer().GetActorValue("Speechcraft")
2023-12-06 15:31:10 +00:00
;trace(self + "Current Skill uses given: " + SkillUseIntimidate + " times the Skill Use Multiplier")
; intimidate actor
pTarget.SetIntimidated()
; give player skill uses. don't if the Brawl quest is running, don't track intimidation stats for Brawl
2023-12-05 07:04:09 +00:00
Game.IncrementStat( "Intimidations" )
endFunction
; call this to initiate brawl quest through story manager
Function Brawl(Actor pTarget, Actor pTargetFriend = None)
2023-12-06 15:31:10 +00:00
;trace("Brawl: " + pTarget + ", friend=" + pTargetFriend)
BrawlKeyword.SendStoryEvent(None, pTarget, pTargetFriend)
endFunction
; call this to give gift to target actor
Function GiveGift(Actor pTarget)
FormList giftFilter = pTarget.GetActorBase().GetGiftFilter()
2023-12-06 15:31:10 +00:00
;trace("Give Gift: " + pTarget + ", gift filter = " + giftFilter)
int favorPointsEarned = pTarget.ShowGiftMenu(true, giftFilter)
; TEMP cap until we have a formula for this:
if favorPointsEarned > 100
favorPointsEarned = 100
endif
; give player skill uses
2023-12-06 15:31:10 +00:00
;trace("Give Gift: " + favorPointsEarned * SkillUseGiveGiftMult + " skill uses earned")
AdvanceSkill("Speechcraft", favorPointsEarned * SkillUseGiveGiftMult)
endFunction