SphereCommunity
Custom damage system - Printable Version

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

Pages: 1 2


Custom damage system - Destiny - 12-07-2013 03:41 AM

Hi. I want to use my own daage system. I have pre-release 56b sphere.
For Example
Code:
[EVENTS e_player]
ON=@HIT
argn1=10
RETURN 0

If <src> won't have any armor, it will get 10 damage. But if <src> will have an armor,
the damage won't be 10. So I need to argn1 ignore armore.
I know I could use for example:
Code:
[EVENTS e_player]
ON=@HIT
src.hits=<src.hits>-10
RETURN 1
but there won't be snd_effect and anim_affect in the game. Thanks


RE: Custom damage system - darksun84 - 12-07-2013 04:46 AM

There are two way to do that :


You can use @GetHit trigger and apply the dam_god flag in argn2.
The drawback is that @GetHit is fired even when a player is hit by a spell.
PHP Code:
[EVENTS e_player]
ON=@Gethit
   argn2 
|= dam_god
   argn1 
10
   
return 

Alternatively, you can still use @Hit and the damage function

PHP Code:
[EVENTS e_player]
ON=@Hit
   argn1 
10
   src
.damage <argn1>,dam_god,<uid>
   return 


As you can see, if you are planning to use custom combat system the dam_god flag is almost mandatory (for physical damage)


RE: Custom damage system - Destiny - 12-07-2013 05:03 AM

Work. Thank you


RE: Custom damage system - Coruja - 12-07-2013 09:49 AM

dam_god takes damage even on invul/stone chars, safe regions, etc
so if you use it, you must prevent the damage in some cases

Code:
[EVENTS e_player]
ON=@Hit
IF !((<REGION.SAFE>) || (<REGION.NOPVP>) || (<STONE>) || (<FLAGS> & statf_invul))
  ARGN1 = 10 //here's the full damage without armor calculation
  ARGN2 |= dam_god //set dam_god to null sphere armor calculation and use your own armor calculation
ENDIF

ON=@GetHit
ARGN1 -= 2 //now lets calculate the armor % to decrease from the total damage (use your own formula)



RE: Custom damage system - Khaos - 12-07-2013 05:24 PM

Use newer nightlies. You are all giving these people advice not knowing which servers they use. Simply assign all armor to 0 on armor and process the combat in @Hit triggers and @GetHit.

This was the reason I released the combat system with Pyro. To show how to soft code damage so people wouldn't use the internals. Even setting damage to dam_god is almost unnecessary. There is more than one way to soft code the damage system. Heck you can technically soft code anything from the source if you know what you are doing.

Really, this is upsetting I keep seeing people tell people to just avoid 'this' with 'this'. They are dirty workarounds. Just the new variables alone can do so much more than this. No need for any dam_god. *shaking my head*.

Destiny I suggest getting the most recent nightly and using that nightly. Anytime you get a new nightly, open it as an extra server to make sure nothing got broken (we try to avoid this). The nightlies are way more up to date than any prerelease would be by far. Especially with the commits I have been doing lately.


RE: Custom damage system - darksun84 - 12-07-2013 10:57 PM

a part from setting all the armor values to 0, what is the other way for avoiding dam_god Tongue ?

I don't like it too Shock, even if i am starting to appreciate the default combat systemShock


RE: Custom damage system - Khaos - 12-07-2013 11:09 PM

I don't use any ARMOR=<val>. Use the new variable for RESPHYSICAL. This should be a normal armor value against physical and since it is an empty variable you can code your system however you want. When we did the AOS Combat system we just used tag.resphys and processed it like ARMOR. Took away all internal checks and used dam_type as normal.

Also new script packs won't be getting ARMOR=<val> all the RESPHYSICAL=<val> will be in. If people want ARMOR= I can place them in and comment them out. They shouldn't be used unless you are wanting sphere's core combat system.


RE: Custom damage system - Destiny - 12-08-2013 04:38 AM

Thans for reply.
Hi I note some czech shards use nightly http://www.kelevar.cz/status.php too. But on your web you write nightly shouldn't be used for live shard.
Should I be afraid of use on live shard, if i use nightly ?


RE: Custom damage system - XuN - 12-08-2013 05:01 AM

This warning is to make sure you understand that these are the builds we are working on, so maybe one day we break the build and won't work correctly until fixed (as already happened), that does not mean you can use them... just makes you clear they may have some bugs. A prerelease is nothing but a nightly flagged as Pre-Release, don't have fear of them... just be sure the build you downloaded is working fine with your scripts and enjoy Smile


RE: Custom damage system - Khaos - 12-08-2013 06:33 AM

They have no more bugs than older versions. Most nightlies the bugs are fixed unless XuN commits something lol. I posted a whole thread on how to handle nightlie and I highly suggest updating to them.