argent77 Posted October 13, 2023 Author Share Posted October 13, 2023 (edited) 13 minutes ago, Morgoth said: Am I wrong, or you didn't use the method highlighted here? Yes, it basically addresses the issue mentioned in the linked post. Edited October 13, 2023 by argent77 Quote Link to comment
Jarno Mikkola Posted October 13, 2023 Share Posted October 13, 2023 7 minutes ago, argent77 said: Yes, it basically addresses the issue mentioned in the linked post. Have you looked at what DavidW has done in the Troll component of the SCS ? Quote Link to comment
argent77 Posted October 13, 2023 Author Share Posted October 13, 2023 53 minutes ago, Jarno Mikkola said: Have you looked at what DavidW has done in the Troll component of the SCS ? I have now. There are certainly different ways how to implement the regeneration behavior of trolls. Quote Link to comment
Galactygon Posted October 13, 2023 Share Posted October 13, 2023 On 10/11/2023 at 3:11 PM, argent77 said: Relevant WeiDU code: Reveal hidden contents // Intermediate filter spells ACTION_DEFINE_ASSOCIATIVE_ARRAY reg_spl BEGIN // original SPL resref, cur. HP => intermediate SPL resref "trollreg", 12 => "#trollrg" "cdhgtrl", 12 => "#cdhgtrl" "cdtrlblz", 12 => "#cdtlblz" "cdtorgal", 12 => "#cdtorgl" "cdiwdtr1", 10 => "#cdidtr1" "cdiwdtr2", 10 => "#cdidtr2" END ACTION_PHP_EACH reg_spl AS keys => resref2 BEGIN OUTER_SPRINT resref1 $keys("0") OUTER_SET cur_hp = $keys("1") COPY_EXISTING "%resref1%.spl" "override/%resref2%.spl" LPF DELETE_SPELL_EFFECT INT_VAR opcode_to_delete = "-1" // all effects END LPF ADD_SPELL_EFFECT INT_VAR opcode = 318 // Protection from resource target = 1 // Self parameter1 = cur_hp parameter2 = 144 // STAT CURHITPOINTS >= [parameter1] STR_VAR resource = EVAL "%DEST_RES%" END LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 // Cast spell target = 1 // Self parameter2 = 1 // Cast instantly (caster level) timing = 1 // Instant/Permanent until death STR_VAR resource = EVAL "%SOURCE_RES%" END IF_EXISTS END // Regeneration items ACTION_DEFINE_ASSOCIATIVE_ARRAY reg_itm BEGIN // ITM resref => Intermediate SPL resref "trollreg" => "#TROLLRG" "cdhgtrl" => "#CDHGTRL" "cdtrlblz" => "#CDTLBLZ" "cdtorgal" => "#cdtorgl" "reg1hp2" => "#CDIDTR1" "cireve" => "#CDIDTR2" END ACTION_PHP_EACH reg_itm AS resref1 => resref2 BEGIN COPY_EXISTING "%resref1%.itm" "override" LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 232 // Cast spell on condition target = 1 // Self timing = 2 // While equipped parameter2 = 11 // TookDamage() / instant STR_VAR resource = EVAL "%resref2%" END BUT_ONLY IF_EXISTS END Good change. Due to the auto-pause bug, a more robust way is to fully embed it inside a 326 (p2=145, p1=2) rather than placing a 318 protection in front of the cast spell effect. The SPLPROT.2da entry is already there in all IE games. Quote Link to comment
argent77 Posted October 13, 2023 Author Share Posted October 13, 2023 16 minutes ago, Galactygon said: Good change. Due to the auto-pause bug, a more robust way is to fully embed it inside a 326 (p2=145, p1=2) rather than placing a 318 protection in front of the cast spell effect. The SPLPROT.2da entry is already there in all IE games. Good point. Will be fixed. Quote Link to comment
Luke Posted October 13, 2023 Share Posted October 13, 2023 (edited) 56 minutes ago, Galactygon said: Good change. Due to the auto-pause bug, Are you saying the auto-pause bug also affects casting from opcode...? I thought it only triggered when the player casts a spell... Edited October 13, 2023 by Luke Quote Link to comment
argent77 Posted October 13, 2023 Author Share Posted October 13, 2023 Any pause can trigger the bug. I haven't tested it, but auto-pause option "Weapon unusable" could trigger at the same time when this spell effect is executed. 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.