Miloch, I can't understand Your last post, what's not wright?
BEGIN ~Gradually melting heavy armor~
ACTION_FOR_EACH ~item~ IN
//splint
// ~C2VALY01~
~CHAN17~
~CHAN20~
~PLAT18~
~CHAN04~
~CHAN05~
~CHAN18~
~ICHAN04~
// ~VISCHAN2~
~BAND01~
~BAND02~
~BAND03~
~BAND04~
//plates
// ~C2PLAT01~
// ~DeITM088~
~IPLAT01~
~PLAT01~
~PLAT02~
~PLAT06~
~PLAT07~
~PLAT08~
~PLAT10~
~PLAT11~
~PLAT12~
~PLAT13~
~PLAT17~
~PLAT98~
~PLAT99~
// ~VISPLAT1~
//field plates
~FLAT01~
~FLAT02~
~FLAT03~
~FLAT04~
//full plates
// ~BRUENPLA~
// ~C2KELD01~
~CHALARM~
// ~DeITM086~
// ~DeITM090~
// ~DeITM096~
// ~DWPLAT01~
~NPPLAT~
~PALPLAT~
~PLAT04~
~PLAT05~
~PLAT09~
~PLAT14~
~PLAT15~
~PLAT16~
~PLAT19~
~PLAT20~
~PLAT21~
~PLAT22~
~PLAT23~
// ~SECRET05~
// ~VISPLAT2~
~WA2PLAT~
// ~CBBDARMR~
BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~%item%.itm~ THEN BEGIN
COPY_EXISTING ~%item%.itm~ ~override/3%item%.itm~
~%item%.itm~ ~override/1%item%.itm~
~%item%.itm~ ~override/2%item%.itm~
~%item%.itm~ ~override/%item%.itm~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_ASCII 0x22 ~anim~ (2)
// PATCH_IF (~%anim%~ STRING_COMPARE_CASE ~[cC][0-1]~ = 0) BEGIN // armor anims
// END
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "%item%" = 0) BEGIN // if original
READ_LONG 0x6A "fx_offset"
READ_SHORT 0x70 "fx_number"
//for testing, if U don't like it, comment
INSERT_BYTES ("%fx_offset%" + ("%fx_number%" * 0x30)) 0x30
WRITE_SHORT ("%fx_offset%" + ("%fx_number%" * 0x30)) 232 // cast on condition
WRITE_BYTE ("%fx_offset%" + 0x02 + ("%fx_number%" * 0x30)) 1 // target self
WRITE_LONG ("%fx_offset%" + 0x04 + ("%fx_number%" * 0x30)) 0 // on caster
WRITE_LONG ("%fx_offset%" + 0x08 + ("%fx_number%" * 0x30)) 0 // when hited
WRITE_BYTE ("%fx_offset%" + 0x0c + ("%fx_number%" * 0x30)) 2 // instant-while equipped
WRITE_BYTE ("%fx_offset%" + 0x12 + ("%fx_number%" * 0x30)) 100 // probability (as 1 on d20), it's not a final chance, the spell has only 50%
WRITE_EVALUATED_ASCII ("%fx_offset%" + 0x14 + ("%fx_number%" * 0x30)) ~%item%~ //spell, that create damaged version of this item
WRITE_SHORT 0x70 ("%fx_number%" +1)
END //patch if "item"
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "1%item%" = 0) BEGIN // creates lightly damaged version of armor
SAY NAME1 ~Lightly damaged armor penalty1~
READ_LONG 0x6A "fx_offset1"
READ_SHORT 0x70 "fx_number1"
SET "loops1" = "%fx_number1%"
SET "found_ac" = 0 // false
WHILE (("%loops1%" > 0) AND ("%found_ac%" = 0)) BEGIN // this major WHILE loop examines existing effects and adjusts them accordingly
READ_SHORT ("%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "opcode"
READ_LONG (0x08 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "type"
PATCH_IF (("%opcode%" = 0) AND ("%type%" = 16)) BEGIN // looking for existante base ac
READ_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "ex_ac"
WRITE_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) ("%ex_ac%" + 1) //+1 in this case means penalty, coz for base ac lower is better
SET "found_ac" = 1 // true
END
SET "loops1" = ("%loops1%" - 1)
END //while
READ_LONG 0x6A "fx_offset"
READ_SHORT 0x70 "fx_number"
//for testing, if U don't like it, comment
INSERT_BYTES ("%fx_offset%" + ("%fx_number%" * 0x30)) 0x30
WRITE_SHORT ("%fx_offset%" + ("%fx_number%" * 0x30)) 232 // cast on condition
WRITE_BYTE ("%fx_offset%" + 0x02 + ("%fx_number%" * 0x30)) 1 // target self
WRITE_LONG ("%fx_offset%" + 0x04 + ("%fx_number%" * 0x30)) 0 // on caster
WRITE_LONG ("%fx_offset%" + 0x08 + ("%fx_number%" * 0x30)) 0 // when hited
WRITE_BYTE ("%fx_offset%" + 0x0c + ("%fx_number%" * 0x30)) 2 // instant-while equipped
WRITE_BYTE ("%fx_offset%" + 0x12 + ("%fx_number%" * 0x30)) 5 // probability (as 1 on d20), it's not a final chance, the spell has only 50%
WRITE_EVALUATED_ASCII ("%fx_offset%" + 0x14 + ("%fx_number%" * 0x30)) ~1%item%~
WRITE_SHORT 0x70 ("%fx_number%" +1)
END //patch if "item"
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "2%item%" = 0) BEGIN // if seriously damaged
SAY NAME1 ~Seriously damaged armor penalty3~
READ_LONG 0x6A "fx_offset1"
READ_SHORT 0x70 "fx_number1"
SET "loops1" = "%fx_number1%"
WHILE ("%loops1%" > 0) BEGIN // this major WHILE loop examines existing effects and adjusts them accordingly
READ_SHORT ("%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "opcode"
READ_LONG (0x08 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "type"
PATCH_IF (("%opcode%" = 0) AND ("%type%" = 16)) BEGIN // looking for existante base ac
READ_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "ex_ac"
WRITE_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) ("%ex_ac%" + 3) //+3 in this case means penalty, coz for base ac lower is better
// SET "found_ac" = 1 // true
END
SET "loops1" = ("%loops1%" - 1)
END //while
READ_LONG 0x6A "fx_offset"
READ_SHORT 0x70 "fx_number"
//for testing, if U don't like it, comment
INSERT_BYTES ("%fx_offset%" + ("%fx_number%" * 0x30)) 0x30
WRITE_SHORT ("%fx_offset%" + ("%fx_number%" * 0x30)) 232 // cast on condition
WRITE_BYTE ("%fx_offset%" + 0x02 + ("%fx_number%" * 0x30)) 1 // target self
WRITE_LONG ("%fx_offset%" + 0x04 + ("%fx_number%" * 0x30)) 0 // on caster
WRITE_LONG ("%fx_offset%" + 0x08 + ("%fx_number%" * 0x30)) 0 // when hited
WRITE_BYTE ("%fx_offset%" + 0x0c + ("%fx_number%" * 0x30)) 2 // instant-while equipped
WRITE_BYTE ("%fx_offset%" + 0x12 + ("%fx_number%" * 0x30)) 5 // probability (as 1 on d20), it's not a final chance, the spell has only 50%, yeah, armor cost lives
WRITE_EVALUATED_ASCII ("%fx_offset%" + 0x14 + ("%fx_number%" * 0x30)) ~2%item%~
WRITE_SHORT 0x70 ("%fx_number%" +1)
END //patch if "item"
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "3%item%.itm" = 0) BEGIN // if critically damaged, means, next step is crap, not armor
SAY NAME1 ~Critically damaged armor penalty6~
READ_LONG 0x6A "fx_offset1"
READ_SHORT 0x70 "fx_number1"
SET "loops1" = "%fx_number1%"
WHILE ("%loops1%" > 0) BEGIN // this major WHILE loop examines existing effects and adjusts them accordingly
READ_SHORT ("%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "opcode"
READ_LONG (0x08 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "type"
PATCH_IF (("%opcode%" = 0) AND ("%type%" = 16)) BEGIN // looking for existante base ac
READ_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) "ex_ac"
WRITE_LONG (0x04 + "%fx_offset1%" + (("%loops1%" - 1) * 0x30)) ("%ex_ac%" + 6) //+6 in this case means penalty, coz for base ac lower is better
// SET "found_ac" = 1 // true
END
SET "loops1" = ("%loops1%" - 1)
END //while
READ_LONG 0x6A "fx_offset"
READ_SHORT 0x70 "fx_number"
//for testing, if U don't like it, comment
INSERT_BYTES ("%fx_offset%" + ("%fx_number%" * 0x30)) 0x30
WRITE_SHORT ("%fx_offset%" + ("%fx_number%" * 0x30)) 232 // cast on condition
WRITE_BYTE ("%fx_offset%" + 0x02 + ("%fx_number%" * 0x30)) 1 // target self
WRITE_LONG ("%fx_offset%" + 0x04 + ("%fx_number%" * 0x30)) 0 // on caster
WRITE_LONG ("%fx_offset%" + 0x08 + ("%fx_number%" * 0x30)) 0 // when hited
WRITE_BYTE ("%fx_offset%" + 0x0c + ("%fx_number%" * 0x30)) 2 // instant-while equipped
WRITE_BYTE ("%fx_offset%" + 0x12 + ("%fx_number%" * 0x30)) 5 // probability (as 1 on d20), it's not a final chance, the spell has only 50%
WRITE_EVALUATED_ASCII ("%fx_offset%" + 0x14 + ("%fx_number%" * 0x30)) ~3%item%~
WRITE_SHORT 0x70 ("%fx_number%" +1)
END //patch if "item"
END //if size
// INNER_ACTION BEGIN
COPY_EXISTING ~_part1/_D3/_@source.spl~ ~override/%item%.spl~
~_part1/_D3/_@source.spl~ ~override/1%item%.spl~
~_part1/_D3/_@source.spl~ ~override/2%item%.spl~
~_part1/_D3/_@source.spl~ ~override/3%item%.spl~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
SET "fx_delta" = 0
FOR (index2 = 0; index2 < abil_num; index2 = index2 + 1) BEGIN
READ_SHORT ("%abil_off%" + 0x10 + (0x28 * "%index2%")) "min_lev"
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index2%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index2%")) "abil_fx_idx"
SET "abil_fx_idx" = "%abil_fx_idx%" + "%fx_delta%"
// WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "%abil_fx_idx%"
INSERT_BYTES ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 0x30
WRITE_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 143 // create item in slot
WRITE_BYTE ("%fx_off%" + 0x02 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 1 // target self
WRITE_LONG ("%fx_off%" + 0x04 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 1 // slot:armor
// WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 0 // unused
WRITE_BYTE ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 9 // duration type - perm after death
// WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 0 // duration
WRITE_BYTE ("%fx_off%" + 0x12 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 50 // probability, as coin, 50/50
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "%item%" = 0) BEGIN
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) ~1%item%~ // item
END
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "1%item%" = 0) BEGIN
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) ~2%item%~ // item
END
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "2%item%" = 0) BEGIN
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) ~3%item%~ // item
END
PATCH_IF (~%DEST_RES%~ STRING_COMPARE_CASE "3%item%" = 0) BEGIN
WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) ~MISC58~ // crap, that's all folks
END
SET "abil_fx_num" = "%abil_fx_num%" + 1
// SET "fx_delta" = "%fx_delta%" + 1
WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index2%")) "%abil_fx_num%"
END
// END //inner action
END //action if
END // Action for each