SphereCommunity
Blow question - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Blow question (/Thread-Blow-question)

Pages: 1 2


Blow question - daedelus - 10-26-2012 01:43 AM

How I can know where the character has struck the blow?.
My intention is if I hit on the head, make a random block to all damage or receive more damage.

Thanks


RE: Blow question - darksun84 - 10-26-2012 02:42 AM

By default, you can't know the precise location where your hit landed :\


RE: Blow question - daedelus - 10-26-2012 03:02 AM

(10-26-2012 02:42 AM)darksun84 Wrote:  By default, you can't know the precise location where your hit landed :\

Sad. thanks for your repply.


RE: Blow question - RanXerox - 10-26-2012 05:46 AM

It's not exactly what you were looking for, but it's close...

21-05-2008, Nazghul
- Added: Combat flags to Sphere.ini to allow stacking armor and aimed hits. Example of usage
is in scripts/AddOns.
Aimed hits are controlled by tags on the "hitter": TAG.HITPREFERENCE holds the targetted
zone: 1=head, 2=neck/throat, 3=back, 4=chest, 5=arms, 6=hands, 7=legs, 8=feet (if the value
is out of this range it will be changed by %9; "0" means: no preference set);
TAG.HITPREFERENCE_CHANCE (0..1000) is the chance to really hit the desired area;
TAG.HITPREFERENCE.BONUS is the percent the damage is raised when hit where desired,
TAG.HITPREFERENCE.PENALTY is the percent the damage is lowered if the area was missed.
The last two values are defaulting to "30".
The system is perhaps useful to script a system where a player can look for weak armored
bodyparts of his opponent and try to hit him there; could be essential if armor stacking
is used.


RE: Blow question - daedelus - 10-26-2012 06:03 AM

(10-26-2012 05:46 AM)RanXerox Wrote:  It's not exactly what you were looking for, but it's close...

21-05-2008, Nazghul
- Added: Combat flags to Sphere.ini to allow stacking armor and aimed hits. Example of usage
is in scripts/AddOns.
Aimed hits are controlled by tags on the "hitter": TAG.HITPREFERENCE holds the targetted
zone: 1=head, 2=neck/throat, 3=back, 4=chest, 5=arms, 6=hands, 7=legs, 8=feet (if the value
is out of this range it will be changed by %9; "0" means: no preference set);
TAG.HITPREFERENCE_CHANCE (0..1000) is the chance to really hit the desired area;
TAG.HITPREFERENCE.BONUS is the percent the damage is raised when hit where desired,
TAG.HITPREFERENCE.PENALTY is the percent the damage is lowered if the area was missed.
The last two values are defaulting to "30".
The system is perhaps useful to script a system where a player can look for weak armored
bodyparts of his opponent and try to hit him there; could be essential if armor stacking
is used.

Shock greeaaattt i need this because i need find where blow hit. i mean the part of body hit.

Thanks


RE: Blow question - Rizz - 10-26-2012 11:28 PM

If you wanna know where the characaters hit, you need to rewrite the combat hitting using that TAG.

Code:
ON=@HIT
TAG.HITPREFERENCE_CHANCE=1000
DORAND 8
TAG.HITPREFERENCE=1
TAG.HITPREFERENCE=2
TAG.HITPREFERENCE=3
TAG.HITPREFERENCE=4
TAG.HITPREFERENCE=5
TAG.HITPREFERENCE=6
TAG.HITPREFERENCE=7
TAG.HITPREFERENCE=8
ENDDO

In that way you always know what you hitted.


RE: Blow question - daedelus - 10-26-2012 11:38 PM

(10-26-2012 11:28 PM)Rizz Wrote:  If you wanna know where the characaters hit, you need to rewrite the combat hitting using that TAG.

Code:
ON=@HIT
TAG.HITPREFERENCE_CHANCE=1000
DORAND 8
TAG.HITPREFERENCE=1
TAG.HITPREFERENCE=2
TAG.HITPREFERENCE=3
TAG.HITPREFERENCE=4
TAG.HITPREFERENCE=5
TAG.HITPREFERENCE=6
TAG.HITPREFERENCE=7
TAG.HITPREFERENCE=8
ENDDO

In that way you always know what you hitted.

TAG.HITPREFERENCE_CHANCE=1000 it's a normal chance?, i mean like hardcored?

This check is valid?

Code:
ON=@GetHit
            IF <ISWEAPON>
     IF (<TAG.HITPREFERENCE> ==1)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.HELM>))>
    
     IF (<TAG.HITPREFERENCE> == 2)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.NECK>))>
    
     IF (<TAG.HITPREFERENCE> == 3)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.BACK>))>
    
     IF (<TAG.HITPREFERENCE> == 4)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.CHEST>))>
    
     IF (<TAG.HITPREFERENCE> == 5)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.ARMS>))>
    
     IF (<TAG.HITPREFERENCE> == 6)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.HANDS>))>
    
     IF (<TAG.HITPREFERENCE> == 7)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.LEGS>))>
    
     IF (<TAG.HITPREFERENCE> == 8)
     ARGN1 -= <EVAL ((<ARGN1>)-(<FLOAT.ABSORVE.DAMAGE.AR.FEET>))>
        ENDIF
      ENDIF
     ENDIF
    ENDIF
   ENDIF
  ENDIF
ENDIF
ENDIF

and another question, How can i make a random of parrying skill?. greater skill greater chance of success. (more skill more chances to block blow)

Thanks


RE: Blow question - Rizz - 10-27-2012 07:01 AM

No, TAG.HITPREFERENCE_CHANCE=1000 means that you will hit the selected location 100% of times.

Ex:

TAG.HITPREFERENCE_CHANCE=1000
TAG.HITPREFERENCE=1

You always hit the location 1.

Yes you can check the location by checking the tag under @gethit


RE: Blow question - daedelus - 10-27-2012 11:22 AM

Thanks Rizz!. Another question the argn1 is 0 all time Confused I dont find the error...

Code:
[EVENTS E_SIS]
/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////BONUS//////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
LOCAL.BONUS.LUMBER = <EVAL (((<SRC.LUMBERJACKING>*2)/1000)/10)> //20.0
LOCAL.BONUS.TACT = <EVAL (((<SRC.TACTICS>*3)/1000)/10)> //30.0
LOCAL.BONUS.ANAT = <EVAL (((<SRC.ANATOMY>*4)/1000)/10)> //40.0

ON=@HIT
    TAG.HITPREFERENCE_CHANCE=1000
    DORAND 8
    TAG.HITPREFERENCE=1
    TAG.HITPREFERENCE=2
    TAG.HITPREFERENCE=3
    TAG.HITPREFERENCE=4
    TAG.HITPREFERENCE=5
    TAG.HITPREFERENCE=6
    TAG.HITPREFERENCE=7
    TAG.HITPREFERENCE=8
    ENDDO

    IF <SRC.FINDLAYER.LAYER_HAND1.ISWEAPON> || <SRC.FINDLAYER.LAYER_HAND2.ISWEAPON>
     ARGN1 = <EVAL (<ARGN1> * (<LOCAL.BONUS.LUMBER> + <LOCAL.BONUS.TACT> + <LOCAL.BONUS.ANAT>))>
say <argn1>
    ENDIF



RE: Blow question - Rizz - 10-27-2012 08:14 PM

I think the problem is here:
Code:
LOCAL.BONUS.LUMBER = <EVAL (((<SRC.LUMBERJACKING>*2)/1000)/10)> //20.0
LOCAL.BONUS.TACT = <EVAL (((<SRC.TACTICS>*3)/1000)/10)> //30.0
LOCAL.BONUS.ANAT = <EVAL (((<SRC.ANATOMY>*4)/1000)/10)> //40.0

LOCAL.BONUS.LUMBER = <EVAL (((<SRC.LUMBERJACKING>*2)/1000)/10)>

LOCAL.BONUS.LUMBER = (((1000*2)/1000)/10) = 0.2 = 0

These local are 0 bcuz you use eval instead of floatval, so every float local going to be 0.