Jump to content

Can someone check out these scripts...


cfh85

Recommended Posts

These 3 scripts are for a Dagger. Everytime you murder enough people whilst using it it gives you a better version.

1 concern is that the 2nd version and onwards gives you stat bonus's. I'm worried that the daggers might get switched and then the PC getting the bonus twice because the previous bonus isn't removed.

Another concern is that the player could murder with magic with the dagger equipped and it would still count. does this really matter? is there a way to stop it?

If anyone has any suggestions for making this better/simpler/more reliable etc that would great.

 

First script is for the quest which will change the daggers

Scriptname 000DoSDeadCountQuestScript

Float DoOnce
Float fQuestTimeDelay

Begin Gamemode

Set fQuestTimeDelay to 1
If ( Player.IsInCombat == 1 ) || ( Player.IsRidingHorse == 1 ) || ( DoOnce == 10)
	return
else
	If ( DoSDeadCount >= 5 ) && ( DoSDeadCount < 10 ) && ( DoOnce == 0 )
		Player.AdditemNS 000CFHDoSDagger02 1
		Player.EquipItemNS 000CFHDoSDagger02
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 1
	Elseif ( DoSDeadCount >= 10 ) && ( DoSDeadCount < 15 ) && ( DoOnce <= 1 )
		Player.AdditemNS 000CFHDoSDagger03 1
		Player.EquipItemNS 000CFHDoSDagger03
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 2
	Elseif ( DoSDeadCount >= 15 ) && ( DoSDeadCount < 20 ) && ( DoOnce <= 2 )
		Player.AdditemNS 000CFHDoSDagger04 1
		Player.EquipItemNS 000CFHDoSDagger04
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 3
	Elseif ( DoSDeadCount >= 20 ) && ( DoSDeadCount < 25 ) && ( DoOnce <= 3 )
		Player.AdditemNS 000CFHDoSDagger05 1
		Player.EquipItemNS 000CFHDoSDagger05
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 4
	Elseif ( DoSDeadCount >= 25 ) && ( DoSDeadCount < 30 ) && ( DoOnce <= 4 )
		Player.AdditemNS 000CFHDoSDagger06 1
		Player.EquipItemNS 000CFHDoSDagger06
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 5
	Elseif ( DoSDeadCount >= 30 ) && ( DoSDeadCount < 35 ) && ( DoOnce <= 5 )
		Player.AdditemNS 000CFHDoSDagger07 1
		Player.EquipItemNS 000CFHDoSDagger07
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Player.RemoveItemNS 000CFHDoSDagger06 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 6
	Elseif ( DoSDeadCount >= 35 ) && ( DoSDeadCount < 40 ) && ( DoOnce <= 6 )
		Player.AdditemNS 000CFHDoSDagger08 1
		Player.EquipItemNS 000CFHDoSDagger08
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Player.RemoveItemNS 000CFHDoSDagger06 1
		Player.RemoveItemNS 000CFHDoSDagger07 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 7
	Elseif ( DoSDeadCount >= 40 ) && ( DoSDeadCount < 45 ) && ( DoOnce <= 7 )
		Player.AdditemNS 000CFHDoSDagger09 1
		Player.EquipItemNS 000CFHDoSDagger09
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Player.RemoveItemNS 000CFHDoSDagger06 1
		Player.RemoveItemNS 000CFHDoSDagger07 1
		Player.RemoveItemNS 000CFHDoSDagger08 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 8
	Elseif ( DoSDeadCount >= 45 ) && ( DoSDeadCount < 50 ) && ( DoOnce <= 8 )
		Player.AdditemNS 000CFHDoSDagger10 1
		Player.EquipItemNS 000CFHDoSDagger10
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Player.RemoveItemNS 000CFHDoSDagger06 1
		Player.RemoveItemNS 000CFHDoSDagger07 1
		Player.RemoveItemNS 000CFHDoSDagger08 1
		Player.RemoveItemNS 000CFHDoSDagger09 1
		Message "Sithis has rewarded you for the souls delivered"
		Set DoOnce to 9
	Elseif ( DoSDeadCount >= 50 ) && ( DoSDeadCount < 55 ) && ( DoOnce <= 9 )
		Player.AdditemNS 000CFHDoSDagger11 1
		Player.EquipItemNS 000CFHDoSDagger11
		Player.RemoveItemNS 000CFHDoSDagger01 1
		Player.RemoveItemNS 000CFHDoSDagger02 1
		Player.RemoveItemNS 000CFHDoSDagger03 1
		Player.RemoveItemNS 000CFHDoSDagger04 1
		Player.RemoveItemNS 000CFHDoSDagger05 1
		Player.RemoveItemNS 000CFHDoSDagger06 1
		Player.RemoveItemNS 000CFHDoSDagger07 1
		Player.RemoveItemNS 000CFHDoSDagger08 1
		Player.RemoveItemNS 000CFHDoSDagger09 1
		Player.RemoveItemNS 000CFHDoSDagger10 1
		Message "Sithis has rewarded you for the souls delivered. He has revealed The Dread's full power to you"
		Set DoOnce to 10
		SetStage 000CFHDoS 100
	Endif
EndIf
End

 

Second script is for the first dagger. it starts the quest but the dagger doesn't have any bonus'

 

ScriptName 000CFHDoSStartScript

; Global DoSDeadcount used to keep track of murders with DoS
       ; Global DoSEquip to keep track of when any of the daggers are equipped 

Float DoOnce
Float DoOnce2
Float MurderCount1
Float MurderCount2
Float fQuestTimeDelay

Begin GameMode
Set fQuestTimeDelay to 0.1
If DoSEquip == 0
	return
else
	If DoOnce2 == 0
		set MurderCount1 to GetPCMiscStat 32
		set DoOnce2 to 1
	Else
		if MurderCount1 > GetPCMiscStat 32
			set MurderCount2 to (MurderCount1 - GetPCMiscStat 32)
			Set DoSDeadCount to (DoSDeadCount + MurderCount2)
			Set MurderCount1 to GetPCMiscStat 32
		Endif
	EndIf
EndIf
End

Begin Onequip
If DoOnce == 0
	Setstage 000CFHDoS 10
	Set DoOnce to 1
Endif
set DoSEquip to 1
set DoOnce2 to 0
End

Begin onunequip
Set DoSEquip to 0
End

 

Final script is for the other daggers

 

ScriptName 000DoSWeaponScript

; Global DoSDeadcount used to keep track of murders with DoS
; Global DoSEquip to keep track of when the weapon is equipped

Float MurderCount1
Float MurderCount2
Float DoOnce2
Float fQuestTimeDelay
Float DoSBonus

Begin GameMode
Set fQuestTimeDelay to 0.1
If DoSEquip == 0
	return
else
	If DoOnce2 == 0
		set MurderCount1 to GetPCMiscStat 32
		set DoOnce2 to 1
	Elseif DoOnce2 == 1
		if MurderCount1 > GetPCMiscStat 32
			set MurderCount2 to (MurderCount1 - GetPCMiscStat 32)
			Set DoSDeadCount to (DoSDeadCount + MurderCount2)
			Set MurderCount1 to GetPCMiscStat 32
		Endif
	EndIf
	If DoSBonus == 0
		If (Player.IsActorDetected == 0) && (Player.IsSneaking == 1)
			Player.ModActorValue AttackBonus 10
			set DoSBonus to 1
		Endif
	ElseIf DoSBonus == 1
		If (Player.IsActorDetected == 1) || (Player.IsSneaking == 0)
			Player.ModActorvalue AttackBonus -10
			Set DoSBonus to 0
		Endif
	Endif
Endif
End
Begin Onequip
set DoSEquip to 1
Set DoOnce2 to 0
End

Begin Onunequip
set DoSEquip to 0
If DoSBonus == 1
	Player.ModActorvalue AttackBonus -10
	Set DoSBonus to 0
EndIf
End

 

Would this still work (if it works now) if i alter the attack bonus for each blade.

Please note that the values chosen for the attack bonus and the murders required are not set in stone and suggestions are welcome.

also, how do I hide the script sections as spoilers? seems much nicer layout like that

 

Thanks for taking the time to read this. any productive input is welcome

Link to comment
Share on other sites

Instead of modifying the actor value, you could increase the damage of the weapon directly. Then if it got swapped out, you would not have to worry. ModAttackValue would do the trick. If you are concerned that the player would not deal as much damage because they do not have a high enough blade skill, then an alternative would just be make DoSBonus either a global or quest variable. That way, your quest script could keep an eye on it.

 

That reminds me, 1 second for the quest seems a bit quick. If all you are doing is swapping out a weapon, then you could easily make that at least 10 seconds. The player will neither notice or care, plus it will reduce CPU stress a bit.

 

 

The script from duskfang and dawnfang's enchantment will probably help you with ensuring the killing blow came from the dagger, if not the penultimate blow.

 

 

Spoiler tags look like this:

 

 

goes after the spoiler

 

goes before.

 

I have to swap them around so that you can actually see them ;)

Link to comment
Share on other sites

it was dawnfang/duskfang that inspired it. I couldn't get it to work properly at the time though :( I think I tried it before I realised I need to start up the CS using OBSE loader so I was getting stressed a lot.

I'll increase the fQuestTimeDelay. Just figured 1 second was pretty slow given that so many scripts use 0.01, but you're totally right about it not mattering if it's 10-20 seconds

Link to comment
Share on other sites

DawnFang and Duskfang were part of the Shivering Isles, released by Bethesda themselves - they did not use OBSE. The problem was probably due to having no duration on the enchantment. I know because a long time ago, when I was starting out, I had the exact same problem ;)

 

The default for fQuestDelayTime is 5 seconds. If you don't set fQuestDelayTime, it is automatically set to that time, but most quests are fully capable of running just as well at much slower speeds. Many quests that I create as global scripts are run at 30 second intervals.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...