OpenMeridian105 / Meridian59

The MMORPG Meridian 59 - Server 105
https://www.meridiannext.com
Other
16 stars 16 forks source link

Starting point for Martyr's Grace #334

Closed MorbusM59 closed 7 years ago

MorbusM59 commented 7 years ago

Sha AE heal that restores mana and costs HPs.

skittles1 commented 7 years ago

Couldn't cast this as an immortal, as I can attack everyone so it didn't have any valid targets. It does work as expected otherwise, although if you are white and have safety off you are unable to heal other innocents (safety checked in AllowBattlerAttack).

I think the no-targets message might need a little more function and little less RPG to inform players that there aren't any valid targets. Maybe we should be giving separate messages here for "no players at all in range" and "players are in range, but not valid targets" though I'm not sure if GetTargets is the ideal place to display that (I would probably duplicate the line of sight/field of view check in CanPayCosts and return the no-targets msg in that case).

Also this is quite powerful - maybe 75 or 100 training point cost?

MorbusM59 commented 7 years ago

All valid points, gonna get to work on them. :) Thanks!

MorbusM59 commented 7 years ago

Name: Martyr's Grace School: Shal'ille Rank: 6 General functionality: The spell heals allies at the cost of your own health. It does not cost mana and will refund mana based on health sacrificed. Allies have to be within line of sight (but not necessarily viewed by the caster). The spell invokes a 5 second post cast delay. It costs one polished seraphym to cast and 100 TP to train.

Details: Targets - The spell won't heal outlaws or murderers under any circumstances. It will also not heal people that the caster can attack if they can also attack the caster. This includes two whites having saftey off, while a white with safety off can heal another white who has it on and vice versa.

Healing - The spell first calculates a health pool based on the caster's current health, his SP and his karma (60 to 100). At max karma and SP, the pool's size is doubled. It will then distribute that health among injured allies. If the pool is large enough to heal all wounds, all wound are healed. If it can only cover a percentage of all injuries, each allies missing health will be restored by the same percentage. The health pool will only use 90% of the caster's max health, leaving them with a minimum of 10% of their maximum HPs after a cast.

Example 1: Caster has 100 health, max karma and SP. Three allies with 100 max health have 25, 50 and 75 HPs for a total of 150 missing health. The caster's health pool is 1000.92 = 180 HPs. The caster will be able to restore all of his allies health, sacrificing 90*(150/180) = 75 health, leaving them with 25 HPs after the cast.

Example 2: Caster has 150 of 150 health, 80 karma and casts at 80SP. He tries to heal his 6 guildies at 110, 110, 110, 110, 110 and 30 health (out of 150). All in all, we are looking at 540+120 = 320 missing health. The caster's health pool is 1500.9*(50+80)/100 = 175 HPs. [50 because 80 Karma is halfway between the 60 karma that are required to cast the spell and max karma.]

That means that he can heal 175/320 = 54% of each ally's missing health while sacrificing his entire health pool of 135 HPS (90% of his max health). The spell restores 21 health to 5 of his 6 allies and 65 health to his most wounded ally. If all of his allies had 150 HPs, they were at 110, 110, 110, 110, 110 and 30 health before the spell and at 131, 131, 131, 131, 131 and 95 health after the cast. The caster went from 150 to 15 health.

Mana - The caster gains between 0% and 25% of the health sacrificed as mana depending on spellpower and karma.

Example 1: In the first example, the caster sacrificed 75 health and gains 18 mana (25%) as he has max SP and karma.

Example 2: In the second example, the caster sacrificed 135 health and gained back 22 mana (16%).

Visual feedback - Different messages tell the caster why the spell can't be cast. a) No players in sight: "Your matyrdom would be quite pointless with no one around to see it." b) No allies in sight: "You are quite sure that none of the despicable creatures around you are worthy of your matyrdom." c) Allies are at full health: "All of your allies seem to be perfectly healthy. You might want to reconsider your matyrdom."