Skip to content

[Tool] Adding class- or kit-specific spells

13»

Comments

  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    How does this tool work for mods which have non-EE and EE spell versions like teleport without error?

    Thankee!

    As long as you're playing the enhanced edition, it shouldn't matter if the spell also has a non-EE version.
  • EndarireEndarire Member Posts: 1,519
    edited June 2023
    To clarify, in what files should we put the lines where we include or exclude spells for classes & kits?

    Thankee!
  • EndarireEndarire Member Posts: 1,519
    edited June 2023
    @OlvynChuru
    Greetings! I ask for your aid after researching how you did things in OlvynSpells' files.

    Where should we use the line LAF ADD_CLASS_SPELL?

    For example, in the aforementioned teleport without error mod, the spell is Spwi730.spl and the scroll is RZtelep.itm. How to apply your spell tool to this spell? (I noticed APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~ in the .TP2 which seemed relevant.)

    Also, does this tool work with spell file names longer than 8.3 characters?

    Thankee!
  • OlvynChuruOlvynChuru Member Posts: 3,079
    @Endarire

    If the filename begins with Spwi or Sppr, you don't need to use this tool because it will be added to spell lists regardless.
  • EndarireEndarire Member Posts: 1,519
    @OlvynChuru
    To clarify, where should we use the line LAF ADD_CLASS_SPELL? It was seemingly in the .TP2 file and used instead of appending to spell.ids.

    Thankee!
  • OlvynChuruOlvynChuru Member Posts: 3,079
    @Endarire
    Endarire wrote: »
    @OlvynChuru
    To clarify, where should we use the line LAF ADD_CLASS_SPELL? It was seemingly in the .TP2 file and used instead of appending to spell.ids.

    Thankee!

    You put it in the .TP2 file. That is normal. You do not append it to spell.ids.
  • EndarireEndarire Member Posts: 1,519
    With your spell tool files placed appropriately, do the SP…spl files automatically get included?

    Where in the TP2 should we put the LAF line?

    Syntactically, should we convert a TP2 that uses appending to Spell.ids to use your system?

    Thankee!
  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    Syntactically, should we convert a TP2 that uses appending to Spell.ids to use your system?

    That is up to the author of the mod. In practice, it will probably never get done, but you probably shouldn't be making mirrors of other people's mods without their permission.
  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    Where in the TP2 should we put the LAF line?

    It doesn't matter, as long as it's after this line:
    INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~
    
  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    With your spell tool files placed appropriately, do the SP…spl files automatically get included?

    No. You have to copy them into the override folder.
  • EndarireEndarire Member Posts: 1,519
    edited July 2023
    This is the Teleport spell .TP2 before applying your spell tool.
    BACKUP ~Teleport/backup~
    AUTHOR ~Razfallow~
    
    ALWAYS
    	ACTION_DEFINE_ARRAY RZ_reload BEGIN
    	"Setup"
    	END
    	ACTION_DEFINE_ARRAY RZ_noconvert BEGIN END 
    	LAF HANDLE_CHARSETS
    		INT_VAR
    		infer_charset = 1
    		STR_VAR
    		tra_path = EVAL ~%MOD_FOLDER%/languages~
    		noconvert_array = RZ_noconvert
    		reload_array = RZ_reload
    	END
    END
    
    LANGUAGE ~Cesky~
             ~cesky~
             ~Teleport/languages/czech/setup.tra~
    LANGUAGE ~English~
             ~english~
             ~Teleport/languages/english/setup.tra~
    LANGUAGE ~Russian (by www.aerie.ru)~
             ~russian~
             ~Teleport/languages/russian/setup.tra~
    LANGUAGE ~Italiano (by Ilot)~
             ~italian~
             ~Teleport/languages/italian/setup.tra~
    LANGUAGE ~Polski (by yarpen)~
             ~polish~
             ~Teleport/languages/polish/setup.tra~
    LANGUAGE ~Deutsche (by Drogan Di'Umptu)~
             ~german~
             ~Teleport/languages/german/setup.tra~
    LANGUAGE ~Spanish (by Ethelien and Memnoch, special thanks to Ancalagon)~
             ~spanish~
             ~Teleport/languages/spanish/setup.tra~
    LANGUAGE ~French (by Skipcool)~
             ~french~
             ~Teleport/languages/french/setup.tra~
    
    ////////////////////
    //Teleport for SoA//
    ////////////////////
    BEGIN @55
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut01.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-soa~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-soa.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    
    COPY_EXISTING ~scrolls.sto~	~override~
    			~uddrow25.sto~	~override~	ADD_STORE_ITEM ~RZTELEP~ LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~
    
    COPY_EXISTING ~AR0302.are~ ~override~
                  ~AR0305.are~ ~override~
                  ~AR0306.are~ ~override~
                  ~AR0412.are~ ~override~
                  ~AR0509.are~ ~override~
                  ~AR1005.are~ ~override~
                  ~AR1010.are~ ~override~
                  ~AR1201.are~ ~override~
                  ~AR1203.are~ ~override~
                  ~AR3003.are~ ~override~
                  ~AR5501.are~ ~override~
                  ~AR5502.are~ ~override~
      PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN // protects against invalid files
        READ_ASCII 0x94 "script"
        PATCH_IF (("" STRING_COMPARE_CASE "%script%" = 0) OR ("None" STRING_COMPARE_CASE "%script%" = 0)) BEGIN
          WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
        END
      END
      BUT_ONLY_IF_IT_CHANGES
    
    EXTEND_TOP ~AR0020.bcs~  ~Teleport/area-baf/AR0020.baf~
    EXTEND_TOP ~AR0202.bcs~  ~Teleport/area-baf/AR0202.baf~
    EXTEND_TOP ~AR0203.bcs~  ~Teleport/area-baf/AR0203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0300.bcs~  ~Teleport/area-baf/AR0300.baf~
    EXTEND_TOP ~AR0307.bcs~  ~Teleport/area-baf/AR0307.baf~
    EXTEND_TOP ~AR0308.bcs~  ~Teleport/area-baf/AR0308.baf~
    EXTEND_TOP ~AR0311.bcs~  ~Teleport/area-baf/AR0311.baf~
    EXTEND_TOP ~AR0313.bcs~  ~Teleport/area-baf/AR0313.baf~
    EXTEND_TOP ~AR0328.bcs~  ~Teleport/area-baf/AR0328.baf~
    EXTEND_TOP ~AR0329.bcs~  ~Teleport/area-baf/AR0329.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0400.bcs~  ~Teleport/area-baf/AR0400.baf~
    EXTEND_TOP ~AR0402.bcs~  ~Teleport/area-baf/AR0402.baf~
    EXTEND_TOP ~AR0404.bcs~  ~Teleport/area-baf/AR0404.baf~
    EXTEND_TOP ~AR0405.bcs~  ~Teleport/area-baf/AR0405.baf~
    EXTEND_TOP ~AR0406.bcs~  ~Teleport/area-baf/AR0406.baf~
    EXTEND_TOP ~AR0410.bcs~  ~Teleport/area-baf/AR0410.baf~
    EXTEND_TOP ~AR0411.bcs~  ~Teleport/area-baf/AR0411.baf~
    EXTEND_TOP ~AR0413.bcs~  ~Teleport/area-baf/AR0413.baf~
    EXTEND_TOP ~AR0500.bcs~  ~Teleport/area-baf/AR0500.baf~
    EXTEND_TOP ~AR0510.bcs~  ~Teleport/area-baf/AR0510.baf~
    EXTEND_TOP ~AR0512.bcs~  ~Teleport/area-baf/AR0512.baf~
    EXTEND_TOP ~AR0607.bcs~  ~Teleport/area-baf/AR0607.baf~
    EXTEND_TOP ~AR0700.bcs~  ~Teleport/area-baf/AR0700.baf~
    EXTEND_TOP ~AR0701.bcs~  ~Teleport/area-baf/AR0701.baf~
    EXTEND_TOP ~AR0702.bcs~  ~Teleport/area-baf/AR0702.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0704.bcs~  ~Teleport/area-baf/AR0704.baf~
    EXTEND_TOP ~AR0705.bcs~  ~Teleport/area-baf/AR0705.baf~
    EXTEND_TOP ~AR0709.bcs~  ~Teleport/area-baf/AR0709.baf~
    EXTEND_TOP ~AR0800.bcs~  ~Teleport/area-baf/AR0800.baf~
    EXTEND_TOP ~AR0801.bcs~  ~Teleport/area-baf/AR0801.baf~
    EXTEND_TOP ~AR0803.bcs~  ~Teleport/area-baf/AR0803.baf~
    EXTEND_TOP ~AR0900.bcs~  ~Teleport/area-baf/AR0900.baf~
    EXTEND_TOP ~AR0901.bcs~  ~Teleport/area-baf/AR0901.baf~
    EXTEND_TOP ~AR0902.bcs~  ~Teleport/area-baf/AR0902.baf~
    EXTEND_TOP ~AR0903.bcs~  ~Teleport/area-baf/AR0903.baf~
    EXTEND_TOP ~AR0904.bcs~  ~Teleport/area-baf/AR0904.baf~
    EXTEND_TOP ~AR1000.bcs~  ~Teleport/area-baf/AR1000.baf~
    EXTEND_TOP ~AR1002.bcs~  ~Teleport/area-baf/AR1002.baf~
    EXTEND_TOP ~AR1003.bcs~  ~Teleport/area-baf/AR1003.baf~
    EXTEND_TOP ~AR1006.bcs~  ~Teleport/area-baf/AR1006.baf~
    EXTEND_TOP ~AR1100.bcs~  ~Teleport/area-baf/AR1100.baf~
    EXTEND_TOP ~AR1102.bcs~  ~Teleport/area-baf/AR1102.baf~
    EXTEND_TOP ~AR1104.bcs~  ~Teleport/area-baf/AR1104.baf~
    EXTEND_TOP ~AR1105.bcs~  ~Teleport/area-baf/AR1105.baf~
    EXTEND_TOP ~AR1200.bcs~  ~Teleport/area-baf/AR1200.baf~
    EXTEND_TOP ~AR1202.bcs~  ~Teleport/area-baf/AR1202.baf~
    EXTEND_TOP ~AR1204.bcs~  ~Teleport/area-baf/AR1204.baf~
    EXTEND_TOP ~AR1300.bcs~  ~Teleport/area-baf/AR1300.baf~
    EXTEND_TOP ~AR1302.bcs~  ~Teleport/area-baf/AR1302.baf~
    EXTEND_TOP ~AR1303.bcs~  ~Teleport/area-baf/AR1303.baf~
    EXTEND_TOP ~AR1401.bcs~  ~Teleport/area-baf/AR1401.baf~
    EXTEND_TOP ~AR1402.bcs~  ~Teleport/area-baf/AR1402.baf~
    EXTEND_TOP ~AR1404.bcs~  ~Teleport/area-baf/AR1404.baf~
    EXTEND_TOP ~AR1600.bcs~  ~Teleport/area-baf/AR1600.baf~
    EXTEND_TOP ~AR1602.bcs~  ~Teleport/area-baf/AR1602.baf~
    EXTEND_TOP ~AR1611.bcs~  ~Teleport/area-baf/AR1611.baf~
    EXTEND_TOP ~AR1700.bcs~  ~Teleport/area-baf/AR1700.baf~
    EXTEND_TOP ~AR1800.bcs~  ~Teleport/area-baf/AR1800.baf~
    EXTEND_TOP ~AR1900.bcs~  ~Teleport/area-baf/AR1900.baf~
    EXTEND_TOP ~AR1901.bcs~  ~Teleport/area-baf/AR1901.baf~
    EXTEND_TOP ~AR2000.bcs~  ~Teleport/area-baf/AR2000.baf~
    EXTEND_TOP ~AR2002.bcs~  ~Teleport/area-baf/AR2002.baf~
    EXTEND_TOP ~AR2007.bcs~  ~Teleport/area-baf/AR2007.baf~
    EXTEND_TOP ~AR2008.bcs~  ~Teleport/area-baf/AR2008.baf~
    EXTEND_TOP ~AR2010.bcs~  ~Teleport/area-baf/AR2010.baf~
    EXTEND_TOP ~AR2100.bcs~  ~Teleport/area-baf/AR2100.baf~
    EXTEND_TOP ~AR2200.bcs~  ~Teleport/area-baf/AR2200.baf~
    EXTEND_TOP ~AR2201.bcs~  ~Teleport/area-baf/AR2201.baf~
    EXTEND_TOP ~AR2202.bcs~  ~Teleport/area-baf/AR2202.baf~
    EXTEND_TOP ~AR2300.bcs~  ~Teleport/area-baf/AR2300.baf~
    EXTEND_TOP ~AR2400.bcs~  ~Teleport/area-baf/AR2400.baf~
    EXTEND_TOP ~AR2402.bcs~  ~Teleport/area-baf/AR2402.baf~
    EXTEND_TOP ~AR2500.bcs~  ~Teleport/area-baf/AR2500.baf~
    EXTEND_TOP ~AR2600.bcs~  ~Teleport/area-baf/AR2600.baf~
    EXTEND_TOP ~AR2800.bcs~  ~Teleport/area-baf/AR2800.baf~
    EXTEND_TOP ~AR2801.bcs~  ~Teleport/area-baf/AR2801.baf~
    EXTEND_TOP ~AR2802.bcs~  ~Teleport/area-baf/AR2802.baf~
    EXTEND_TOP ~AR0001.bcs~  ~Teleport/area-baf/AR0001.baf~
    EXTEND_TOP ~AR0003.bcs~  ~Teleport/area-baf/AR0003.baf~
    EXTEND_TOP ~AR0004.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0021.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0609.bcs~  ~Teleport/area-baf/AR0609.baf~
    EXTEND_TOP ~AR0302.bcs~  ~Teleport/area-baf/AR0302.baf~
    EXTEND_TOP ~AR0305.bcs~  ~Teleport/area-baf/AR0305.baf~
    EXTEND_TOP ~AR0306.bcs~  ~Teleport/area-baf/AR0306.baf~
    EXTEND_TOP ~AR0319.bcs~  ~Teleport/area-baf/AR0319.baf~
    EXTEND_TOP ~AR0408.bcs~  ~Teleport/area-baf/AR0408.baf~
    EXTEND_TOP ~AR0412.bcs~  ~Teleport/area-baf/AR0412.baf~
    EXTEND_TOP ~AR0509.bcs~  ~Teleport/area-baf/AR0509.baf~
    EXTEND_TOP ~AR0513.bcs~  ~Teleport/area-baf/AR0513.baf~
    EXTEND_TOP ~AR0703.bcs~  ~Teleport/area-baf/AR0703.baf~
    EXTEND_TOP ~AR0706.bcs~  ~Teleport/area-baf/AR0706.baf~
    EXTEND_TOP ~AR1005.bcs~  ~Teleport/area-baf/AR1005.baf~
    EXTEND_TOP ~AR1010.bcs~  ~Teleport/area-baf/AR1010.baf~
    EXTEND_TOP ~AR1201.bcs~  ~Teleport/area-baf/AR1201.baf~
    EXTEND_TOP ~AR1203.bcs~  ~Teleport/area-baf/AR1203.baf~
    EXTEND_TOP ~AR2101.bcs~  ~Teleport/area-baf/AR2101.baf~
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR0707.bcs~ THEN BEGIN
      EXTEND_TOP ~AR0707.bcs~  ~Teleport/area-baf/AR0003.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1604.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1604.bcs~  ~Teleport/area-baf/AR0609.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1603.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1603.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR2001.bcs~ THEN BEGIN
      EXTEND_TOP ~AR2001.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ////////////////////
    //Teleport for ToB//
    ////////////////////
    
    BEGIN @56
    
    ACTION_IF NOT FILE_EXISTS_IN_GAME ~Mel01.cre~ THEN BEGIN
      PRINT @57
    END ELSE BEGIN
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut112.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-tob~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-tob.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    COPY_EXISTING	~25spell.sto~ ~override~
    				~25spell2.sto~ ~override~
    				~garlena.sto~ ~override~	ADD_STORE_ITEM ~RZTELEP~  LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~
    
    EXTEND_TOP ~AR3000.bcs~  ~Teleport/area-baf/AR3000.baf~
    EXTEND_TOP ~AR3001.bcs~  ~Teleport/area-baf/AR3001.baf~
    EXTEND_TOP ~AR3015.bcs~  ~Teleport/area-baf/AR3015.baf~
    EXTEND_TOP ~AR3016.bcs~  ~Teleport/area-baf/AR3016.baf~
    EXTEND_TOP ~AR3017.bcs~  ~Teleport/area-baf/AR3017.baf~
    EXTEND_TOP ~AR3019.bcs~  ~Teleport/area-baf/AR3019.baf~
    EXTEND_TOP ~AR3020.bcs~  ~Teleport/area-baf/AR3020.baf~
    EXTEND_TOP ~AR5200.bcs~  ~Teleport/area-baf/AR5200.baf~
    EXTEND_TOP ~AR5201.bcs~  ~Teleport/area-baf/AR5201.baf~
    EXTEND_TOP ~AR5202.bcs~  ~Teleport/area-baf/AR5202.baf~
    EXTEND_TOP ~AR5203.bcs~  ~Teleport/area-baf/AR5203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR5500.bcs~  ~Teleport/area-baf/AR5500.baf~
    EXTEND_TOP ~AR5504.bcs~  ~Teleport/area-baf/AR5504.baf~
    EXTEND_TOP ~AR5509.bcs~  ~Teleport/area-baf/AR5509.baf~
    EXTEND_TOP ~AR6000.bcs~  ~Teleport/area-baf/AR6000.baf~
    EXTEND_TOP ~AR6003.bcs~  ~Teleport/area-baf/AR6003.baf~
    EXTEND_TOP ~AR6004.bcs~  ~Teleport/area-baf/AR6004.baf~
    EXTEND_TOP ~AR6005.bcs~  ~Teleport/area-baf/AR6005.baf~
    EXTEND_TOP ~AR6100.bcs~  ~Teleport/area-baf/AR6100.baf~
    EXTEND_TOP ~AR6101.bcs~  ~Teleport/area-baf/AR6101.baf~
    EXTEND_TOP ~AR6104.bcs~  ~Teleport/area-baf/AR6104.baf~
    EXTEND_TOP ~AR6106.bcs~  ~Teleport/area-baf/AR6106.baf~
    EXTEND_TOP ~AR6108.bcs~  ~Teleport/area-baf/AR6108.baf~
    EXTEND_TOP ~AR6400.bcs~  ~Teleport/area-baf/AR6400.baf~
    EXTEND_TOP ~AR3003.bcs~  ~Teleport/area-baf/AR3003.baf~
    EXTEND_TOP ~AR5204.bcs~  ~Teleport/area-baf/AR5204.baf~
    EXTEND_TOP ~AR5501.bcs~  ~Teleport/area-baf/AR5501.baf~
    EXTEND_TOP ~AR5502.bcs~  ~Teleport/area-baf/AR5502.baf~
    EXTEND_TOP ~AR6300.bcs~  ~Teleport/area-baf/AR6300.baf~
    END
    
    BEGIN  @54
    EXTEND_BOTTOM ~AERIE.BCS~ ~Teleport/change/aerie.baf~
    EXTEND_BOTTOM ~ANOMEN.BCS~ ~Teleport/change/anomen.baf~
    EXTEND_BOTTOM ~BALDUR.BCS~ ~Teleport/change/baldur.baf~
    EXTEND_BOTTOM ~CERND.BCS~ ~Teleport/change/cernd.baf~
    EXTEND_BOTTOM ~EDWIN.BCS~ ~Teleport/change/edwin.baf~
    EXTEND_BOTTOM ~JAHEIRA.BCS~ ~Teleport/change/jaheira.baf~
    EXTEND_BOTTOM ~JAN.BCS~ ~Teleport/change/jjansen.baf~
    EXTEND_BOTTOM ~MAZZY.BCS~ ~Teleport/change/mazzy.baf~
    EXTEND_BOTTOM ~NALIA.BCS~ ~Teleport/change/nalia.baf~
    
    COMPILE ~Teleport/change/cernd.d~
    

    This is the same file after modifying it with your spell tool with changes highlighted in bold. Is this correct? If something should change, how should it change and why? (Note that it normally includes appending the same Teleport spell twice to Spell.ids, if it doesn't already exist. I followed the same logic.)

    Near the top, I added "INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~."

    Farther down, I added "LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END" where the old append to Spell.ids lines were. (I commented out the append lines.)

    BACKUP ~Teleport/backup~
    AUTHOR ~Razfallow~
    INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~
    
    ALWAYS
    	ACTION_DEFINE_ARRAY RZ_reload BEGIN
    	"Setup"
    	END
    	ACTION_DEFINE_ARRAY RZ_noconvert BEGIN END 
    	LAF HANDLE_CHARSETS
    		INT_VAR
    		infer_charset = 1
    		STR_VAR
    		tra_path = EVAL ~%MOD_FOLDER%/languages~
    		noconvert_array = RZ_noconvert
    		reload_array = RZ_reload
    	END
    END
    
    LANGUAGE ~Cesky~
             ~cesky~
             ~Teleport/languages/czech/setup.tra~
    LANGUAGE ~English~
             ~english~
             ~Teleport/languages/english/setup.tra~
    LANGUAGE ~Russian (by www.aerie.ru)~
             ~russian~
             ~Teleport/languages/russian/setup.tra~
    LANGUAGE ~Italiano (by Ilot)~
             ~italian~
             ~Teleport/languages/italian/setup.tra~
    LANGUAGE ~Polski (by yarpen)~
             ~polish~
             ~Teleport/languages/polish/setup.tra~
    LANGUAGE ~Deutsche (by Drogan Di'Umptu)~
             ~german~
             ~Teleport/languages/german/setup.tra~
    LANGUAGE ~Spanish (by Ethelien and Memnoch, special thanks to Ancalagon)~
             ~spanish~
             ~Teleport/languages/spanish/setup.tra~
    LANGUAGE ~French (by Skipcool)~
             ~french~
             ~Teleport/languages/french/setup.tra~
    
    ////////////////////
    //Teleport for SoA//
    ////////////////////
    BEGIN @55
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut01.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-soa~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-soa.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    
    COPY_EXISTING ~scrolls.sto~	~override~
    			~uddrow25.sto~	~override~	ADD_STORE_ITEM ~RZTELEP~ LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END //The filenames used this Sentence case for the spell name, unlike the [i]summon cow[/i] spell example which was all CAPS.
    
    //APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~ //We no longer append to Spell.ids with Olvyn's spell tool. 
    
    COPY_EXISTING ~AR0302.are~ ~override~
                  ~AR0305.are~ ~override~
                  ~AR0306.are~ ~override~
                  ~AR0412.are~ ~override~
                  ~AR0509.are~ ~override~
                  ~AR1005.are~ ~override~
                  ~AR1010.are~ ~override~
                  ~AR1201.are~ ~override~
                  ~AR1203.are~ ~override~
                  ~AR3003.are~ ~override~
                  ~AR5501.are~ ~override~
                  ~AR5502.are~ ~override~
      PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN // protects against invalid files
        READ_ASCII 0x94 "script"
        PATCH_IF (("" STRING_COMPARE_CASE "%script%" = 0) OR ("None" STRING_COMPARE_CASE "%script%" = 0)) BEGIN
          WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
        END
      END
      BUT_ONLY_IF_IT_CHANGES
    
    EXTEND_TOP ~AR0020.bcs~  ~Teleport/area-baf/AR0020.baf~
    EXTEND_TOP ~AR0202.bcs~  ~Teleport/area-baf/AR0202.baf~
    EXTEND_TOP ~AR0203.bcs~  ~Teleport/area-baf/AR0203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0300.bcs~  ~Teleport/area-baf/AR0300.baf~
    EXTEND_TOP ~AR0307.bcs~  ~Teleport/area-baf/AR0307.baf~
    EXTEND_TOP ~AR0308.bcs~  ~Teleport/area-baf/AR0308.baf~
    EXTEND_TOP ~AR0311.bcs~  ~Teleport/area-baf/AR0311.baf~
    EXTEND_TOP ~AR0313.bcs~  ~Teleport/area-baf/AR0313.baf~
    EXTEND_TOP ~AR0328.bcs~  ~Teleport/area-baf/AR0328.baf~
    EXTEND_TOP ~AR0329.bcs~  ~Teleport/area-baf/AR0329.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0400.bcs~  ~Teleport/area-baf/AR0400.baf~
    EXTEND_TOP ~AR0402.bcs~  ~Teleport/area-baf/AR0402.baf~
    EXTEND_TOP ~AR0404.bcs~  ~Teleport/area-baf/AR0404.baf~
    EXTEND_TOP ~AR0405.bcs~  ~Teleport/area-baf/AR0405.baf~
    EXTEND_TOP ~AR0406.bcs~  ~Teleport/area-baf/AR0406.baf~
    EXTEND_TOP ~AR0410.bcs~  ~Teleport/area-baf/AR0410.baf~
    EXTEND_TOP ~AR0411.bcs~  ~Teleport/area-baf/AR0411.baf~
    EXTEND_TOP ~AR0413.bcs~  ~Teleport/area-baf/AR0413.baf~
    EXTEND_TOP ~AR0500.bcs~  ~Teleport/area-baf/AR0500.baf~
    EXTEND_TOP ~AR0510.bcs~  ~Teleport/area-baf/AR0510.baf~
    EXTEND_TOP ~AR0512.bcs~  ~Teleport/area-baf/AR0512.baf~
    EXTEND_TOP ~AR0607.bcs~  ~Teleport/area-baf/AR0607.baf~
    EXTEND_TOP ~AR0700.bcs~  ~Teleport/area-baf/AR0700.baf~
    EXTEND_TOP ~AR0701.bcs~  ~Teleport/area-baf/AR0701.baf~
    EXTEND_TOP ~AR0702.bcs~  ~Teleport/area-baf/AR0702.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0704.bcs~  ~Teleport/area-baf/AR0704.baf~
    EXTEND_TOP ~AR0705.bcs~  ~Teleport/area-baf/AR0705.baf~
    EXTEND_TOP ~AR0709.bcs~  ~Teleport/area-baf/AR0709.baf~
    EXTEND_TOP ~AR0800.bcs~  ~Teleport/area-baf/AR0800.baf~
    EXTEND_TOP ~AR0801.bcs~  ~Teleport/area-baf/AR0801.baf~
    EXTEND_TOP ~AR0803.bcs~  ~Teleport/area-baf/AR0803.baf~
    EXTEND_TOP ~AR0900.bcs~  ~Teleport/area-baf/AR0900.baf~
    EXTEND_TOP ~AR0901.bcs~  ~Teleport/area-baf/AR0901.baf~
    EXTEND_TOP ~AR0902.bcs~  ~Teleport/area-baf/AR0902.baf~
    EXTEND_TOP ~AR0903.bcs~  ~Teleport/area-baf/AR0903.baf~
    EXTEND_TOP ~AR0904.bcs~  ~Teleport/area-baf/AR0904.baf~
    EXTEND_TOP ~AR1000.bcs~  ~Teleport/area-baf/AR1000.baf~
    EXTEND_TOP ~AR1002.bcs~  ~Teleport/area-baf/AR1002.baf~
    EXTEND_TOP ~AR1003.bcs~  ~Teleport/area-baf/AR1003.baf~
    EXTEND_TOP ~AR1006.bcs~  ~Teleport/area-baf/AR1006.baf~
    EXTEND_TOP ~AR1100.bcs~  ~Teleport/area-baf/AR1100.baf~
    EXTEND_TOP ~AR1102.bcs~  ~Teleport/area-baf/AR1102.baf~
    EXTEND_TOP ~AR1104.bcs~  ~Teleport/area-baf/AR1104.baf~
    EXTEND_TOP ~AR1105.bcs~  ~Teleport/area-baf/AR1105.baf~
    EXTEND_TOP ~AR1200.bcs~  ~Teleport/area-baf/AR1200.baf~
    EXTEND_TOP ~AR1202.bcs~  ~Teleport/area-baf/AR1202.baf~
    EXTEND_TOP ~AR1204.bcs~  ~Teleport/area-baf/AR1204.baf~
    EXTEND_TOP ~AR1300.bcs~  ~Teleport/area-baf/AR1300.baf~
    EXTEND_TOP ~AR1302.bcs~  ~Teleport/area-baf/AR1302.baf~
    EXTEND_TOP ~AR1303.bcs~  ~Teleport/area-baf/AR1303.baf~
    EXTEND_TOP ~AR1401.bcs~  ~Teleport/area-baf/AR1401.baf~
    EXTEND_TOP ~AR1402.bcs~  ~Teleport/area-baf/AR1402.baf~
    EXTEND_TOP ~AR1404.bcs~  ~Teleport/area-baf/AR1404.baf~
    EXTEND_TOP ~AR1600.bcs~  ~Teleport/area-baf/AR1600.baf~
    EXTEND_TOP ~AR1602.bcs~  ~Teleport/area-baf/AR1602.baf~
    EXTEND_TOP ~AR1611.bcs~  ~Teleport/area-baf/AR1611.baf~
    EXTEND_TOP ~AR1700.bcs~  ~Teleport/area-baf/AR1700.baf~
    EXTEND_TOP ~AR1800.bcs~  ~Teleport/area-baf/AR1800.baf~
    EXTEND_TOP ~AR1900.bcs~  ~Teleport/area-baf/AR1900.baf~
    EXTEND_TOP ~AR1901.bcs~  ~Teleport/area-baf/AR1901.baf~
    EXTEND_TOP ~AR2000.bcs~  ~Teleport/area-baf/AR2000.baf~
    EXTEND_TOP ~AR2002.bcs~  ~Teleport/area-baf/AR2002.baf~
    EXTEND_TOP ~AR2007.bcs~  ~Teleport/area-baf/AR2007.baf~
    EXTEND_TOP ~AR2008.bcs~  ~Teleport/area-baf/AR2008.baf~
    EXTEND_TOP ~AR2010.bcs~  ~Teleport/area-baf/AR2010.baf~
    EXTEND_TOP ~AR2100.bcs~  ~Teleport/area-baf/AR2100.baf~
    EXTEND_TOP ~AR2200.bcs~  ~Teleport/area-baf/AR2200.baf~
    EXTEND_TOP ~AR2201.bcs~  ~Teleport/area-baf/AR2201.baf~
    EXTEND_TOP ~AR2202.bcs~  ~Teleport/area-baf/AR2202.baf~
    EXTEND_TOP ~AR2300.bcs~  ~Teleport/area-baf/AR2300.baf~
    EXTEND_TOP ~AR2400.bcs~  ~Teleport/area-baf/AR2400.baf~
    EXTEND_TOP ~AR2402.bcs~  ~Teleport/area-baf/AR2402.baf~
    EXTEND_TOP ~AR2500.bcs~  ~Teleport/area-baf/AR2500.baf~
    EXTEND_TOP ~AR2600.bcs~  ~Teleport/area-baf/AR2600.baf~
    EXTEND_TOP ~AR2800.bcs~  ~Teleport/area-baf/AR2800.baf~
    EXTEND_TOP ~AR2801.bcs~  ~Teleport/area-baf/AR2801.baf~
    EXTEND_TOP ~AR2802.bcs~  ~Teleport/area-baf/AR2802.baf~
    EXTEND_TOP ~AR0001.bcs~  ~Teleport/area-baf/AR0001.baf~
    EXTEND_TOP ~AR0003.bcs~  ~Teleport/area-baf/AR0003.baf~
    EXTEND_TOP ~AR0004.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0021.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0609.bcs~  ~Teleport/area-baf/AR0609.baf~
    EXTEND_TOP ~AR0302.bcs~  ~Teleport/area-baf/AR0302.baf~
    EXTEND_TOP ~AR0305.bcs~  ~Teleport/area-baf/AR0305.baf~
    EXTEND_TOP ~AR0306.bcs~  ~Teleport/area-baf/AR0306.baf~
    EXTEND_TOP ~AR0319.bcs~  ~Teleport/area-baf/AR0319.baf~
    EXTEND_TOP ~AR0408.bcs~  ~Teleport/area-baf/AR0408.baf~
    EXTEND_TOP ~AR0412.bcs~  ~Teleport/area-baf/AR0412.baf~
    EXTEND_TOP ~AR0509.bcs~  ~Teleport/area-baf/AR0509.baf~
    EXTEND_TOP ~AR0513.bcs~  ~Teleport/area-baf/AR0513.baf~
    EXTEND_TOP ~AR0703.bcs~  ~Teleport/area-baf/AR0703.baf~
    EXTEND_TOP ~AR0706.bcs~  ~Teleport/area-baf/AR0706.baf~
    EXTEND_TOP ~AR1005.bcs~  ~Teleport/area-baf/AR1005.baf~
    EXTEND_TOP ~AR1010.bcs~  ~Teleport/area-baf/AR1010.baf~
    EXTEND_TOP ~AR1201.bcs~  ~Teleport/area-baf/AR1201.baf~
    EXTEND_TOP ~AR1203.bcs~  ~Teleport/area-baf/AR1203.baf~
    EXTEND_TOP ~AR2101.bcs~  ~Teleport/area-baf/AR2101.baf~
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR0707.bcs~ THEN BEGIN
      EXTEND_TOP ~AR0707.bcs~  ~Teleport/area-baf/AR0003.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1604.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1604.bcs~  ~Teleport/area-baf/AR0609.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1603.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1603.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR2001.bcs~ THEN BEGIN
      EXTEND_TOP ~AR2001.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ////////////////////
    //Teleport for ToB//
    ////////////////////
    
    BEGIN @56
    
    ACTION_IF NOT FILE_EXISTS_IN_GAME ~Mel01.cre~ THEN BEGIN
      PRINT @57
    END ELSE BEGIN
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut112.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-tob~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-tob.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    COPY_EXISTING	~25spell.sto~ ~override~
    				~25spell2.sto~ ~override~
    				~garlena.sto~ ~override~	ADD_STORE_ITEM ~RZTELEP~  LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END //The filenames used this Sentence case for the spell name, unlike the [i]summon cow[/i] spell example which was all CAPS.
    
    //APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~ //We use Olvyn's spell tool instead of appending to Spell.ids.
    
    EXTEND_TOP ~AR3000.bcs~  ~Teleport/area-baf/AR3000.baf~
    EXTEND_TOP ~AR3001.bcs~  ~Teleport/area-baf/AR3001.baf~
    EXTEND_TOP ~AR3015.bcs~  ~Teleport/area-baf/AR3015.baf~
    EXTEND_TOP ~AR3016.bcs~  ~Teleport/area-baf/AR3016.baf~
    EXTEND_TOP ~AR3017.bcs~  ~Teleport/area-baf/AR3017.baf~
    EXTEND_TOP ~AR3019.bcs~  ~Teleport/area-baf/AR3019.baf~
    EXTEND_TOP ~AR3020.bcs~  ~Teleport/area-baf/AR3020.baf~
    EXTEND_TOP ~AR5200.bcs~  ~Teleport/area-baf/AR5200.baf~
    EXTEND_TOP ~AR5201.bcs~  ~Teleport/area-baf/AR5201.baf~
    EXTEND_TOP ~AR5202.bcs~  ~Teleport/area-baf/AR5202.baf~
    EXTEND_TOP ~AR5203.bcs~  ~Teleport/area-baf/AR5203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR5500.bcs~  ~Teleport/area-baf/AR5500.baf~
    EXTEND_TOP ~AR5504.bcs~  ~Teleport/area-baf/AR5504.baf~
    EXTEND_TOP ~AR5509.bcs~  ~Teleport/area-baf/AR5509.baf~
    EXTEND_TOP ~AR6000.bcs~  ~Teleport/area-baf/AR6000.baf~
    EXTEND_TOP ~AR6003.bcs~  ~Teleport/area-baf/AR6003.baf~
    EXTEND_TOP ~AR6004.bcs~  ~Teleport/area-baf/AR6004.baf~
    EXTEND_TOP ~AR6005.bcs~  ~Teleport/area-baf/AR6005.baf~
    EXTEND_TOP ~AR6100.bcs~  ~Teleport/area-baf/AR6100.baf~
    EXTEND_TOP ~AR6101.bcs~  ~Teleport/area-baf/AR6101.baf~
    EXTEND_TOP ~AR6104.bcs~  ~Teleport/area-baf/AR6104.baf~
    EXTEND_TOP ~AR6106.bcs~  ~Teleport/area-baf/AR6106.baf~
    EXTEND_TOP ~AR6108.bcs~  ~Teleport/area-baf/AR6108.baf~
    EXTEND_TOP ~AR6400.bcs~  ~Teleport/area-baf/AR6400.baf~
    EXTEND_TOP ~AR3003.bcs~  ~Teleport/area-baf/AR3003.baf~
    EXTEND_TOP ~AR5204.bcs~  ~Teleport/area-baf/AR5204.baf~
    EXTEND_TOP ~AR5501.bcs~  ~Teleport/area-baf/AR5501.baf~
    EXTEND_TOP ~AR5502.bcs~  ~Teleport/area-baf/AR5502.baf~
    EXTEND_TOP ~AR6300.bcs~  ~Teleport/area-baf/AR6300.baf~
    END
    
    BEGIN  @54
    EXTEND_BOTTOM ~AERIE.BCS~ ~Teleport/change/aerie.baf~
    EXTEND_BOTTOM ~ANOMEN.BCS~ ~Teleport/change/anomen.baf~
    EXTEND_BOTTOM ~BALDUR.BCS~ ~Teleport/change/baldur.baf~
    EXTEND_BOTTOM ~CERND.BCS~ ~Teleport/change/cernd.baf~
    EXTEND_BOTTOM ~EDWIN.BCS~ ~Teleport/change/edwin.baf~
    EXTEND_BOTTOM ~JAHEIRA.BCS~ ~Teleport/change/jaheira.baf~
    EXTEND_BOTTOM ~JAN.BCS~ ~Teleport/change/jjansen.baf~
    EXTEND_BOTTOM ~MAZZY.BCS~ ~Teleport/change/mazzy.baf~
    EXTEND_BOTTOM ~NALIA.BCS~ ~Teleport/change/nalia.baf~
    
    COMPILE ~Teleport/change/cernd.d~
    

    Thankee!
  • EndarireEndarire Member Posts: 1,519
    edited July 2023
    Update!
    I modified the .TP2 file for teleport with the final result below. I tested it with Tome & Blood's Sor spell swap which works on vanilla & Olvyn Spell Tool spells. It worked! Alleluia!

    TP2 File Editing Methodology
    -Put "INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~" after the LANGUAGE code and the "Begin @ code. In this case, it was after the Begin @55" for SoA teleportin' and "Begin @56" for ToB teleportin'. (This include is listed twice.)

    -Wherever I saw "APPEND ~Spell.ids~" I commented out that line and in its place put "LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END" - which is an adapted version of the line Olvyn had us use at the start of the post. I ensured the case of each filename was the same in the resref/scroll sections and in the mod's files.

    -I saved my work before installing the mod. (BG was closed at installation time.)

    Questions
    -Do mods with this spell tool applied need EEex installed first?

    -I also heard that spells added this way aren't detected by the AI. Is this true? If so, is this the Advanced AI script for buffing, etc., the general enemy AI, SCS AI, or otherwise?

    -I noticed various spell-adding mods don't use the "append to Spell.ids" functionality but instead use COPY and WRITE. What's the best way to add them via your spell tool? (Various mods I tried editing for test purposes gave me this error log when attempting to install.)

    -For this function, how to determine kit names for mod-added kits? For example, I wanted to add arcane spells but exclude AionZ's Warlock, Shadow Adept, and Shadow Disciple.
    BACKUP ~Teleport/backup~
    AUTHOR ~Razfallow~
    
    ALWAYS
    	ACTION_DEFINE_ARRAY RZ_reload BEGIN
    	"Setup"
    	END
    	ACTION_DEFINE_ARRAY RZ_noconvert BEGIN END 
    	LAF HANDLE_CHARSETS
    		INT_VAR
    		infer_charset = 1
    		STR_VAR
    		tra_path = EVAL ~%MOD_FOLDER%/languages~
    		noconvert_array = RZ_noconvert
    		reload_array = RZ_reload
    	END
    END
    
    LANGUAGE ~Cesky~
             ~cesky~
             ~Teleport/languages/czech/setup.tra~
    LANGUAGE ~English~
             ~english~
             ~Teleport/languages/english/setup.tra~
    LANGUAGE ~Russian (by www.aerie.ru)~
             ~russian~
             ~Teleport/languages/russian/setup.tra~
    LANGUAGE ~Italiano (by Ilot)~
             ~italian~
             ~Teleport/languages/italian/setup.tra~
    LANGUAGE ~Polski (by yarpen)~
             ~polish~
             ~Teleport/languages/polish/setup.tra~
    LANGUAGE ~Deutsche (by Drogan Di'Umptu)~
             ~german~
             ~Teleport/languages/german/setup.tra~
    LANGUAGE ~Spanish (by Ethelien and Memnoch, special thanks to Ancalagon)~
             ~spanish~
             ~Teleport/languages/spanish/setup.tra~
    LANGUAGE ~French (by Skipcool)~
             ~french~
             ~Teleport/languages/french/setup.tra~
    
    ////////////////////
    //Teleport for SoA//
    ////////////////////
    BEGIN @55
    
    INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut01.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-soa~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-soa.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    
    COPY_EXISTING ~scrolls.sto~	~override~
    			~uddrow25.sto~	~override~	ADD_STORE_ITEM ~RZTELEP~ LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END //The filenames used this Sentence case for the spell name, unlike the [i]summon cow[/i] spell example which was all CAPS.
    
    //APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~ //We no longer append to Spell.ids with Olvyn's spell tool. 
    
    COPY_EXISTING ~AR0302.are~ ~override~
                  ~AR0305.are~ ~override~
                  ~AR0306.are~ ~override~
                  ~AR0412.are~ ~override~
                  ~AR0509.are~ ~override~
                  ~AR1005.are~ ~override~
                  ~AR1010.are~ ~override~
                  ~AR1201.are~ ~override~
                  ~AR1203.are~ ~override~
                  ~AR3003.are~ ~override~
                  ~AR5501.are~ ~override~
                  ~AR5502.are~ ~override~
      PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN // protects against invalid files
        READ_ASCII 0x94 "script"
        PATCH_IF (("" STRING_COMPARE_CASE "%script%" = 0) OR ("None" STRING_COMPARE_CASE "%script%" = 0)) BEGIN
          WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
        END
      END
      BUT_ONLY_IF_IT_CHANGES
    
    EXTEND_TOP ~AR0020.bcs~  ~Teleport/area-baf/AR0020.baf~
    EXTEND_TOP ~AR0202.bcs~  ~Teleport/area-baf/AR0202.baf~
    EXTEND_TOP ~AR0203.bcs~  ~Teleport/area-baf/AR0203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0300.bcs~  ~Teleport/area-baf/AR0300.baf~
    EXTEND_TOP ~AR0307.bcs~  ~Teleport/area-baf/AR0307.baf~
    EXTEND_TOP ~AR0308.bcs~  ~Teleport/area-baf/AR0308.baf~
    EXTEND_TOP ~AR0311.bcs~  ~Teleport/area-baf/AR0311.baf~
    EXTEND_TOP ~AR0313.bcs~  ~Teleport/area-baf/AR0313.baf~
    EXTEND_TOP ~AR0328.bcs~  ~Teleport/area-baf/AR0328.baf~
    EXTEND_TOP ~AR0329.bcs~  ~Teleport/area-baf/AR0329.baf~
    EXTEND_TOP ~AR0205.bcs~  ~Teleport/area-baf/AR0205.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0400.bcs~  ~Teleport/area-baf/AR0400.baf~
    EXTEND_TOP ~AR0402.bcs~  ~Teleport/area-baf/AR0402.baf~
    EXTEND_TOP ~AR0404.bcs~  ~Teleport/area-baf/AR0404.baf~
    EXTEND_TOP ~AR0405.bcs~  ~Teleport/area-baf/AR0405.baf~
    EXTEND_TOP ~AR0406.bcs~  ~Teleport/area-baf/AR0406.baf~
    EXTEND_TOP ~AR0410.bcs~  ~Teleport/area-baf/AR0410.baf~
    EXTEND_TOP ~AR0411.bcs~  ~Teleport/area-baf/AR0411.baf~
    EXTEND_TOP ~AR0413.bcs~  ~Teleport/area-baf/AR0413.baf~
    EXTEND_TOP ~AR0500.bcs~  ~Teleport/area-baf/AR0500.baf~
    EXTEND_TOP ~AR0510.bcs~  ~Teleport/area-baf/AR0510.baf~
    EXTEND_TOP ~AR0512.bcs~  ~Teleport/area-baf/AR0512.baf~
    EXTEND_TOP ~AR0607.bcs~  ~Teleport/area-baf/AR0607.baf~
    EXTEND_TOP ~AR0700.bcs~  ~Teleport/area-baf/AR0700.baf~
    EXTEND_TOP ~AR0701.bcs~  ~Teleport/area-baf/AR0701.baf~
    EXTEND_TOP ~AR0702.bcs~  ~Teleport/area-baf/AR0702.baf~
    EXTEND_TOP ~AR0334.bcs~  ~Teleport/area-baf/AR0334.baf~
    EXTEND_TOP ~AR0704.bcs~  ~Teleport/area-baf/AR0704.baf~
    EXTEND_TOP ~AR0705.bcs~  ~Teleport/area-baf/AR0705.baf~
    EXTEND_TOP ~AR0709.bcs~  ~Teleport/area-baf/AR0709.baf~
    EXTEND_TOP ~AR0800.bcs~  ~Teleport/area-baf/AR0800.baf~
    EXTEND_TOP ~AR0801.bcs~  ~Teleport/area-baf/AR0801.baf~
    EXTEND_TOP ~AR0803.bcs~  ~Teleport/area-baf/AR0803.baf~
    EXTEND_TOP ~AR0900.bcs~  ~Teleport/area-baf/AR0900.baf~
    EXTEND_TOP ~AR0901.bcs~  ~Teleport/area-baf/AR0901.baf~
    EXTEND_TOP ~AR0902.bcs~  ~Teleport/area-baf/AR0902.baf~
    EXTEND_TOP ~AR0903.bcs~  ~Teleport/area-baf/AR0903.baf~
    EXTEND_TOP ~AR0904.bcs~  ~Teleport/area-baf/AR0904.baf~
    EXTEND_TOP ~AR1000.bcs~  ~Teleport/area-baf/AR1000.baf~
    EXTEND_TOP ~AR1002.bcs~  ~Teleport/area-baf/AR1002.baf~
    EXTEND_TOP ~AR1003.bcs~  ~Teleport/area-baf/AR1003.baf~
    EXTEND_TOP ~AR1006.bcs~  ~Teleport/area-baf/AR1006.baf~
    EXTEND_TOP ~AR1100.bcs~  ~Teleport/area-baf/AR1100.baf~
    EXTEND_TOP ~AR1102.bcs~  ~Teleport/area-baf/AR1102.baf~
    EXTEND_TOP ~AR1104.bcs~  ~Teleport/area-baf/AR1104.baf~
    EXTEND_TOP ~AR1105.bcs~  ~Teleport/area-baf/AR1105.baf~
    EXTEND_TOP ~AR1200.bcs~  ~Teleport/area-baf/AR1200.baf~
    EXTEND_TOP ~AR1202.bcs~  ~Teleport/area-baf/AR1202.baf~
    EXTEND_TOP ~AR1204.bcs~  ~Teleport/area-baf/AR1204.baf~
    EXTEND_TOP ~AR1300.bcs~  ~Teleport/area-baf/AR1300.baf~
    EXTEND_TOP ~AR1302.bcs~  ~Teleport/area-baf/AR1302.baf~
    EXTEND_TOP ~AR1303.bcs~  ~Teleport/area-baf/AR1303.baf~
    EXTEND_TOP ~AR1401.bcs~  ~Teleport/area-baf/AR1401.baf~
    EXTEND_TOP ~AR1402.bcs~  ~Teleport/area-baf/AR1402.baf~
    EXTEND_TOP ~AR1404.bcs~  ~Teleport/area-baf/AR1404.baf~
    EXTEND_TOP ~AR1600.bcs~  ~Teleport/area-baf/AR1600.baf~
    EXTEND_TOP ~AR1602.bcs~  ~Teleport/area-baf/AR1602.baf~
    EXTEND_TOP ~AR1611.bcs~  ~Teleport/area-baf/AR1611.baf~
    EXTEND_TOP ~AR1700.bcs~  ~Teleport/area-baf/AR1700.baf~
    EXTEND_TOP ~AR1800.bcs~  ~Teleport/area-baf/AR1800.baf~
    EXTEND_TOP ~AR1900.bcs~  ~Teleport/area-baf/AR1900.baf~
    EXTEND_TOP ~AR1901.bcs~  ~Teleport/area-baf/AR1901.baf~
    EXTEND_TOP ~AR2000.bcs~  ~Teleport/area-baf/AR2000.baf~
    EXTEND_TOP ~AR2002.bcs~  ~Teleport/area-baf/AR2002.baf~
    EXTEND_TOP ~AR2007.bcs~  ~Teleport/area-baf/AR2007.baf~
    EXTEND_TOP ~AR2008.bcs~  ~Teleport/area-baf/AR2008.baf~
    EXTEND_TOP ~AR2010.bcs~  ~Teleport/area-baf/AR2010.baf~
    EXTEND_TOP ~AR2100.bcs~  ~Teleport/area-baf/AR2100.baf~
    EXTEND_TOP ~AR2200.bcs~  ~Teleport/area-baf/AR2200.baf~
    EXTEND_TOP ~AR2201.bcs~  ~Teleport/area-baf/AR2201.baf~
    EXTEND_TOP ~AR2202.bcs~  ~Teleport/area-baf/AR2202.baf~
    EXTEND_TOP ~AR2300.bcs~  ~Teleport/area-baf/AR2300.baf~
    EXTEND_TOP ~AR2400.bcs~  ~Teleport/area-baf/AR2400.baf~
    EXTEND_TOP ~AR2402.bcs~  ~Teleport/area-baf/AR2402.baf~
    EXTEND_TOP ~AR2500.bcs~  ~Teleport/area-baf/AR2500.baf~
    EXTEND_TOP ~AR2600.bcs~  ~Teleport/area-baf/AR2600.baf~
    EXTEND_TOP ~AR2800.bcs~  ~Teleport/area-baf/AR2800.baf~
    EXTEND_TOP ~AR2801.bcs~  ~Teleport/area-baf/AR2801.baf~
    EXTEND_TOP ~AR2802.bcs~  ~Teleport/area-baf/AR2802.baf~
    EXTEND_TOP ~AR0001.bcs~  ~Teleport/area-baf/AR0001.baf~
    EXTEND_TOP ~AR0003.bcs~  ~Teleport/area-baf/AR0003.baf~
    EXTEND_TOP ~AR0004.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0021.bcs~  ~Teleport/area-baf/AR0004.baf~
    EXTEND_TOP ~AR0609.bcs~  ~Teleport/area-baf/AR0609.baf~
    EXTEND_TOP ~AR0302.bcs~  ~Teleport/area-baf/AR0302.baf~
    EXTEND_TOP ~AR0305.bcs~  ~Teleport/area-baf/AR0305.baf~
    EXTEND_TOP ~AR0306.bcs~  ~Teleport/area-baf/AR0306.baf~
    EXTEND_TOP ~AR0319.bcs~  ~Teleport/area-baf/AR0319.baf~
    EXTEND_TOP ~AR0408.bcs~  ~Teleport/area-baf/AR0408.baf~
    EXTEND_TOP ~AR0412.bcs~  ~Teleport/area-baf/AR0412.baf~
    EXTEND_TOP ~AR0509.bcs~  ~Teleport/area-baf/AR0509.baf~
    EXTEND_TOP ~AR0513.bcs~  ~Teleport/area-baf/AR0513.baf~
    EXTEND_TOP ~AR0703.bcs~  ~Teleport/area-baf/AR0703.baf~
    EXTEND_TOP ~AR0706.bcs~  ~Teleport/area-baf/AR0706.baf~
    EXTEND_TOP ~AR1005.bcs~  ~Teleport/area-baf/AR1005.baf~
    EXTEND_TOP ~AR1010.bcs~  ~Teleport/area-baf/AR1010.baf~
    EXTEND_TOP ~AR1201.bcs~  ~Teleport/area-baf/AR1201.baf~
    EXTEND_TOP ~AR1203.bcs~  ~Teleport/area-baf/AR1203.baf~
    EXTEND_TOP ~AR2101.bcs~  ~Teleport/area-baf/AR2101.baf~
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR0707.bcs~ THEN BEGIN
      EXTEND_TOP ~AR0707.bcs~  ~Teleport/area-baf/AR0003.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1604.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1604.bcs~  ~Teleport/area-baf/AR0609.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR1603.bcs~ THEN BEGIN
      EXTEND_TOP ~AR1603.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ACTION_IF FILE_EXISTS_IN_GAME ~AR2001.bcs~ THEN BEGIN
      EXTEND_TOP ~AR2001.bcs~  ~Teleport/area-baf/AR0001.baf~
    END
    
    ////////////////////
    //Teleport for ToB//
    ////////////////////
    
    BEGIN @56
    
    INCLUDE ~%MOD_FOLDER%/ClassSpellTool.TPA~
    
    ACTION_IF NOT FILE_EXISTS_IN_GAME ~Mel01.cre~ THEN BEGIN
      PRINT @57
    END ELSE BEGIN
    
    ACTION_IF NOT FILE_EXISTS ~override/RZcut112.bcs~
    THEN BEGIN
    COPY ~Teleport/cutscene-tob~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730a.bam~
    THEN BEGIN
    COPY ~Teleport/bam~ ~override~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.bcs~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.bcs~ ~override/RZtelep.bcs~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.cre~
    THEN BEGIN
    COPY ~Teleport/invisiblecre/RZtelep.cre~ ~override/RZtelep.cre~
          SAY NAME1 @1
          SAY NAME2 @1
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.dlg~
    THEN BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep-tob.d~
    USING   ~Teleport/%s/setup.tra~
    END ELSE BEGIN
    COMPILE ~Teleport/invisiblecre/RZtelep.d~
    USING   ~Teleport/%s/setup.tra~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.eff~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.eff~ ~override/RZtelep.eff~
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/RZtelep.itm~
    THEN BEGIN
    COPY ~Teleport/spl/RZtelep.itm~ ~override/RZtelep.itm~
          SAY NAME2 @1
          SAY DESC  @2
    END
    
    ACTION_IF NOT FILE_EXISTS ~override/Spwi730.spl~
    THEN BEGIN
    COPY ~Teleport/spl/Spwi730.spl~ ~override/Spwi730.spl~
          SAY NAME1 @1
          SAY UNIDENTIFIED_DESC @2
    END
    
    COPY_EXISTING	~25spell.sto~ ~override~
    				~25spell2.sto~ ~override~
    				~garlena.sto~ ~override~	ADD_STORE_ITEM ~RZTELEP~  LAST #1 #1 #1 ~IDENTIFIED~ #1
    
    LAF ADD_CLASS_SPELL STR_VAR resref=~Spwi730~ scroll=~RZtelep~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END //The filenames used this Sentence case for the spell name, unlike the [i]summon cow[/i] spell example which was all CAPS.
    
    //APPEND ~Spell.ids~ ~2730 WIZARD_TELEPORT~ UNLESS ~2730 WIZARD_TELEPORT~ //We use Olvyn's spell tool instead of appending to Spell.ids.
    
    EXTEND_TOP ~AR3000.bcs~  ~Teleport/area-baf/AR3000.baf~
    EXTEND_TOP ~AR3001.bcs~  ~Teleport/area-baf/AR3001.baf~
    EXTEND_TOP ~AR3015.bcs~  ~Teleport/area-baf/AR3015.baf~
    EXTEND_TOP ~AR3016.bcs~  ~Teleport/area-baf/AR3016.baf~
    EXTEND_TOP ~AR3017.bcs~  ~Teleport/area-baf/AR3017.baf~
    EXTEND_TOP ~AR3019.bcs~  ~Teleport/area-baf/AR3019.baf~
    EXTEND_TOP ~AR3020.bcs~  ~Teleport/area-baf/AR3020.baf~
    EXTEND_TOP ~AR5200.bcs~  ~Teleport/area-baf/AR5200.baf~
    EXTEND_TOP ~AR5201.bcs~  ~Teleport/area-baf/AR5201.baf~
    EXTEND_TOP ~AR5202.bcs~  ~Teleport/area-baf/AR5202.baf~
    EXTEND_TOP ~AR5203.bcs~  ~Teleport/area-baf/AR5203.baf~
    EXTEND_TOP ~AR0204.bcs~  ~Teleport/area-baf/AR0204.baf~
    EXTEND_TOP ~AR5500.bcs~  ~Teleport/area-baf/AR5500.baf~
    EXTEND_TOP ~AR5504.bcs~  ~Teleport/area-baf/AR5504.baf~
    EXTEND_TOP ~AR5509.bcs~  ~Teleport/area-baf/AR5509.baf~
    EXTEND_TOP ~AR6000.bcs~  ~Teleport/area-baf/AR6000.baf~
    EXTEND_TOP ~AR6003.bcs~  ~Teleport/area-baf/AR6003.baf~
    EXTEND_TOP ~AR6004.bcs~  ~Teleport/area-baf/AR6004.baf~
    EXTEND_TOP ~AR6005.bcs~  ~Teleport/area-baf/AR6005.baf~
    EXTEND_TOP ~AR6100.bcs~  ~Teleport/area-baf/AR6100.baf~
    EXTEND_TOP ~AR6101.bcs~  ~Teleport/area-baf/AR6101.baf~
    EXTEND_TOP ~AR6104.bcs~  ~Teleport/area-baf/AR6104.baf~
    EXTEND_TOP ~AR6106.bcs~  ~Teleport/area-baf/AR6106.baf~
    EXTEND_TOP ~AR6108.bcs~  ~Teleport/area-baf/AR6108.baf~
    EXTEND_TOP ~AR6400.bcs~  ~Teleport/area-baf/AR6400.baf~
    EXTEND_TOP ~AR3003.bcs~  ~Teleport/area-baf/AR3003.baf~
    EXTEND_TOP ~AR5204.bcs~  ~Teleport/area-baf/AR5204.baf~
    EXTEND_TOP ~AR5501.bcs~  ~Teleport/area-baf/AR5501.baf~
    EXTEND_TOP ~AR5502.bcs~  ~Teleport/area-baf/AR5502.baf~
    EXTEND_TOP ~AR6300.bcs~  ~Teleport/area-baf/AR6300.baf~
    END
    
    BEGIN  @54
    EXTEND_BOTTOM ~AERIE.BCS~ ~Teleport/change/aerie.baf~
    EXTEND_BOTTOM ~ANOMEN.BCS~ ~Teleport/change/anomen.baf~
    EXTEND_BOTTOM ~BALDUR.BCS~ ~Teleport/change/baldur.baf~
    EXTEND_BOTTOM ~CERND.BCS~ ~Teleport/change/cernd.baf~
    EXTEND_BOTTOM ~EDWIN.BCS~ ~Teleport/change/edwin.baf~
    EXTEND_BOTTOM ~JAHEIRA.BCS~ ~Teleport/change/jaheira.baf~
    EXTEND_BOTTOM ~JAN.BCS~ ~Teleport/change/jjansen.baf~
    EXTEND_BOTTOM ~MAZZY.BCS~ ~Teleport/change/mazzy.baf~
    EXTEND_BOTTOM ~NALIA.BCS~ ~Teleport/change/nalia.baf~
    
    COMPILE ~Teleport/change/cernd.d~
    

    Thankee!
    Post edited by Endarire on
  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    -Do mods with this spell tool applied need EEex installed first?

    No.
    Endarire wrote: »
    -I also heard that spells added this way aren't detected by the AI. Is this true? If so, is this the Advanced AI script for buffing, etc., the general enemy AI, SCS AI, or otherwise?

    Spellcasters only cast a spell if their script specifically tells them to cast that spell, and the conditions are met. There's nothing in spellcaster scripts that tells them to cast spells that weren't originally in the game, unless a mod were to add code to those scripts telling them to cast those spells. The exception is if it's a mod like Spell Revisions that replaces existing spells with new spells; in that case, enemies will cast the replacement spells.
    -I noticed various spell-adding mods don't use the "append to Spell.ids" functionality but instead use COPY and WRITE. What's the best way to add them via your spell tool? (Various mods I tried editing for test purposes gave me this error log when attempting to install.)

    Appending to Spell.ids is only important for scripting purposes (and still not totally necessary for scripting), and is not necessary in order to add a new spell. The way to add a new spell without this tool is to prefix the filename with "SPWI" (for mage spells) or "SPPR" (for priest spells), followed by a digit between 1 and 9 (determining the spell level) and a two-digit number that's less than 51. This will add the spell to the game even if it's not in Spell.ids.

    Looking at the error message, it seems like you made some sort of syntax error. It would be hard to know exactly what's going wrong without looking at the edited tp2 file.

    Also, you should make sure to get the mod author's permission before releasing a modified version of their mod.
    -For this function, how to determine kit names for mod-added kits? For example, I wanted to add arcane spells but exclude AionZ's Warlock, Shadow Adept, and Shadow Disciple.

    You don't need to explicitly exclude those kits from each spell. As long as the mod that adds those kits inserts those kits into the list called me_excludeAllNormalWizardSpellsFromTheseKits in M_MEEXSP.lua, they won't learn the spells you add.
  • EndarireEndarire Member Posts: 1,519
    Thankee for the clarity. I realized I made some syntax errors and fixed them since.

    I was concerned that AI casters for certain mods that add new spells and casters for these spells that this tool would somehow prevent the AI from casting the same spells with the tool applied. For example, Saradas Magic has new spells and 1 NPC that can cast these spells.

    How to determine the in-code name of a kit? For example, I was working with shohy the author of Diablo II kits and he intended to add your spell tool to his kits. His kits add spells specifically to the new kits (for Cleric, Druid, and Sorcerer) and I want to ensure only the new kits can cast their new kit spells.
  • OlvynChuruOlvynChuru Member Posts: 3,079
    I was concerned that AI casters for certain mods that add new spells and casters for these spells that this tool would somehow prevent the AI from casting the same spells with the tool applied. For example, Saradas Magic has new spells and 1 NPC that can cast these spells.

    As long as the mod doesn't dynamically change the spell filename to begin with SPWI or SPPR, it shouldn't be problem. Even in those cases, spellcaster scripts could still cast the spells if they were changed to use the SpellRES/SpellPointRES actions (referencing the filename of the spell rather than a Spell.ids entry) instead of Spell/SpellPoint.
    How to determine the in-code name of a kit? For example, I was working with shohy the author of Diablo II kits and he intended to add your spell tool to his kits. His kits add spells specifically to the new kits (for Cleric, Druid, and Sorcerer) and I want to ensure only the new kits can cast their new kit spells.

    Look in the tp2 file that adds the kit and find where it says:
    ADD_KIT
    

    For example, the portion of the mod that adds the sorcerer kit says:
    ADD_KIT ~D2SO~
    

    D2SO is "in-code" name of the kit.

    Here's a line of code that would allow this kit to choose to learn the "Ice Bolt" spell added by the mod when leveling up.
    LAF ADD_CLASS_SPELL STR_VAR resref=~D2SOR10~ kit_include=~{'D2SO'}~ END
    

    Important note: this tool is not necessary to make a specific kit automatically learn a spell at a specific level. You can already do that in the base game by putting the spell in the CLAB file for the kit (as is done for kits like the beast master, stalker, and avenger in the unmodded game). This tool, on the other hand, can give a sorcerer or shaman kit the option to learn a spell, including it in the list of spells they can choose to learn when leveling up.

    If this sorcerer kit is supposed to automatically learn the new spells once they're high enough level to cast them, this tool is unnecessary.
  • EndarireEndarire Member Posts: 1,519
    I was most concerned about applying your spell tool to the D2 Necromancer (Cleric) & Druid kits for their spells.

    Thankee!
  • OlvynChuruOlvynChuru Member Posts: 3,079
    Endarire wrote: »
    I was most concerned about applying your spell tool to the D2 Necromancer (Cleric) & Druid kits for their spells.

    Thankee!

    If those kits are supposed to automatically learn the new spells when they reach a high enough level, this tool is unnecessary.
  • EndarireEndarire Member Posts: 1,519
    Maybe I was misunderstanding or wrongly implementing stuff, but, for example, when I tried applying your spell tool to summon cow from Shards of Ice with Tome & Blood's Sorcerer spell swap installed afterward, I couldn't learn summon cow as a Sor spell. Every time I tried, I just cast the spell without learning it. This was unlike teleport where these mods worked together.

    When I tried applying your spell tool to Red Dragon Summoning then installing T&B's Sor spell swap, I couldn't learn ANY level 9 spells, or the spell level of red dragon summoning.

    How to fix?

    Thankee!
  • EndarireEndarire Member Posts: 1,519
    edited July 2023
    @OlvynChuru
    I've been following your advice for the D2 Necromancer & Druid. I know the D2 Necromancer is class kit D2NE and D2 Druid is D2DR.

    I checked files in the SPL and SPLEE directories in Near Infinity and the spell names were either blank or unrelated to the kit. How to tell what spell files belong to what spells?

    If applying your spell tool to spells, how to, for example, programmatically handle 'extended' versions of spells - ones with higher level caps - such as a D2 Necromancer's corpse explosion, poison explosion, attract, and revive?

    PS: The D2 Sor is seemingly meant to learn all its spells automatically. How to allow it to learn other spells, such as dispel magic, time stop, and your teleport circle?

    Also, with the split of functionality among the files, where to include your ClassSpellTool.TPA and where to apply your tool to each spell individually (D2NEC16, etc.)?

    Thankee!
  • OlvynChuruOlvynChuru Member Posts: 3,079

    Endarire wrote: »
    I checked files in the SPL and SPLEE directories in Near Infinity and the spell names were either blank or unrelated to the kit. How to tell what spell files belong to what spells?

    If you install the mod (and then reset NearInfinity), the mod will probably give descriptions to the spells it adds. Check for spells that have new descriptions rather than copies of vanilla descriptions. If you know the modding prefix of the mod, you should look for spells that start with that prefix.

    It's probably unnecessary anyway, as I don't think that mod does not need to use this tool for anything.

    Endarire wrote: »
    PS: The D2 Sor is seemingly meant to learn all its spells automatically. How to allow it to learn other spells, such as dispel magic, time stop, and your teleport circle?

    Can it not learn those spells already? Why wouldn't it be able to? Have you tested it and found that the kit can't learn those spells?
  • jmerryjmerry Member Posts: 3,881
    Probably because the kit isn't supposed to learn those spells; it's supposed to emulate the Diablo II sorceress, and absolutely everything she can cast is elemental-themed. Spells like Dispel Magic and Time Stop don't fit the theme.

    It's as if you found a screwdriver, and now everything looks like a nail to you. First, pay attention to what the tool is actually good for. Then, consider whether what you're looking at matches that. Only use the tool if it'll actually do something useful. And retrofitting existing mods that already work is unlikely to be one of those applications.
  • EndarireEndarire Member Posts: 1,519
    @OlvynChuru
    I was surprised to learn that the spells gained their normal names in NI after being installed but that I had to check my override directory and not the install directory. (The install directory files still have no spell names.) I'm unsure how much making a new install helped.

    As jmerry said, the D2 kits try to emulate the Diablo II classes in terms of their abilities, though the adaptation is not 1:1 Newly-made D2 Druids & D2 Necromancers start with the normal Druid & Cleric spell lists respectively plus their kit-specific spells, but soon after the game starts, some script strips these kits of all spells except their kit-added spells. The D2 Sor kit knows all spells of all spell levels it can cast, and even though it still gains spells known from outside the kit at character creation or level time, these extra spells are very soon stripped away after gaining them. That's why I was asking about using Olvyn's Spell Tool to add certain spells like dispel to these kits, though handling the kit scripting seems far more important and relevant for this purpose.

    Regarding other spell mods I mentioned above such as Red Dragon Summoning, what was it about how things interacted that caused them not to work with Tome & Blood's spell learning UI but still work otherwise?

    Thankee!
  • EndarireEndarire Member Posts: 1,519
    @OlvynChuru
    Update! I suspect some of the T&B trouble was due to certain spells normally not being learnable by, say, a Sor but put on the spell list of the Sor via this spell tool. I checked Red Dragon Summoning, for example, and learned that the spell is learnable normally by a Wizard, but not a Sor. How to change this to make a Sor be able to learn this spell without the tool so I could use the tool to put it on their spell list?

    Thankee!
  • EndarireEndarire Member Posts: 1,519
    @OlvynChuru
    After further research, I learned that some classes & kits use CLAB files to determine what spells they can learn.

    However, my questions regarding the D2 kits still remain: How to apply this spell tool to spells with multiple versions, like corpse explosion and revive since they have multiple files? In theory, applying the spell tool to all versions of these spells would work since the kit mods seemingly install only one version of these spells.

    Thankee!
  • FrenzgynFrenzgyn Member Posts: 80
    edited February 25
    OlvynChuru wrote: »
    Okay, I just updated this tool to keep track of all spells added with it (along with the vanilla SPWI and SPPR spells that can be learned) in a series of .txt files: MEWI[1-9].txt for wizard spells and MEPR[1-7].txt for priest spells. They can be read using READ_2DA_ENTRY and similar functions.

    Also...

    @TheArtisan
    TheArtisan wrote: »
    I was hoping for some more help with this tool. So far most things work as intended, but I'm still having some issues. I'm not literate enough to understand exactly what's going on, but I'll try my best to explain.

    The first thing is that the tool adds a bunch of priest spells that don't do anything that I assume is supposed to be some kind of filler and aren't supposed to be in the priest spellbook, but I can see and memorize them. I see their names are added to hidespl.2da, but are enabled under IS_REMOVED instead of IS_HIDDEN.

    I noticed classes with scroll exclusion, in my case my shadow adept kits, become unable to drink potions or use any 'converse' action other than scribing the scrolls they are allowed to. I have a faint idea as to why this happens in regards to how scrolls are excluded but I have no idea how to fix it.

    The last thing is that when I use this tool together with the newest pre-release of EEEx, which I just started experimenting with recently, all 'converse' options just stop working entirely. No one can scribe scrolls or drink potions at all. I'm not sure whether it's some kind of incompatibility caused by the update to EEEx and I don't even know who to bring this issue to, but it's made it unusable for me currently.

    I think the current update should fix these issues.

    Hello @OlvynChuru

    It seems the first issue reported by TheArtisan is only partially fixed:

    SPPR149, SPPR249, SPPR349, SPPR449, SPPR549, SPPR649 and SPPR749 are correctly removed for true classes and multi classes but not for kits, so, for example a "DRUID" will be ok, an "AVENGER" will have the appropriate SPPR*49 spells wrote in their spell books after level up.
Sign In or Register to comment.