Constantine Posted March 14, 2010 Share Posted March 14, 2010 Hi, I'm trying to create an item with the 'while equipped' passive effect that will cast a spell on self when a certain condition is met (via #232 Cast Spell on Condition). Here is the question: how to make this spell to trigger only once (once per day, maybe), not constantly triggering while the specific condition mentioned above is still in effect? Link to comment
Miloch Posted March 15, 2010 Share Posted March 15, 2010 Eh, I dunno... mixing "while equpped" and "cast spell on condition" are kinda like trying to mix oil and water. You probably need to use .eff files or something, but it's kinda hard to say without knowing more about what you're trying to do. Link to comment
Constantine Posted March 15, 2010 Author Share Posted March 15, 2010 Eh, I dunno... mixing "while equpped" and "cast spell on condition" are kinda like trying to mix oil and water. You probably need to use .eff files or something, but it's kinda hard to say without knowing more about what you're trying to do. I wanted to make an item that, while equipped, would summon an allied animal to aid PC in battle when PC's health drops below 50%. I actually managed to do it via #232 and #206 opcodes, but I'm not entirely satisfied with the result Link to comment
lroumen Posted March 16, 2010 Share Posted March 16, 2010 You'll constantly trigger the effect if the condition is true unless you set a percentage to it. With a percentage you still have the same chance that you get a second occurrence very soon after one another. A one-time thing can probably only be accomplished through adding a script in the matter. Instead of the summoning spell on condition use a spell that sets a global variable. Then have a scriptblock check for the global and have the script handle the creature summoning (forcespell or whichever you prefer). With a timer attached to the summoning block you can delay the triggering of the block for a certain amount of time before you allow it again (1 hour, 1 day?). This timer should probably be a second global because the first keeps being overwritten by your item. You only have to be careful with the default value of the first global (of the item) because it will probably be triggered quite often. You may want to set it to a default value when the combat trigger is off or something (or reset it to a default value every few rounds or hours). The reason is that when you're below 50% health the weapon will trigger the global and if you do not change the global afterwards, your timer ran out AND you meet your condition even outside of combat, you summon your creature which may not be what you want. Not sure on how to handle this last bit in a more elegant manner, but I gave my suggestion above. I think your creativity will probably be better. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.