Implements transformation mechanic as a spell effect.
Implements transformation mechanic as a spell effect.
; The creature it transforms into. Accepts ANY_CREATURE for random but evil will stay evil and good will stay good.
Transform = NULL
Example spell to replace the unused SPELL_LIZARD:
[spell29]
; Transform the user into a Fly for 15 seconds.
Name = SPELL_TRANSFORM
CastAtThing = 0
ShotModel = NOSHOT
SpellPower = NOPOWER
; Set duration to 0 to make the transformation permanent.
Duration = 300
AuraEffect = EFFECT_TINY_SPARKS
AuraDuration = 300
AuraFrequency = 4
Transform = FLY
SelfCasted = 1 25 1
SymbolSprites = 768 770
Example instance:
; This example is for possession only but can be set to be cast under specific conditions using 'ValidateSourceFunc', 'ValidateTargetFunc', and 'SELF_BUFF'.
[instance54]
Name = TRANSFORM
Time = 10
ActionTime = 10
ResetTime = 1200
FPTime = 3
FPActionTime = 3
FPResetTime = 1200
FPInstantCast = 0
ForceVisibility = 100
TooltipTextID = 201
SymbolSprites = 434
Graphics = SCREAM
PrimaryTarget = 3
Properties =
Function = creature_cast_spell SPELL_TRANSFORM 0
The mechanic can also be used offensively. For example, assigning SpellEffect = SPELL_TRANSFORM to a shot will transform the target!
This is built on top of https://github.com/dkfans/keeperfx/pull/3821, as it uses the function get_random_appropriate_creature_kind.
Therefore, https://github.com/dkfans/keeperfx/pull/3821 should be merged first.
Please, can you make some sample for "automatic" and for offensively mode? Thank you!
@benlp91 do not mark it ready as review, PR isn't finished and there is a build error now, I will fix later.
Please, can you make some sample for "automatic" and for offensively mode? Thank you!
You just need to give the instance SELF_BUFF with correct ValidateSourceFunc & ValidateTargetFunc to make them use it "automatically", example:
Properties = SELF_BUFF
ValidateSourceFunc = validate_source_generic 0 0
ValidateTargetFunc = validate_target_benefits_from_offensive 0 0
As for the offensive you just need to give to a shot the SpellEffect:
[shot1]
Name = SHOT_FIREBALL
SpellEffect = SPELL_TRANSFORM
Try to add this line SpellEffect = SPELL_TRANSFORM to SHOT_FIREBALL.
In draft, there is more situations to check for original model.
I think I changed everything that should look for original model, let me know if you think of a specific situation this PR doesn't handle yet.