Aller au contenu

Photo

On damage Script: ID if damage from spell


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Shaughn78

Shaughn78
  • Members
  • 637 messages
I have recently discovered a error in my ooze on damage script. I have it, so there is a chance to destroy a player's melee  weapon on hit. Currently it checks if it is a ranged weapon and nothing happens.

I have recently discovered that when hit with a warlock's eldritch blast that their weapon can be destroyed when they are nowhere near the ooze.

searching through functions and include scripts I have been unable to find a way to distinguish weapon damage from magical damage with an on damage script. Does anyone know of a way?


As a work around I am considering changing the oozes' cast spell at or physical attack scripts and have it set a local int using the name as the variable name and having the on damage check that variable before it tries to destroy the item.

#2
The Fred

The Fred
  • Members
  • 2 516 messages
Hmmm, I'm not sure, but my inclination would be that it might be better to have the weapon destruction happen as a custom OnHit Cast Spell property on the ooze's skin object. Then it will trigger only when hit - though I don't think you can check for damage in this instance.

#3
Shaughn78

Shaughn78
  • Members
  • 637 messages
That is still poses the same problem as to wether the damage is from a spell or a melee weapon.



With the above work around i would need to remove or reset the int at the end of the round.



Another solution, would be to check the distance between the ooze and damager. While this could still cause issues with spell damage it would decrease the probability.

#4
The Fred

The Fred
  • Members
  • 2 516 messages
The OnHit Cast Spell property only triggers when the creature is *hit*, not damaged. So, it oughtn't even fire from a spell. You can also find the item used to hit it with, so you can discount ranged attacks. You might have an issue with, say, creatures with DR, where they might be hit but not damaged - in this case, you might want the script not to trigger, but it would. However, if you're making an ooze this probably won't be a problem, and even if it is I think it's a smaller issue than the one you currently have.

#5
Shaughn78

Shaughn78
  • Members
  • 637 messages
That did the trick. Added the on hit cast unique spell and now it is working.



They are spliting on slashing damage and destroying melee weapons on physical attacks only. Weapons are safe when casting spells.



Thanks Fred.

#6
The Fred

The Fred
  • Members
  • 2 516 messages
No problem. All kinds of weapon-destruction are good in my book.

#7
Artistmonk

Artistmonk
  • Members
  • 30 messages
Can you share script?

#8
Morbane

Morbane
  • Members
  • 1 883 messages
I really like it when standard scripting solutions fix a runtime bug. Nice one Fred.

#9
Shallina

Shallina
  • Members
  • 1 011 messages
There is on physical hit box on creature field script.