pete_smith1229 Posted December 29, 2022 Share Posted December 29, 2022 I would like to create a quick item (e.g. wand) which will have a specific charge ability based on the character's class. For example, if a priest equips the wand, the ability could be "Cure Light Wounds"; if a mage equips the wand, the ability could be "Magic Missile". How would one create a global script that's tied to the item? I noticed there is the "BALDUR.BCS" file which has a lot of global variables, would this be the best place to store the logic (if the logic is indeed possible)? Quote Link to comment
jmerry Posted December 30, 2022 Share Posted December 30, 2022 CheckItemSlot() triggers and TransformItem() actions to swap out different versions of your item based on class. I don't see any way to do it based on a single ITM. One block for each combination of ITM and player number. What's the point of baldur.bcs? It's a script that's always active in the BG1 and SoA campaigns, and it's the only such script. For SoD, bdbaldur.bcs fills that role. For ToB, baldur25.bcs does. Oddly, a self-targeted ability that varies based on the caster's class can be easily done with no scripting at all - opcode 326 for the win. Quote Link to comment
subtledoctor Posted December 30, 2022 Share Posted December 30, 2022 (edited) You can do this with opcode 326 regardless of target, the problem is that the ability icon and description/tooltip would not change. Only way to do that is to literally change out the item for a different one when equipped as @jmerry suggested. Edited December 30, 2022 by subtledoctor Quote Link to comment
jmerry Posted December 30, 2022 Share Posted December 30, 2022 Really? ... (checks IESDP) Unlike opcode #146, when targeting Self or Original Caster, the resource is still cast on the ability target, not the caster. Now that's convenient. OK, that's the best way to do it. Set up an ability targeting any creature, then the ability has several opcode 326 effects targeting self, each testing the caster's class and casting a spell on the original target if the class matches. Quote Link to comment
pete_smith1229 Posted January 1, 2023 Author Share Posted January 1, 2023 @jmerry@subtledoctor Brilliant, the suggestion of using opcode 326 works (so many conditions to choose from...). Thank you both! The last thing is to update the tooltip and icon dynamically using the CheckItemSlot() and TransformItem() functions as was suggested earlier. I'll do a search on this forum and see if there's any existing examples of using these functions and how the scripts should be activated. Quote Link to comment
Recommended Posts
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.