The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom damage system
Author Message
Destiny
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2013
Reputation: 0



Post: #1
Custom damage system
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
12-07-2013 03:41 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Custom damage system
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)
12-07-2013 04:46 AM
Find all posts by this user Like Post Quote this message in a reply
Destiny
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2013
Reputation: 0



Post: #3
RE: Custom damage system
Work. Thank you
12-07-2013 05:03 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: Custom damage system
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)
12-07-2013 09:49 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #5
RE: Custom damage system
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.
(This post was last modified: 12-07-2013 05:24 PM by Khaos.)
12-07-2013 05:24 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Custom damage system
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
(This post was last modified: 12-07-2013 11:05 PM by darksun84.)
12-07-2013 10:57 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #7
RE: Custom damage system
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.
(This post was last modified: 12-07-2013 11:09 PM by Khaos.)
12-07-2013 11:09 PM
Find all posts by this user Like Post Quote this message in a reply
Destiny
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2013
Reputation: 0



Post: #8
RE: Custom damage system
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 ?
12-08-2013 04:38 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: Custom damage system
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
12-08-2013 05:01 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #10
RE: Custom damage system
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.
12-08-2013 06:33 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)