Guest morpheus562 Posted May 1, 2023 Share Posted May 1, 2023 (edited) I'm having a damned of a time with opcode 321 not removing the effects added by opcode 326. Getting the bonus to apply is easy. Getting it to remove is another story. EDIT: I guess I could just forego opcode 321 and instead just cast a new spell that does the opposite of whatever benefits the set bonuses provide. EDIT 2: Thanks to the wonderful help of @Bubb it was identified as a timing issue. It now works as desired, and multiple items can now be added together to form sets, regardless of set size. Additionally, there are no issues with saves/loading that impacts the set bonuses. Edited May 1, 2023 by morpheus562 Quote Link to comment
Guest morpheus562 Posted May 2, 2023 Share Posted May 2, 2023 (edited) Balduran Set has potentially 5 different items that can be combined together for set bonuses (including the cloak in BG2EE as some mods add it). This means, I can award bonuses if a character has 2 pieces, 3 pieces, 4 pieces, and 5 pieces of the balduran set equipped. I think I know how to make this work via scripting, and if my plan works then it will really allow me to iterate some fun combos for other sets that have more than 2 pieces. (E.g. 2 pieces gives +10hp, 3 pieces gives the bonus from the 2 piece combo AND gives x ability, and so on). EDIT: It works! Edited May 2, 2023 by morpheus562 Quote Link to comment
mickabouille Posted May 2, 2023 Share Posted May 2, 2023 (edited) Including the butter knife ? EDIT: Ah, no! It's not equipable, sorry. Edited May 2, 2023 by mickabouille Quote Link to comment
Guest morpheus562 Posted May 2, 2023 Share Posted May 2, 2023 (edited) Here is the code for transparency and awareness. This shows covering all combinations of a 5 piece armor set with bonuses at 2, 3, 4, and 5 pieces equipped. The last example is for just a 2 piece set. The one script will handle all item sets. Spoiler // BALDURAN SET ---------------------------------------------------------// // No Set IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",0) ApplySpellRES("MOSET1C",Myself) // Remove Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END // 2 Piece IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",1) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1F",Myself) // Remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END // 3 Piece IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",2) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1I",Myself) // Remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END // 4 Piece IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran !HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",3) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran !HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",3) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran !HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",3) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran !HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",3) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END IF !HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",3) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1L",Myself) // Remove Balduran 5 Piece Set Bonus END // 5 Piece IF HasItemEquiped("CLCK05",Myself) // Cloak of Balduran HasItemEquiped("HELM07",Myself) // Helm of Balduran HasItemEquiped("WA2PLAT",Myself) // Plate of Balduran HasItemEquiped("WA2S1H",Myself) // Sword of Balduran HasItemEquiped("WA2SHIEL",Myself) // Plate of Balduran !Global("MO_BalduranSet","LOCALS",4) THEN RESPONSE #100 SetGlobal("MO_BalduranSet","LOCALS",4) ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1H",Myself) // Add Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1J",Myself) // Add Balduran 5 Piece Set Bonus END // ELVENKIND SET --------------------------------------------------------// // 2 Piece IF HasItemEquiped("BOOT07",Myself) // Boots of Elvenkind HasItemEquiped("clck23",Myself) // Cloak of Elvenkind Global("MO_ElvenkindSet","LOCALS",0) THEN RESPONSE #100 SetGlobal("MO_ElvenkindSet","LOCALS",1) ApplySpellRES("MOSET2A",Myself) // Add Elvenkind Set Bonus END IF OR(2) !HasItemEquiped("BOOT07",Myself) // Boots of Elvenkind !HasItemEquiped("clck23",Myself) // Cloak of Elvenkind Global("MO_ElvenkindSet","LOCALS",1) THEN RESPONSE #100 SetGlobal("MO_ElvenkindSet","LOCALS",0) ApplySpellRES("MOSET2C",Myself) // Remove Elvenkind Set Bonus END Edited May 2, 2023 by morpheus562 Quote Link to comment
jmerry Posted May 2, 2023 Share Posted May 2, 2023 While I can see what your script is doing there ... why do the auto-generated comments think the shield is named "Plate of Balduran"? Quote Link to comment
Guest morpheus562 Posted May 2, 2023 Share Posted May 2, 2023 (edited) Because I mistyped it. I copied from the baf file that gets converted into a bcs file upon install. Good catch! Edited May 2, 2023 by morpheus562 Quote Link to comment
pete_smith1229 Posted May 2, 2023 Author Share Posted May 2, 2023 Just thinking out loud to avoid writing out all the possible armor combinations...could you add opcodes "Modify global variable (265)" or "Modify local variable (309)" to each of your armor pieces and have it increment the variable value. Then in the script, check for the variable value and apply the relevant number of spell resources. Something like: // 2-set IF Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus END // 3-set IF Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus END // etc Quote Link to comment
Guest morpheus562 Posted May 2, 2023 Share Posted May 2, 2023 (edited) 22 minutes ago, pete_smith1229 said: Just thinking out loud to avoid writing out all the possible armor combinations...could you add opcodes "Modify global variable (265)" or "Modify local variable (309)" to each of your armor pieces and have it increment the variable value. Then in the script, check for the variable value and apply the relevant number of spell resources. Something like: // 2-set IF Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus END // 3-set IF Global("MO_BalduranSet","LOCALS",3) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1E",Myself) // Add Balduran 3 Piece Set Bonus END // etc You're welcome to do something like that if you desire. That may be an easier path but the way above does work. Edit: isn't there also a cap to how many stats can be listed in stats.ids? Depending on the number of item sets one wishing to create, this could pose an issue. Edited May 2, 2023 by morpheus562 Quote Link to comment
pete_smith1229 Posted May 2, 2023 Author Share Posted May 2, 2023 25 minutes ago, morpheus562 said: You're welcome to do something like that if you desire. That may be an easier path but the way above does work. Edit: isn't there also a cap to how many stats can be listed in stats.ids? Depending on the number of item sets one wishing to create, this could pose an issue. Don't know about the cap. I can get the buff to activate when equipping the armor but it doesn't get removed when unequipping. Thought this way would make life easier for everyone but will need to work on it to see if it's doable. Will test more tomorrow. Quote Link to comment
Endarire Posted May 3, 2023 Share Posted May 3, 2023 Why is Plate of Balduran mentioned twice but not the Shield of Balduran? Quote Link to comment
lynx Posted May 3, 2023 Share Posted May 3, 2023 Stats are not variables and vice versa. Were you trying with something like this @pete_smith1229? IF Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 5 Piece Set Bonus END Quote Link to comment
pete_smith1229 Posted May 3, 2023 Author Share Posted May 3, 2023 1 hour ago, lynx said: Stats are not variables and vice versa. Were you trying with something like this @pete_smith1229? IF Global("MO_BalduranSet","LOCALS",2) THEN RESPONSE #100 ApplySpellRES("MOSET1A",Myself) // Add Balduran 2 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 3 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 4 Piece Set Bonus ApplySpellRES("MOSET1A",Myself) // remove Balduran 5 Piece Set Bonus END Thanks, that looks more like what I was trying to achieve late last night! I'll test this when I have time and let you know if it works! Quote Link to comment
pete_smith1229 Posted May 3, 2023 Author Share Posted May 3, 2023 So I'm toying with "Modify local variable (309)", Value=1, Modifier=1, timing mode = 2. This effect is added to each armor piece and when equipping the armor, the set bonus occurs once a certain value is reached. However, when un-equipping an armor piece, the variable value doesn't seem to decrease. The bonus remains.... Is it possible for the variable to only take effect when the armor is equipped using opcode 309? Quote Link to comment
lynx Posted May 3, 2023 Share Posted May 3, 2023 Like IESDP states, the effects are only there as an interim and for saves, they're not being constantly applied. In other words it fires immediately and doesn't care whether the piece is equipped or not. So I don't think this approach is salvageable- I suggest you use a useless stat instead, for example NPC_BUMP (on by default for pcs). And then CheckStat in the script. https://gibberlings3.github.io/iesdp/opcodes/bgee.htm#op300 Quote Link to comment
subtledoctor Posted May 4, 2023 Share Posted May 4, 2023 16 hours ago, pete_smith1229 said: However, when un-equipping an armor piece, the variable value doesn't seem to decrease. The bonus remains... Yeah I don’t think local variables can be set with timing mode 2. What you could, maybe, is have a separate effect that uses op321 or op309 to reduce the variable value upon unequipping the item But that might require the use of repeating effects… and then you’re back in the realm where you don’t need any of this and can do the whole thing with op206. If it’s something that needs to be checked by op318/324/326 (but not scripts), you can use a proficiency with op233 instead. If it’s something that needs to be checked by scripts, you can use a spellstate. (But spellstates only have values of 0 or 1, and the game only has space for 255 spellstates.) 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.