Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2016
S
stranger
OP Offline
stranger
S
Joined: Sep 2016
How do I change the 15% per level saving throw from Willpower/Bodybuilding?

Joined: Dec 2016
Location: United States
member
Offline
member
Joined: Dec 2016
Location: United States
If there was a way to do it, it would probably be in Data.txt. There doesn't seem to be anything in there about those values though so I don't think it's possible to change, unfortunately.

Joined: Sep 2016
S
stranger
OP Offline
stranger
S
Joined: Sep 2016
Is it possible to add some scripts to Base.charScript to change the saving throw at each level of WP/BB?

Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
I would not know how, you can add potions that reduce BB and WP as a whole but I see no chance to reduce those 15% per BB/WP, even with scripting.

If something was in Data.txt, you can be sure that Baardvark would have done it in Scales a long time ago already. Since he did not, there is no known way to reduce the values ;-)


Last edited by FrauBlake; 07/01/17 03:54 PM.
Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
I did a scripting experiment and got some not so bad results. It won't give full control over saving throws but, at least, it simulates some functions of the saving throw mechanism and gives control over the chance to resist:

Code
INIT

CHARACTER:__Me
STATUS:%Status
FLOAT:%StatusChance
ABILITY:%SavingThrow

EVENTS

EVENT StatusRegistration
VARS
	STATUS:_Status
ON
	OnCharacterApplyStatus(__Me,_Status)  //checks a status before it gets applied (even if it will fail!)
ACTIONS
	IF "c1&!c2"
		IsEqual(%Status,null) //to prevent a reaction when we manually apply the status (s. below)
		IsEqual(_Status,CONSUME) //must be excluded since specific potions can't be removed with char scripting!
	THEN
		IF "c1|c2" //every willpower related status to be added here
			IsEqual(_Status,STUNNED) 
			IsEqual(_Status,BLIND)
		THEN
			Set(%Status,_Status)
			Set(%SavingThrow,Willpower)
			CallFunction("CalculateSavingThrow")
		ELIF "c1" //every bodybuilding related status to be added here
			IsEqual(_Status,FROZEN)
		THEN
			Set(%Status,_Status)
			Set(%SavingThrow,BodyBuilding)
			CallFunction("CalculateSavingThrow")
		ENDIF
	ENDIF
	RETURN(1) //well, I have no idea what this does, but it is somehow necessary for the OnCharacterApplyStatus event; I also don't know 
//what the integer does, but it works
	
EVENT SavingThrow
VARS
	INT:_Resistance
ON
	OnFunction("CalculateSavingThrow")
ACTIONS
		IF "c1"
			CharacterGetAbility(_Resistance,__Me,%SavingThrow)
		THEN
			IF "c1"
				IsEqual(_Resistance,1)
			THEN
				Set(%StatusChance,0.1) //I chose 10% chance to resist per ability level
			ELIF "c1"
				IsEqual(_Resistance,2)
			THEN
				Set(%StatusChance,0.2)
			ELIF "c1"
				IsEqual(_Resistance,3)
			THEN
				Set(%StatusChance,0.3)
			ELIF "c1"
				IsEqual(_Resistance,4)
			THEN
				Set(%StatusChance,0.4)
			ELIF "c1"
				IsEqual(_Resistance,5)
			THEN
				Set(%StatusChance,0.5)
			ELIF "c1"
				IsEqual(_Resistance,6)
			THEN
				Set(%StatusChance,0.6)
			ELSE
				Set(%StatusChance,0.05)
			ENDIF
		ENDIF
		StartTimer("RemoveStatus",1,0) //should be as short as possible; maybe 0.5 seconds or less; a timer is necessary to prevent a crash
		Set(%SavingThrow,null)
	
EVENT RemoveOrApplyStatus
ON
	OnTimer("RemoveStatus")
ACTIONS
	IF "c1"
		IsRandom(%StatusChance)
	THEN
		IF "c1"
			CharacterHasStatus(__Me,%Status)
		THEN
			IF "c1"
				IsEqual(%Status,FROZEN)
			THEN
				CharacterApplyStatus(__Me,WARM) //frozen can't be removed by script, so we must use this status
			ELSE
				CharacterRemoveStatus(__Me,%Status)
			ENDIF
			StatusText(__Me,"ResistStatus")
		ENDIF
	ELIF "!c1"
		CharacterHasStatus(__Me,%Status)
	THEN	
		CharacterApplyStatus(__Me,%Status,null,1)
	ENDIF
	Set(%Status,null)	


Problems etc.:

- this does not regard enemy stats; but it would be possible to include them
- It would be necessary to set a character event whenever a status gets applied by a script (item, char or story script) and add it as integer to the conditions of the StatusRegistration
- every round of the status the engine checks for a saving throw; there's nothing we can do about that (and we can't script a functional equivalent for this)
- Knockdown can't be removed by script either; it would be necessary to script a one turn potion for knockdown immunity
- if a character gets immobilized by a status on his active turn we probably won't be able to prevent his turn from ending automatically

It was just an attempt to see what is possible. But it's probably too lacking (in its current form and in theory) to be used as a mechanic.


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Dec 2016
Location: United States
member
Offline
member
Joined: Dec 2016
Location: United States
I've done some thinking on this topic, as within Epic Encounters I had to design a status emulation system for many new statuses. As Abraxas* pointed out, as long as you're still actually using the base statuses you have some oddities that you won't really be able get around. It is absolutely possible to create new "fake" variants of these statuses, however it would take quite a bit of annoying work to create and have all old skills use these fake variants. To readdress the original post, though, it's not doable without significant work.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5