Changing the damage calculation - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Changing the damage calculation (/Thread-Changing-the-damage-calculation) Pages: 1 2 |
Changing the damage calculation - AmpereJoule - 09-12-2013 12:19 PM Hello, I need the damage equation to be: "damage_received = enemy_damage - player_armor" or "damage_dealt = player_damage - enemy_armor" and "magic_damage_received = enemy_magic_damage + player_armor" or "magic_damage_dealt = player_magic_damage + enemy_armor" Where do I change it? How? ps: Is "armor" a value or is it percentage? Thank you. RE: Changing the damage calculation - Alaric - 09-12-2013 06:06 PM Armor is a bastard and isn't percentage but just a value. I hate the HC calculation too I guess you'll have to rescript it in player and npc triggers(gethit, hit..)? But I'm not sure, it's pretty complicated that way. Actually the calculation already works as you say... received damage = rand<damage dealt - enemies armor> (told me darksun once ). But the magic damage should go through the triggers again and then you must block the damage, calculate the one you want(reduced by armor) and damage the enemy with that. But there must be better way. I hope somebody knows it and tell us. RE: Changing the damage calculation - darksun84 - 09-12-2013 08:28 PM it was newdamage = rand(damage-AR ,damage) , if newdamage <=0 no dfamage at all I actually like the formula RE: Changing the damage calculation - Alaric - 09-12-2013 09:39 PM (09-12-2013 08:28 PM)darksun84 Wrote: it was newdamage = rand(damage-AR ,damage) , if newdamage <=0 no dfamage at allYe, that's it. sry RE: Changing the damage calculation - AmpereJoule - 09-12-2013 09:51 PM (09-12-2013 06:06 PM)Alaric Wrote: Armor is a bastard and isn't percentage but just a value. I hate the HC calculation too I guess you'll have to rescript it in player and npc triggers(gethit, hit..)? But I'm not sure, it's pretty complicated that way. Actually the calculation already works as you say... received damage = rand<damage dealt - enemies armor> (told me darksun once ). But the magic damage should go through the triggers again and then you must block the damage, calculate the one you want(reduced by armor) and damage the enemy with that. yeah, i hope someone tell me which line and .scp to change. But I am using "notepad++" and looking for these you said \o\. (09-12-2013 08:28 PM)darksun84 Wrote: it was newdamage = rand(damage-AR ,damage) , if newdamage <=0 no dfamage at all Is that the damage calculation? I am looking for it right now! darksun, I searched "rand(" and it find lots of it, but none as "newdamage = rand(damage-AR ,damage)". I also searched "newdamage" and it find nothing in my scripts. Can you tell me where is it? ****EDIT**** Does it count "ARMOR" or "TAG.ResPhysical"? (i prefer ARMOR, and my sphere.ini don't have any events in "events to all players" or "events to all NPCs" (it means that there is not elemental damage, right?)) ANSWER: It does count "TAG.ResPhysical". (So, I put "//" after the "ARMOR=300" line in my script) ****END EDIT**** RE: Changing the damage calculation - darksun84 - 09-12-2013 10:47 PM Well it's not an "official " formula , i just figured it by doing a lot of tests RE: Changing the damage calculation - Alaric - 09-12-2013 10:52 PM Ampere, you have to script the events and give players and npcs the triggers. Forever. RE: Changing the damage calculation - AmpereJoule - 09-12-2013 11:06 PM (09-12-2013 10:52 PM)Alaric Wrote: Ampere, you have to script the events and give players and npcs the triggers. Forever. Why? I don't want the Elemental damage. I only want as I said. Magic_damage = Magic + Armor Physical_damage = Damage - Armor Isn't the events only for elemental damages? RE: Changing the damage calculation - Extreme - 09-13-2013 02:37 AM Go to sphere.ini and set on EventsPlayer=E_COMBAT PHP Code: [EVENTS E_COMBAT] RE: Changing the damage calculation - RanXerox - 09-13-2013 02:53 AM There are problems with that code example that Extreme posted: Player A casts clumsy (which has spellflag_harm but not spellflag damage) on player B Player B gets TAG.HITBYSPELL=1 but because no damage was dealt, @GetHit is not triggered Player C walks over and hits Player B with a sword Player B still has TAG.HITBYSPELL=1 so the sword hit results in the "magic damage calculation" instead of "physical damage" |