Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

On Poisons


crimsoncosmos
 Share

Recommended Posts

Hello!

I heard lots of good stuff about TES Alliance so I thought I'd give it a try myself! I could use some help on this little project and this looks like the best place to get it.

Without further ado:

Current task: getting Weakness effects to trigger before the poison if both are in the same "bottle"

The idea is this:

1. use an "OnHit" block to catch the player attacking the target. This is dependent on the block being triggered before the actual hit connects - I'm still waiting on a reply from scruggs on this.

2. go through the poison's effects and saving the "weakness" ones, while removing them from the potion.

3. get the target's active effects and go through those, saving the "resistance" ones.

4. change the "resist to poison" ones to "resistance to magicka" (not sure if this is possible as new effects are added on the next frame. alternatively, I would need a way to "tell" it that the source of the new effect is a poison and I'm not sure how to do that).

5. make a clone form of the default spell, remove its effect and add a new effect with the weakness from the potion

6. if 4 is possible, use AddSpellNS to add the weakness with the saved values. This should take into account any resistances.

7. repeat 5 and 6 for any number of different weaknesses in the potion.

8. change the "resistance to magicka" back to "resistance to poison" for when the rest of the poison effects hit.

And that should be it.

My problem right now is outlined in step 4. Any suggestions are greatly appreciated!

Cheers!

cc

Link to comment
Share on other sites

I would have to research some of the command available but I don't think some of those may be possible without OBSE. (Which I cannot help with since this is a non-OBSE script help thread, but perhaps others can.)

Thanks for getting back to me. I had no idea this area is for Non-OBSE stuff. I had a hard time finding the needed functions with OBSE, much less without it.

Should I ask a moderator to move this someplace else?

Thank you!

cc

Link to comment
Share on other sites

I'm afraid I don't understand what you are trying to do. I fixed the poison kill script for Oblivion XP and when I was working on that, I discovered weaknesses are taken into account already. There's no need to get weakness effects to trigger first - they do already. What are you trying to do?

Link to comment
Share on other sites

I'm afraid I don't understand what you are trying to do. I fixed the poison kill script for Oblivion XP and when I was working on that, I discovered weaknesses are taken into account already. There's no need to get weakness effects to trigger first - they do already. What are you trying to do?

I was trying to get the weaknesses to trigger before the rest of the poison. For example with a Poison that adds 10 fire damage and 50% weakness to fire, the fire damage dealt would be 15. Are you saying this is the standard behaviour already? If that's the case, a certain UESP page needs updating!

Thanks!

cc

Link to comment
Share on other sites

Yeah, I discovered with lots of testing that the weaknesses are accounted for already :) Don't trust the CS Wiki or everything you read in the UESP. Most of it is pretty good, but it's hard to audit everything somebody writes, so you need to do your own testing. For example, somebody updated the CS Wiki today with something about the misc. stats that I find rather dubious. I plan to test it at some point to see if the person is correct.

Basically in my poison script, I tracked the damage each round. I also evaluated the numbers returned with various functions. I found that the resistances definitely do have an effect.

Here's a small snippet of the code:


while ( j < getMagicItemEffectCount poisonRef )
;initial damage equals spell magnitude
;if (ObXPMain.debugMode)
;let effectInt := getNthEffectItemCode poisonRef j
;let effectCode := getMagicEffectCharsC effectInt
;let dmg := getNthEffectItemMagnitude poisonRef j
;scribe "Effect: %z, Magnitude: %.4f" effectCode dmg
;endif

; sum up the damage from the health related effects only (damage health, drain health, fire damage, frost damage, shock damage)
; need to consider individual resistances before adding to total damage done. Negative resistance is a weakness, so the damage
; will be increased.
if ( ( getNthEffectItemCode poisonRef j ) == ( getMECode DGHE ) )
let damageDone := damageDone + getNthEffectItemMagnitude poisonRef j
elseif ( ( getNthEffectItemCode poisonRef j ) == ( getMECode DRHE ) )
let damageDone := damageDone + getNthEffectItemMagnitude poisonRef j
elseif ( ( getNthEffectItemCode poisonRef j ) == ( getMECode FIDG ) )
let damageDone := damageDone + getNthEffectItemMagnitude poisonRef j * ( 100 - actor.getAV ResistFire ) / 100
elseif ( ( getNthEffectItemCode poisonRef j ) == ( getMECode FRDG ) )
let damageDone := damageDone + getNthEffectItemMagnitude poisonRef j * ( 100 - actor.getAV ResistFrost ) / 100
elseif ( ( getNthEffectItemCode poisonRef j ) == ( getMECode SHDG ) )
let damageDone := damageDone + getNthEffectItemMagnitude poisonRef j * ( 100 - actor.getAV ResistShock ) / 100
endif

let j := j + 1
loop
[/xml]

This even has my debug code commented out :) Then a bit further on I have this:

[xml]
;if (ObXPMain.debugMode)
;scribe "Total damage: %.4f" damageDone
;let resPoison := (100 - actor.getAV ResistPoison) / 100
;scribe "Poison resistance: %.4f" resPoison
;endif

; defenses against poison damage include resist poison, and resist elemental effects, calculated above
; weakness to poison enhances damage
let damageDone := damageDone * ( 100 - actor.getAV ResistPoison ) / 100

;if (ObXPMain.debugMode)
;scribe "Net damage done: %.4f" damageDone
;let actorHealth := actor.getAV Health
;scribe "Health of target: %.4f" actorHealth
;let ckills := GetPCMiscStat 5
;let pkills := GetPCMiscStat 6
;scribe "Creature kills: %.4f, NPC kills: %.4f" ckills pkills
;endif

This requires OBSE and Conscribe for the logging (scribe command), but I think you'll find the numbers interesting. :wink: Oh, and all that code is in a ScriptEffectStart block, but I imagine it would work in a Gamemode block too. Basically Oblivion XP replaces a poisoned weapon with an identical weapon with a ScriptEffect attached to it. It works really well, but is hard to describe. I should probably do a tutorial - in all my ample spare time. Hahahaha...

There's a similar block of code in the ScriptEffectUpdate block because a poisoned weapon won't necessarily kill in one hit. Lastly there's a ScriptEffectFinish block to get the last remnants of damage and declare the target dead!

That's not the entire script, obviously. I was just trying to show the calculation of the total damage due to poison.

Edit: Oh, and the poisonRef in all that is a reference to the poisoned weapon with the script effect attached to it.

Edited by AndalayBay
Link to comment
Share on other sites

[snip]

Hey!

Thanks for getting back to me!

One thing - I'm not sure if this is true (it was on the UESP wiki) but it's worth looking into. They're saying that Resistance to Magicka is taken into account vs poisons as well because, internally, they're treated as offensive magical effects. Obviously, Weakness to Magicka would function the same way.

Cheers!

cc

Edited by crimsoncosmos
Link to comment
Share on other sites

Quite possible. My script is specific to poisons applied to weapons and it doesn't need to take every resistance into affect. Basically it compares the damage done to the NPC or creatures health and then forces the kill when the health drops below the damage done. If if the NPC has more resistance, there will be a bit less damage done, but I'm not matching on specific values, so it doesn't matter. It works very well and I've not had any reports of issues thus far...

The creature might drop dead on its own and then I don't need to do anything. My script will detect the case where the creature drops dead but the miscellaneous stat didn't get updated, so the kill is forced so that the stat is updated and Oblivion XP will record the kill properly. Then Ob XP will record the points.

Link to comment
Share on other sites

Quite possible. My script is specific to poisons applied to weapons and it doesn't need to take every resistance into affect. Basically it compares the damage done to the NPC or creatures health and then forces the kill when the health drops below the damage done. If if the NPC has more resistance, there will be a bit less damage done, but I'm not matching on specific values, so it doesn't matter. It works very well and I've not had any reports of issues thus far...

The creature might drop dead on its own and then I don't need to do anything. My script will detect the case where the creature drops dead but the miscellaneous stat didn't get updated, so the kill is forced so that the stat is updated and Oblivion XP will record the kill properly. Then Ob XP will record the points.

Thanks for the reply!

I was saying about the Magic Resistance that it might apply even to poisons, not just to spells. Here's a link to the UESP page. If it's irrelevant to your script, never mind :)

Also, someone told me that applying spells as abilities bypasses weaknesses and resistances. I was wondering if you can confirm that and if you can tell me what method you're using for simulating the poison damage in the script.

Cheers!

cc

Link to comment
Share on other sites

I've never tried applying a spell as an ability, so I can't say. I'm not simulating the poison damage. I'm monitoring the amount of damage done due to the poison by replacing the poisoned weapon with a weapon that has the poison as a scripted effect. This allows me to monitor the damage done by evaluating each stage of the scripted effect. So I can use the ScriptEffectStart, ScriptEffectUpdate and ScriptEffectFinish blocks to evaluate the damage and update the Miscellaneous stats (15 & 16) if necessary. Have a look at script effects and the functions I'm using in that code snippet above in the OBSE docs and the CS Wiki. I don't know if they have anything about any of this stuff here because it is all OBSE functions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...