COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
SPRINT ~file_name~ ~%SOURCE_RES%~
PATCH_IF (%SOURCE_SIZE% > 0x71) THEN BEGIN // protects against invalid files
READ_BYTE "0x20" "usab3"
READ_BYTE "0x1f" "usab2"
READ_BYTE "0x1e" "usab1"
READ_BYTE "0x29" "ukit1"
READ_BYTE "0x2b" "ukit2"
READ_BYTE "0x1c" "item_type"
READ_ASCII "0x22" "anim_type" (2)
SET "file" = 0 // czy plik ma byc spatchowany
// SET "file2" = 0
// Armor
// PATCH_IF
// (((FILE_CONTAINS_EVALUATED (~w_psionics_unleashed\itm\list\StuddedLeather.txt~ ~--%file_name%--~)) OR
// (FILE_CONTAINS_EVALUATED (~w_psionics_unleashed\itm\list\HideArmor.txt~ ~--%file_name%--~)) OR
// (FILE_CONTAINS_EVALUATED (~w_psionics_unleashed\itm\list\LeatherArmor.txt~ ~--%file_name%--~)))
// AND (("%usab2%" BAND "0b00001000") = "0b00000000")) BEGIN
// SET "file" = 1
// SPRINT "spl_file" ~W_PSarm~
// END
// weapon
PATCH_IF
((NOT FILE_CONTAINS_EVALUATED (~w_psionics_unleashed\itm\list\weapons.txt~ ~--%file_name%--~))
AND (("%usab2%" BAND "0b00001000") = "0b00000000") // moze uzywac wojownik
AND (("%usab1%" BAND "0b01000000") = "0b00000000") // i bard
AND (("%item_type%" = "0x11") // mace/club
OR ("%item_type%" = "0x1b") // Crossbow
OR ("%item_type%" = "0x1d") // Spears
OR ("%item_type%" = "0x1f")) // Crossbow bolts
) BEGIN
SPRINT "spl_file" ~W_PSwep~
SET "file" = 1
END
// KOD do patchowania plikow z nieznanych modow, itm patchowane na podstawie statow i animacji
PATCH_IF (("%item_type%" = "0x02") AND ("%file%" = 0) AND (("%ukit2%" BAND "0b00000001") = "0b00000000") AND (("%usab2%" BAND "0b00001000") = "0b00000000")) BEGIN //zbroja, niepatchowana, uzywalna dla STALKERA i wojownika //AND ("%anim_type%" STRING_MATCHES_REGEXP "2a" = 0)
SET "file" = 1
SPRINT "spl_file" ~W_PSarm~
END
// PATCH_IF (("%item_type%" = "0x02") AND ("%file%" = 0) AND (("%ukit2%" BAND "0b00000001") = "0b10000001")) BEGIN //zbroja, niepatchowana, uzywalna dla STALKERA i wojownika //AND ("%anim_type%" STRING_MATCHES_REGEXP "2a" = 0)
// WRITE_BYTE "0x29" ("%ukit1%" BOR "0b00001000")
// END
PATCH_IF ("file" = 1) BEGIN
WRITE_BYTE "0x20" ("%usab3%" BAND "0b11111011") //MAGE
WRITE_BYTE "0x29" ("%ukit1%" BAND "0b11110111") //TOTEMIC
WRITE_BYTE "0x29" ("%ukit1%" BOR "0b10000001") // unusable for wildmages & talos prs (= mages)
INNER_ACTION BEGIN
COPY_EXISTING + ~%spl_file%.spl~ ~override/%spl_file%.spl~
opcode = 180 // Item: Can't Use Item [180]
target = 1 // 2 Pre-Target
timing = 9 // 1-Permanent
parameter1 = 9382
parameter2 = 0
power = 11
resist_dispel = 0 //to magic resistance/dispel type
duration = 0 //to duration
probability1 = 100 //to probability1 (default 100)
probability2 = 0 //to probability2
SPRINT resource ~%file_name%~
dicenumber = 0 //to number of dices to be thrown
dicesize = 0 //to size of dices to be thrown
savingthrow = 0 //to type of savingthrow to be allowed against the effect
savebonus = 0 //to saving throw bonus
header = 1 // to number of extended header (starting from 1) the effect should be added to
LAUNCH_PATCH_MACRO ~ADD_F_SPELL_EFFECT~
END
END
PATCH_IF // wszystkie itemy, ktorych uzywaja magowie a wojownicy nie - w tym zwoje i rozdzki, szaty magow itp.
((("%usab2%" BAND "0b00001000") = "0b00001000") AND (("%usab3%" BAND "0b00000100") = "0b00000000")) BEGIN // unusable by fighter, but usable by mage
WRITE_BYTE "0x29" ("%ukit1%" BOR "0b00001000")
END
PATCH_IF ((("%item_type%" = "0x12") OR ("%item_type%" = "0x18") OR ("%item_type%" = "0xE")) // proce, pociski do proc i strzalki maja byc niedostepne
AND (("%usab3%" BAND "0b00000000") = "0b00000100")) THEN BEGIN // jesli magowie i tak nie moga ich uzywac to pomin
WRITE_BYTE "0x29" ("%ukit1%" BOR "0b00001000")
END
// PATCH_IF ("%item_type%" = "0x1F") THEN BEGIN // belty maja byc dostepne
// WRITE_BYTE "0x20" ("%usab3%" BAND "0b00000100") //MAGE
// WRITE_BYTE "0x29" ("%ukit1%" BAND "0b00001000") //TOTEMIC
// END
READ_BYTE "0x20" "usab3"
READ_BYTE "0x29" "ukit1"
PATCH_IF ((("%usab3%" BAND "0b00000100") = "0b00000100") OR
(("%ukit1%" BAND "0b00001000") = "0b00001000"))
AND file = 0
BEGIN
READ_STRREF 0x50 w_unid_desc
READ_STRREF 0x54 w_id_desc
INNER_PATCH_SAVE w_unid_desc ~%w_unid_desc%~ BEGIN
REPLACE_TEXTUALLY CASE_INSENSITIVE ~Not Usable By:~ ~Not Usable By:%wnl% Psion ~ //CASE_SENSITIVE
END
SAY_EVALUATED UNIDENTIFIED_DESC ~%w_unid_desc%~
INNER_PATCH_SAVE w_id_desc ~%w_id_desc%~ BEGIN
REPLACE_TEXTUALLY CASE_INSENSITIVE ~Not Usable By:~ ~Not Usable By:%wnl% Psion ~
END
SAY_EVALUATED IDENTIFIED_DESC ~%w_id_desc%~
END
END
BUT_ONLY_IF_IT_CHANGES