Jump to content

Cursed flag breaks on hit polymorph effect. Looking for workaround


Recommended Posts

I have an item I designed called Blackweb Fang, a cursed Spear.  One of its effects is that on strike it has a chance of temporarily polymorphing the user into a Spider that is very similar to the Sword Spider form granted by the Avenger druid class.  This effect is timed and lasts for 5 rounds.

The item works perfectly when the cursed flag isn't set on the spear's itm file, but when it is it the on hit effect puts the character into a glitched in between state - the character does not polymorph and does not gain the effects of the polymorph "weapon" but the characters attack icons do change to that of the polymorph weapon.

The way Sword Spider transformation and my own version of it work is via opcode #111 Create weapon.  This creates an item which temporarily overwrites the attack icons and applies the polymorph effect.

 

I am looking for a work around, as I have designed this weapon with the idea that it would be a cursed item.  The idea story wise is that it is actually a parasitic life form that attempts to merge with its wielder or "host."  Game balance wise the item is very powerful - definitely the most poweful spear in the game though this is intended and not a high bar to clear.  However, I think the commit of it being a cursed weapon mitigates some of the overpoweredness and encourages creative use of the item.

 

I've thought about making the on hit effect also remove the curse, but that unequips the item and I don't like the idea of it causing inventory overflows, so even if I figured out a way to force them to re-equip it after the duration expires I'm not sure that's a good idea.  The other idea I had is to somehow make a "false curse" effect that plays the sound and prevents the user from unequipping somehow, but does not use the curse flag.

 

Thank you for your time and for providing any suggestions you may have.

 

Thanks,
DoubleBrew

Edited by dbianco87
Link to comment
On 8/1/2023 at 3:07 PM, jmerry said:

Here's an idea: don't change the weapon. Have the shapeshifted form still use the spear (including icon, unfortunately) for its attack.

Thanks for the suggestion.  Unfortunately polymorph doesn't seem to work properly with limited timing modes - the createweapon work around seems to be ubiquitous for polymorph affects in the game.  When I try to make a temporary polymorph without using creat weapon the transformation becomes very glitchy.  It's not even consistent, sometimes the transformation is permanent, and sometimes it doesn't work at all.

It kind of wouldn't work anyway though with how I have the spear designed.  The spider form has it's own attack style and procs including "spider frenzy" which applies improved haste for 9 seconds but also makes the spider form go berserk for 3 rounds.

Link to comment
5 hours ago, dbianco87 said:

It kind of wouldn't work anyway though with how I have the spear designed.  The spider form has it's own attack style and procs including "spider frenzy" which applies improved haste for 9 seconds but also makes the spider form go berserk for 3 rounds.

I'm kind of reaching here (there probably isn't a good solution) but you could treat the spider transformation similar to the Spirit Warrior challenge in watcher's keep, i.e. the spider is a separate creature but still tied to the wielder.

  • Your spear would have a chance of summoning a spider statted out however you like - which would be initially invisible - and its script would instruct it to: PolymorphCopy(LastSummoneOf(Myself)) then Polymorph(SPIDER_WRAITH), or whatever you want it to look like
  • The wielder would be placed under a fake maze effect through #271 and #100 versus everyone, plus #101 vs 12 etc. to be safely hidden away for the duration the spider is active.
  • If the spider dies the wielder's fake maze state ends (AoE removal by a spell on death script) and dies too, or drops to 1 hp like the harm spell, if you'd prefer.
Link to comment

Maybe RemoveItem (Spear) -> CreateMagicalItem (Spider item)-> CreateItemInSlot (spear) after duration could work, but the downside would be that if something else is equipped in the targeted slot, it would be destroyed I think. edit: possibly opcode 264 on equip can address that, not sure 

Edited by Allbrother
Link to comment
20 hours ago, Allbrother said:

Maybe RemoveItem (Spear) -> CreateMagicalItem (Spider item)-> CreateItemInSlot (spear) after duration could work, but the downside would be that if something else is equipped in the targeted slot, it would be destroyed I think. edit: possibly opcode 264 on equip can address that, not sure 

In my experience the #143 opcode is bugged and problematic to the extent that I'd only use it on creatures outside the party, usually to grant a "bundle" of abilities or protections that can then be detected by the simple scripting trigger HasItem() rather than needing an associated detectable spell state and also be removed via DestroyItem() instead of requiring a secondary spell with sectype removal (for original BG2) or #321 (for EE).

Link to comment

Another idea, rather than setting the cursed flag on the spear itself have it apply a spell on equip - noncumulative when switched - that is removable by Remove Curse (easy on EE or use a lot of #283 effects otherwise) and which:

  1. Restricts by #181 the type of weapon usable to Spears category & Hand to Hand (which would presumably include the magically created spider weapon)
  2. Alternatively, by melee hit effect #248 ensures a possibility thereafter of transforming into the spider whenever attacking in melee, regardless of weapon used
  3. Both of the above, which would be very close to the implementation you initially posted (can't use weapons other than spears until curse is removed, probably wouldn't use a different spear anyway, risks transformation whenever fighting)
Link to comment
On 8/7/2023 at 2:10 AM, polytope said:

Another idea, rather than setting the cursed flag on the spear itself have it apply a spell on equip - noncumulative when switched - that is removable by Remove Curse (easy on EE or use a lot of #283 effects otherwise) and which:

  1. Restricts by #181 the type of weapon usable to Spears category & Hand to Hand (which would presumably include the magically created spider weapon)
  2. Alternatively, by melee hit effect #248 ensures a possibility thereafter of transforming into the spider whenever attacking in melee, regardless of weapon used
  3. Both of the above, which would be very close to the implementation you initially posted (can't use weapons other than spears until curse is removed, probably wouldn't use a different spear anyway, risks transformation whenever fighting)

I really like this solution.  I'm going to experiment a bit today.  Thanks for all of your help, you've come up with a lot of interesting ideas.  the way I have the spider form setup uses spears already, so I think this will work well.

Edited by dbianco87
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...