Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] SPELLFLAG_ONLYSELF #1171

Closed
canerksk opened this issue Oct 29, 2023 · 6 comments
Closed

[Feature Request] SPELLFLAG_ONLYSELF #1171

canerksk opened this issue Oct 29, 2023 · 6 comments

Comments

@canerksk
Copy link
Contributor

canerksk commented Oct 29, 2023

There is a spell flag for SPELLFLAG_TARG_NOSELF, in addition to spells that will only be allowed to be cast on ourselves, another flag like SPELLFLAG_TARG_ONLYSELF can be added.

Note: When we remove all the spell flags of the spell, the target does not appear in the spell and we can only apply it directly to ourselves, but then the spell effects do not appear.

@canerksk canerksk changed the title [Feature Request] [Feature Request] SPELLFLAG_ONLYSELF Oct 29, 2023
@xwerswoodx
Copy link
Contributor

xwerswoodx commented Oct 30, 2023

Honestly we already have that, if you don't give any targ flag, the spell automatically cast on yourself directly,

eq;

[SPELL 44]
// NOTE: Used primarily to regain mana while fighting or cast helpful spells without incurring attack. Duration should reflect the non-offensive use of this spell
DEFNAME=s_invisibility
NAME=Invisibility
SOUND=snd_spell_invisibility
RUNES=ALX
CAST_TIME=1.8
RESOURCES=i_reag_blood_moss,i_reag_nightshade
RUNE_ITEM=i_rune_invisibility
SCROLL_ITEM=i_scroll_invisibility
FLAGS=spellflag_dir_anim|spellflag_good
EFFECT_ID=0
EFFECT=0
LAYER=layer_spell_invis
DURATION=3*60.0,5*60.0
MANAUSE=20
SKILLREQ=MAGERY 60.0
INTERRUPT=100.0,100.0
ON=@Effect
   FLAGS &= ~statf_hidden

If you cast invisibilty with that flags, you can see it cast on himself directly. You just need to remove targ flags from spells to make it only self-cast.

@canerksk
Copy link
Contributor Author

canerksk commented Oct 30, 2023

This may happen for spells without effect_id, but for spells with effect_id, removing all targeting flags will cause the spell effect to not occur at all. eg; protection spell or reactive armor spell

@cbnolok
Copy link
Contributor

cbnolok commented Apr 22, 2024

Couldn't this be solved by using effect_id also if there's not a target flag?
Edit, to be more clear: i mean, making sphere consider and use effect_id also if there's not a target flag

@xwerswoodx
Copy link
Contributor

xwerswoodx commented Apr 26, 2024

Couldn't this be solved by using effect_id also if there's not a target flag? Edit, to be more clear: i mean, making sphere consider and use effect_id also if there's not a target flag

Honestly I haven't deeply checked this, but effect id not trigger when you don't have targ flag, but if you think flag is unnecessary, I could take a look on it more deeply in couple of hours to see why effect id not trigger when player not using target.

@xwerswoodx
Copy link
Contributor

Okay as I tested a bit and take a look for it, seems like SPELLFLAG_FX_TARG flag enough for effect. We don't need spellflag_targ_onlyself, I revert back the update and update the pr.

@cbnolok
Copy link
Contributor

cbnolok commented Sep 10, 2024

Closing as the feature is already there, as commented.

@cbnolok cbnolok closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants