Jump to content

Checking if enemies in LoS during spell cast?


SparrowJacek

Recommended Posts

Hello,

 

Let's assume I want to make my version of Hide in Shadows. I want it to have lower chance of success if my Thief sees enemies (or they see him). Sadly the only official check in opcodes works per round, not per spell cast (cast spell on condition). How would you achieve such behavior? Since that's not possible, then some spellstate and opcode 326 would be probably the best solution, but I still have some problems with that...

 

The easiest way would be to fire a script every time the spell is cast, however it looks like #298 (0x12A) Spell Effect: Execute Script cut250a has some hardcoded cutscene start functionality, which makes the UI disappear for a split second and I found no way to go around that.

I also thought of some subspell with "out of combat" flag set to true, but if it's a subspell, then this flag is skipped I think and the spell is cast anyway.

So are there any better options than patching global script, or all AI scripts, or all location scripts to apply some spellstate ("Seen") to all of my characters? Such state also has to be active for some time and reapplied when its about to expire, if we're still visible, that's pretty messy.

Link to comment

Actually, now I thought of another interesting idea. As you can see, I want to enable some form of Hide in Plain Sight for Thieves, so that they still have some chance of hiding if enemies are nearby (and I plan to add other stuff based on how much Hide in Shadows skills you have). Maybe I could make this version of Hide in Shadows also cast a spell which works as an AoE spell targetting only enemies and having extremely fast projectile or "hit immediately" flag is on (so it's almost instantaneous) and if it hits some enemies, then each of them has a chance to dispel it (again, based on player's Hide in Shadows skill, the more you have, the less likely the enemy is to dispel it). 

 

I think this should work fine without introducing additional Spell States and using scripts to apply them, what is your opinion on that?

Edited by SparrowJacek
Link to comment

This all seems quite complicated TBH and I’m not sure what the desired outcome is. I don't get how it would work to become hidden when you're standing right in front of someone, unless it’s a supernatural ability like that of a Shadowdancer. Seems more like the area covered by illusion magic. (And the game already has approximately 1,000,000 invisibility potions for thieves to use…)

As far as implementation, I think hiding always fails when enemies can see you so you probably have to apply an invisibility effect. You could just give thieves an innate invisibility power that uses op326 for its success to be dependent on your MS+HiS skills. Make it less likely to succeed so that when you’re out of combat you are better off using the normal HiS button. 

Link to comment

I need Thieves to become more powerful for our mod (Improved Anvil) and hiding in shadows is their primary class ability, so I'd like to focus on that.

Sadly there is no way to rework the original Stealth, which is triggered by a button, so what I am planning to do is to introduce an innate ability, that has unlimited number of uses (like Pocket Plane) and encapsulates Stealth logic with all my improvements. 

The most important thing I want to achieve is make Hide in Shadows thieving skill more important, so that players really want to put points in it up till 250. For that I want to make very skilled Thieves be able to Hide in Plain Sight (whatever the rationale, enemies can be distracted and Thieves can use that single moment of distraction to vanish, it's a magical world, where monks can kill a dragon with 1 hit, so it's not too far fetched). But hiding in front of enemies should be obviously harder and should require higher Hide in Shadows skill. That's what I want to simulate, by somehow checking if enemies are nearby. 

So my current plan is that when you use that new Stealth, you cast a spell with AoE and range equal to visual sight range, that works instantaneously and works only on enemies, then through opcode 326 the value of Hide in Shadows is checked and based on that each enemy has some chance to "see" the Thief, which dispels the invisibility and all its benefits. That's probably the easiest way to achieve that, though this thread was created to check if you have any other ideas of how to achieve that, as I'm really a beginner in terms of modding, so any help or constructive critique of my ideas would be very appreciated :)

Regarding thousands of potions that could do the same - I want the Thief to be able to use the ability more often than once per round if he has high enough HiS or proper items, so he can backstab more often even without "Assassinate" HLA. I also want this new Stealth to add some bonuses, that aren't available if you disappear by drinking an Invisibility Potion or get Invisibility cast on you.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...