Aller au contenu

Photo

Successful player attack


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

#1
Calvix

Calvix
  • Members
  • 2 messages
Hi, 
is there any way how i can be sure that player did succesful attack to target ?
There are some function with damage, but i just need info if player hits or miss.
Cant found  anything in default functions.

(sry for my eng.)
Any suggest ?

#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
OnPhysicalAttacked gets run when another object attacked oTarget, however you cant determine hit/miss here yet. OnDamaged runs if another object hits oTarget either in melee or ranged (not spells). And OnSpellCastAt runs if oTarget was hit by spell.

Note though, that these events are NPC only, you can't script this player-to-play unfortunately.

#3
Calvix

Calvix
  • Members
  • 2 messages

ShaDoOoW wrote...
OnDamaged runs if another object hits oTarget either in melee or ranged (not spells).
.

I tried this, but theres problem when target has damage reduction . If all damage is reduced that event dont run.

#4
Shadooow

Shadooow
  • Members
  • 4 471 messages
Ok, right. There is a workaround for this.

Give your creature armor and put On Hit Cast Spell: Unique Power (OnHit) on it. Then edit x2_s3_onhitcast script or if you use tagbased scripting then just change tag of the armor and make a script of tag name.

This will make a OnPreDamaged event where the damage is not yet done.

EDIT: this works for PCs as well.

Modifié par ShaDoOoW, 12 mars 2011 - 11:57 .