Skip to content

Need help with a simple backstab script.

Gel87Gel87 Member Posts: 330
Yo. Im in the making of a kit called:
«Woodclan Ninja»

He is going to have a «Ninja Charge» innate skill.
This skill will have projectile simulating the Ninja charge at rapid speed into a targeted enemy, meanwhile he will infact teleport to him, plan is that it will also increase taco and perform a backstab. I know how to set a script to my char, but not how i can make the backstab happen.

So skill will:
- Teleport to target, projectile perform the visual movement.
- Increase taco shortly or for next attack.
- Set global value to trigger script.
- Set backstab active unless script can handle this.
- Make char invisible.

So all script needs to do, is to perform the actual backstab.

Other versions are welcome as well.

Will be a fun ninja built upon a stalker kit, but with ninja stars and wepons :)

Comments

  • jmerryjmerry Member Posts: 4,091
    There's no way to script the facing element of a backstab.

    So if you want a scripted backstab, you need an effect like Assassinate. Which opens up issues if you interrupt that script. And the invisibility doesn't matter.

    Note that enemies ignore the facing element; they get a backstab just by being invisible.
  • Gel87Gel87 Member Posts: 330
    jmerry wrote: »
    There's no way to script the facing element of a backstab.

    So if you want a scripted backstab, you need an effect like Assassinate. Which opens up issues if you interrupt that script. And the invisibility doesn't matter.

    Note that enemies ignore the facing element; they get a backstab just by being invisible.

    Okay thanks.
    Yes i found this topic. I will have a look when im on a none work pc :p

    https://forums.beamdog.com/discussion/66096/backstabbing-script

    So I guess i will be able to use something of that.
    Topic also contains information of creature scripts i can browse.

    I will also make a HLA where i ninjacharge 2-3 enemies, and then summons 2-3 ninja stars as magical wepons and throw those at nearest, secondnearest and 3rd nearest enemy xD

    I will use global values to prevent backstabbing features such as assassinate active longer than intended.
  • Gel87Gel87 Member Posts: 330
    edited February 19
    Okay.
    So i made some stuff:

    GelNi12.spl:
    Projectile: None (Copied a flamestrike and modified to innate and removed effects.)
    BLUR, self 1 second.
    Invisibility, self, 40 seconds. (Will be removed by the attack itself, require testing)
    Movement rate bonus(126). self, increase, 10, 4 seconds (want to make sure i reach enemy)
    Thaco bonus, self, increase, 4, 4 seconds
    Damage: Preset target, permanent/until death, ammount 1, Piercing. (dont know how to let script target if not xD)
    Modify Global Value: Set, 1, "NinjaCharge"

    GelNi10.spl:
    Backstab every hit, self

    GelNi11.spl:
    Remove Effects by resources(321), self, backstab every hit

    Script:
    IF
        Kit(Myself,GelNinj)
        Global("NinjaCharge","LOCALS",1)
    THEN
        RESPONSE #100
            MoveToObject(HitBy(Myself,PIERCING))
            ApplySpellRES("GelNi10",Myself) // Assassination
            SetGlobal("NinjaCharge","LOCALS",2)
    END
    
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
    THEN
        RESPONSE #100
            AttackOneRound(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi11",Myself)  // Remove Assassination
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    

    Can this work?

    I think i need to make a spell with Set AI Script (82) casted at level 1 from Clab table to put script on myself.
    Worked fine with vampire SunBurn script i made. If it was another OP code i can crosscheck with that kit when i get home :) Works even with AI setting OFF.

    Maby i need Modify collission behaviour (300) to avoid lame stucks? Or maby i need to use FlyToObject instead? Did not exist, it was FlyToPoint...

    Also, do I need to use ActionOverride()?
    Post edited by Gel87 on
  • Gel87Gel87 Member Posts: 330
    Actually thinking some more about this i should check for invsibility. Else one might end up backstabbing some1 10 times in a row during that AttackOneRound...
    IF
        Kit(Myself,GelNinj)
        Global("NinjaCharge","LOCALS",1)
    THEN
        RESPONSE #100
            MoveToObject(HitBy(Myself,PIERCING))
            ApplySpellRES("GelNi10",Myself) // Assassination
            SetGlobal("NinjaCharge","LOCALS",2)
    END
    
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        StateCheck(Myself, INVISIBLE)
    THEN
        RESPONSE #100
            AttackOneRound(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi11",Myself) // Remove Assassination
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        !StateCheck(Myself, INVISIBLE)
    THEN
        RESPONSE #100
            ApplySpellRES("GelNi11",Myself) // Remove Assassination
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    
  • Gel87Gel87 Member Posts: 330
    edited February 21
    Yo, anyone know what i did wrong?

    Weidu message:
    Install Component [Add kit GelNinj]?
    [I]nstall, or [N]ot Install or [Q]uit? i
    
    Installing [Add kit GelNinj] [v1.0]
    ERROR: cannot convert kit or %kit% to an integer
    Stopping installation because of error.
    
    ERROR Installing [Add kit GelNinj], rolling back to previous state
    Will uninstall   0 files for [GELNINJ/GELNINJ.TP2] component 1.
    Uninstalled      0 files for [GELNINJ/GELNINJ.TP2] component 1.
    ERROR: Not_found
    Please make a backup of the file: SETUP-GELNINJ.DEBUG and look for support at: Gel87
    
    Install Component [Add kit GelNinj]?
    [I]nstall, or [N]ot Install or [Q]uit?
    

    Kit part of tp2:
    BEGIN ~Add kit GelNinj~
    
    INCLUDE "GelNinj/Argen77 add kit/a7-add_kit_ex/a7#add_kit_ex.tpa"
    
    LAF ADD_KIT_EX
    	INT_VAR
    		kit class = 12
    		mixed = ~Woodclan Ninja~
    		lower = ~woodclan ninja~
    		help = ~Woodclan Ninja: A stalker kit utilizing light Ninja Swords and Ninja Stars. As well as a few selective innate nature spells.
    
    Advantages:
    - May put 5 profience points into Darts (Ninja Stars = Darts Profience)
    - Gets Charm Animal spell as usual.
    - May use Stalker Gloves at full effectivness as well as gloves and a upgradedable version is availeble in BG2EE.
    - May use innate versions of Insect Plague(Level 11), Creeping Doom(Level 17) and Nature's Peace(Level 17)
    - Gets Shadowstep at level 2, 5, 8.
    - Gets invisibility at level 9 and 12.
    - Gets Ninja Charge Albility in level 1 and 7.
    - Starts with 2 profience points to Dual Wielding and may put a 3rd point.
    - Can put 3 points into Katana, Scimitar/Wakasaki and Quarterstaff.
    - Else same bonuses as stalker.
    
    Ninja Charge:
    The Woodclan Ninja turns invisible and rapidly charge into a selected enemy and attack him one round with backstab. The attack has a +4 bonus to Thaco.
    
    Dissadvantages:
    - 10 Thaco Penalty on none profient wepons. 
    - May not put profience point Bastardsword, 2 handed sword, Warhammer, Flail/Monrningstar, Crossbow, Longbow, Shortbow.
    - May not use ranged wepons other than darts and sling~
    		biography = ~Somehow you felt the Urge to explore the world outside the forests~
    	STR_VAR
    		kit_name = ~GelNinj~ // Woodclan Ninja 
    		unusable = ~0x00010000~ // Stalker
    		weapprof = ~0 0 0 0 0 0 0 0 0 2 2 0 0 3 3 2 0 2 2 2 0 0 3 0 0 0 5 2 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
    ////////////////////////////L/S/B/S/B/S/A/M/B/L/S/A/T/K/S/D/W/C/S/H/F/M/Q/X/L/S/D/S/2/S/S/2/E/E/E/E/E/E/E/E/E/E/E/E/E/E
    ////////////////////////////A/H/O/P/L/P/X/I/A/O/H/X/W/A/C/A/A/L/P/A/L/A/U/B/O/H/A/L/H/W/I/W/X/X/X/X/X/X/X/X/X/X/X/X/X/X
    ////////////////////////////R/O/W/E/U/I/E/S/S/N/O/E/O/T/I/G/R/U/E/L/A/C/A/O/N/O/R/I/A/O/N/E/T/T/T/T/T/T/T/T/T/T/T/T/T/T
    ////////////////////////////G/R/*/A/U/K/*/S/T/G/R/*/H/A/M/G/H/B/A/B/I/E/R/W/G/R/T/N/N/R/G/P/R/R/R/R/R/R/R/R/R/R/R/R/R/R
    ////////////////////////////E/T/*/R/N/E/*/I/A/S/T/*/A/N/I/E/A/*/R/E/L/*/T/*/B/T/*/G/D/D/L/S/A/A/A/A/A/A/A/A/A/A/A/A/A/A
    ////////////////////////////S/S/*/*/T/D/*/L/R/W/S/*/N/A/T/R/M/*/*/R/M/*/E/*/O/B/*/*/E/S/E/T/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////W/W/*/*/*/*/*/E/D/O/W/*/D/*/A/*/M/*/*/D/O/*/R/*/W/O/*/*/D/H/W/Y/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////O/O/*/*/*/*/*/*/S/R/O/*/S/*/R/*/E/*/*/*/R/*/S/*/*/W/*/*/*/I/E/L/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////R/R/*/*/*/*/*/*/W/D/R/*/W/*/*/*/R/*/*/*/N/*/T/*/*/*/*/*/*/E/P/E/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////D/D/*/*/*/*/*/*/O/*/D/*/O/*/*/*/*/*/*/*/I/*/A/*/*/*/*/*/*/L/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    		clab_path = ~GelNinj/Tables/GeNiCla.2DA~
    		backstab = ~2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4~
    /////////////////////LVL////1/2/3/4/5/6/7/8/9/1/1/1/1/1/1/1/1/1/1/2/2/2/2/2/2/2/2/2/2/3/3/3/3/3/3/3/3/3/3/4////////////////
    /////////////////////LVL//////////////////////0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0////////////////
    		traplimt = 0
    		thiefskl = ~20 20~
    		thiefscl = ~0 0 0 100 100 0 0 0~ ///  PickPocket OpenLocks FindTraps MoveSilently HideInShadows DetectIllusion SetTraps Stealth
    		clasiskl = ~0 0 0 15 15 0 0~ /// PickPocket OpenLocks FindTraps MoveSilently HideInShadows DetectIllusion SetTraps
    		numwslot = ~4~ // Wepon slots
    		clswpbon = ~1 0 10~ // GetProfienceAPR UnarmoredDevisor Zero_Skill_Thaco
    		luabbr = ~GelNi~ // HLA table, Remember to copy
    		//hpclass = ~CustomNameHere~
    		clsrcreq = ~1 1 1 0 0 0 0~ // Which class required to pick to use
    ////////////////////////////H/E/H/D/H/G/H
    ////////////////////////////U/L/A/W/A/N/A
    ////////////////////////////M/F/L/A/F/O/L
    ////////////////////////////A/*/F/R/L/M/F
    ////////////////////////////N/*/E/F/I/E/O
    		clasthac = ~0~
    		sneakattt = ~1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6~ // My list was to lvl 50
    		crippstr = ~1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5~ // My list was to lvl 50
    /////////////LEVEL//////////0/1/2/3/4/5/6/7/8/9/1/1/1/1/1/1/1/1/1/1/2/2/2/2/2/2/2/2/2/2/3//3//3//3//3//3//3//3//3//3//4//4//4//4//4//4//4//4//4//5//
    /////////////LEVEL////////////////////////////0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0/1//2//3//4//5//6//7//8//9//0//1//2//3//4//5//6//7//8//9//0//
    				
    END
    
    BEGIN ~Install Script~
    COMPILE ~GelNinj/Scripts/GeNinj1.BAF~ ~Override~
    

    Dno why sneakattt has 3 x t. But i copied this kit from before i think
  • Gel87Gel87 Member Posts: 330
    edited February 22
    I see sneakatt has 1 to many t in my kit, need this for my own fault searching:
    https://github.com/Argent77/A7-add_kit_ex

    Traplimit seems to miss ~~

    Maby only 9 taco bonus is max?

    Maby to old weidu version?

    If i fail i use the good old add kit ee:
    https://forums.beamdog.com/discussion/34119/how-to-making-kit-mods-for-the-ee/p1

    In this example the kitname is before all the numbers in every point, maby i need here too.

    Different setup in example:
    kit_class = 4 // Parent class: Thief
    mixed = RESOLVE_STR_REF(~Adventurer~)
    lower = RESOLVE_STR_REF(~adventurer~) // Not strictly necessary: will be auto-generated if omitted
    help = RESOLVE_STR_REF(~ADVENTURER:

    The example also says
    Kit Name «Adventurer»
    Dont understand where he put kit internal name?

    Would love if someone would have a full example, cause this thing looks very good if one know how to formulate it possible.

    There are full examples in the add kit ee version which allows people like me to make kits :p this new improved version does not contain enought examples for me to write it correct.
    Post edited by Gel87 on
  • Gel87Gel87 Member Posts: 330
    Found fuller example now:


    INCLUDE ~%MOD_FOLDER%/lib/a7#add_kit_ex.tpa~

    ACTION_IF GAME_IS ~iwdee~ BEGIN
    <<<<<<<< .../example/inlined/CLABMFI1.2DA
    2DA V1.0
    ****
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    ABILITY1 GA_SPCL922 **** AP_SPCL124 **** **** AP_SPCL124 **** **** AP_SPCL124 **** **** AP_SPCL124 **** **** AP_SPCL124 **** **** AP_SPCL124 **** **** **** **** AP_SPCL124 **** **** **** **** AP_SPCL124 **** **** **** **** AP_SPCL124 **** **** **** **** **** **** **** ****
    ABILITY2 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** **** **** **** **** ****
    ABILITY3 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
    >>>>>>>>
    END ELSE BEGIN
    <<<<<<<< .../example/inlined/CLABMFI1.2DA
    2DA V1.0
    ****
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    ABILITY1 **** **** AP_SPCL122 **** **** AP_SPCL122 **** **** AP_SPCL122 **** **** AP_SPCL122 **** **** AP_SPCL122 **** **** AP_SPCL122 **** **** **** **** AP_SPCL122 **** **** **** **** AP_SPCL122 **** **** **** **** AP_SPCL122 **** **** **** **** **** **** **** ****
    ABILITY2 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** GA_SPCL121 **** **** **** **** **** **** **** ****
    ABILITY3 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
    >>>>>>>>
    END
    COPY ~.../example/inlined/CLABMFI1.2DA~ ~override~

    // Note: Parent class values are used for omitted parameters
    LAF ADD_KIT_EX
    INT_VAR
    kit_class = 2 // Fighter
    mixed = RESOLVE_STR_REF(~Marksman~)
    lower = RESOLVE_STR_REF(~marksman~)
    help = RESOLVE_STR_REF(~MARKSMAN: (Marksman kit description...)~)
    // EE-specific arguments
    briefdesc = RESOLVE_STR_REF(~MARKSMAN: (Marksman kit description...)~)
    STR_VAR
    kit_name = ~XX_MARKSMAN~
    unusable = ~0x00008000~
    // clasweap = ~1 1 1 1 1 1 1 1~
    weapprof = ~2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5 5 5 5 1 1 1 1~
    // abclasrq = ~9 0 0 0 0 0~
    // abclsmod = ~0 0 0 0 0 0~
    // abdcdsrq = ~17 0 0 0 0 0~
    // abdcscrq = ~15 0 0 0 0 0~
    // alignmnt = ~1 1 1 1 1 1 1 1 1~
    // dualclas = ~0 1 1 1 1 0~
    // luabbr = ~Fi0~
    stweap = ~LEAT14 * HELM07 BAG20 RING06 RING31 CLCK02 BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 BOW18 XBOW09 STAF08~
    clab_path = ~override/CLABMFI1.2DA~
    // kittable = ~K_F_H K_F_D K_F_G K_F_E K_F_HE K_F_HL K_F_HO~
    // EE-specific arguments
    // clsrcreq = ~1 1 1 1 1 1 1~
    // clswpbon = ~1 0 2~
    // hpclass = ~HPWAR~
    // numwslot = ~4~
    // clascolr = ~30 91 93 23 93~
    bdstweap = ~LEAT05 * HELM01 * RING06 * * * * BRAC09 BELT02 AROW02,40 BULL02,40 BOLT02,40 POTN08,5 POTN17,3 * BOW06 XBOW05 STAF02~
    RET
    kit_id
    END

    PRINT ~XX_MARKSMAN kit value = %kit_id%~

    In this example, is XX_MARKSMAN the internal kit name?
    What does this last PRINT function do?
  • Gel87Gel87 Member Posts: 330
    edited February 22
    // *** Test: add new multiclass kit (EE 2.0+ only) ***
    
    INCLUDE ~%MOD_FOLDER%/lib/a7#add_kit_ex.tpa~
    
    // CLAB tables for the new multiclass kit:
    // Entries of this table are added to the fighter class aspect of the kit.
    <<<<<<<< .../example/inlined/QDCLABSF.2DA
    2DA V1.0
    ****
                1           2           3           4           5           6           7           8           9           10          11          12          13          14          15          16          17          18          19          20          21          22          23          24          25          26          27          28          29          30          31          32          33          34          35          36          37          38          39          40
    ABILITY1    ****        ****        ****        AP_SPCL141  ****        ****        ****        AP_SPCL142  ****        ****        ****        AP_SPCL141  ****        ****        ****        AP_SPCL142  ****        ****        ****        AP_SPCL141  ****        ****        ****        AP_SPCL142  ****        ****        ****        AP_SPCL141  ****        ****        ****        AP_SPCL142  ****        ****        ****        AP_SPCL141  ****        ****        ****        AP_SPCL142
    >>>>>>>>
    COPY ~.../example/inlined/QDCLABSF.2DA~ ~override~
    
    // Entries of this table are added to the thief class aspect of the kit.
    <<<<<<<< .../example/inlined/QDCLABST.2DA
    2DA V1.0
    ****
                1           2           3           4           5           6           7           8           9           10          11          12          13          14          15          16          17          18          19          20          21          22          23          24          25          26          27          28          29          30          31          32          33          34          35          36          37          38          39          40
    ABILITY1    AP_SPCL421  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****        AP_SPCL332  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****        GA_SPCL423  ****        ****        ****
    ABILITY2    GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  AP_SPCL332  ****        ****        ****        GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  ****        ****        ****        ****        GA_SPCL412  ****        ****        ****        ****
    ABILITY3    GA_SPCL423  ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        GA_SPCL423  ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****        ****
    >>>>>>>>
    COPY ~.../example/inlined/QDCLABST.2DA~ ~override~
    
    // Note: Parent class values are used for omitted parameters
    LAF ADD_KIT_EX
      INT_VAR
        kit_class     = 9   // Fighter/Thief
        mixed         = RESOLVE_STR_REF(~Spy~)
        lower         = RESOLVE_STR_REF(~spy~)
        help          = RESOLVE_STR_REF(~SPY: (Spy kit description...)~)
        // EE-specific arguments
        briefdesc     = RESOLVE_STR_REF(~SPY: (Spy kit description...)~)
      STR_VAR
        kit_name      = ~XX_SPY~
        unusable      = ~0x00040000~
        // clasweap      = ~1 1 1 1 1 1 1 1~
        weapprof      = ~2 5 2 2 2 2 2 2 2 2 5 2 2 2 5 5 2 2 2 2 2 2 2 2 2 2 5 2 2 2 2 3~
        // abclasrq      = ~9 9 0 0 0 0~
        abclsmod      = ~-1 1 0 0 0 0~
        // alignmnt      = ~0 1 1 1 1 1 1 1 1~
        // dualclas      = ~0 0 0 0 0 0~
        // luabbr        = ~FT0~
        stweap        = ~LEAT14 * HELM07 BAG25 RING06 RING31 CLCK02 BOOT02 AMUL19 BRAC16 BELT06 AROW11,40 DART02,40 DART03,20 POTN52,5 POTN04,2 POTN14,5 DAGG12 SW1H28 STAF08~
        // clab_path     = ~QDCLABS.2DA~  // not needed for multiclass kits unless "base_class" parameter is specified as well
        clab_base_f   = ~QDCLABSF.2DA~  // abilities assigned to fighter class aspect
        clab_base_t   = ~QDCLABST.2DA~  // abilities assigned to thief class aspect
        // kittable      = ~K_FT_H K_FT_D K_FT_G K_FT_E K_FT_HE K_FT_HL K_FT_HO~
        // EE-specific arguments
        // clsrcreq      = ~0 1 1 1 1 1 1~
        // clswpbon      = ~1 0 2~
        // hpclass       = ~HPFT~
        // numwslot      = ~2~
        clascolr      = ~182 182 136 184 142~
        // thiefscl      = ~100 100 100 100 100 100 100 0~
        // backstab      = ~1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5~
        // sneakatt      = ~1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11~
        // crippstr      = ~0 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9~
        thiefskl      = ~40 20~
        // traplimt      = ~6~
        bdstweap      = ~LEAT05 * HELM01 * RING06 * * * * BRAC09 BELT02 AROW02,40 DART02,40 DART03,20 POTN08,5 POTN17,3 * DAGG02 SW1H08 STAF02~
      RET
        kit_id
    END
    
    PRINT ~XX_SPY kit value = %kit_id%~
    

    In this example:
    Does he add theese spells to an existing clab table in the start here?

    Also: does this allows me to make forexample:
    Cleric/Ranger with usuability flag for cavalier, or is the Cleric/Ranger usability flag always overwriting in a «hardcoded» way? :p
  • Gel87Gel87 Member Posts: 330
    Okay, really need help here.....

    First part with items and stuff works wonders.
    Second part, installing the kit dont work...
    BACKUP ~GelNinj/backup~
    AUTHOR ~Gel87~
    
    VERSION ~v1.0~
    
    BEGIN ~Install and Copy Ninja Stuff~   
    
    COPY "GelNinj/Tables" "Override"
    COPY "GelNinj/EFF" "Override"
    COPY "GelNinj/BAMS" "Override"
    
    // Copy items
    COPY ~GelNinj/Items/bdbrac05.itm~ ~Override~
    	SAY NAME1 ~Gauntlets~ // Unindentified name
    	SAY NAME2 ~Stalker Gauntlets~ // Identified name
    	SAY UNIDENTIFIED_DESC ~Gauntlets are armored gloves. They can be made of leather, metal plates, or chain mail. Every suit of armor is assumed to include gauntlets of an appropriate type. Magical gauntlets tend to be finer, lighter, and more easily worn than normal varieties.
    
    STATISTICS:
    
    Weight: 2~ 
    	SAY DESC ~These gauntlets assist in the stalking and killing of prey. Favored by hunters and rogues of all kinds, they display their full power when donned by a Stalker or Woodclan Ninja. Made of supple leather with brass-buckled straps along the side, these gauntlets are often decorated with embroidered figures of stags, foxes, or, as is the case with this pair, wolves.
    
    STATISTICS:
    
    Equipped abilities:
    – Dexterity: +1
    – Hide in Shadows: +15% (+30% for Stalkers and Woodclan Ninja)
    – Backstab Multiplier: +1 (Stalkers and Woodclan Ninja only)
    
    Weight: 2~
    
    // Copy items
    COPY ~GelNinj/Items/Gebrac05.itm~ ~Override~
    	SAY NAME1 ~Gauntlets~ // Unindentified name
    	SAY NAME2 ~Ankegg Plated Stalker Gauntlets~ // Identified name
    	SAY UNIDENTIFIED_DESC ~Gauntlets are armored gloves. They can be made of leather, metal plates, or chain mail. Every suit of armor is assumed to include gauntlets of an appropriate type. Magical gauntlets tend to be finer, lighter, and more easily worn than normal varieties.
    
    STATISTICS:
    
    Weight: 2~ 
    	SAY DESC ~These gauntlets assist in the stalking and killing of prey. Favored by hunters and rogues of all kinds, they display their full power when donned by a Stalker or Woodclan Ninja. Made of ankegg coated leather with brass-buckled straps along the side, these gauntlets are often decorated with embroidered figures of stags, foxes, or, as is the case with this pair, wolves.
    
    STATISTICS:
    
    Equipped abilities:
    – Dexterity: +1
    – Hide in Shadows: +15% (+30% for Stalkers and Woodclan Ninja)
    – Backstab Multiplier: +1 (Stalkers and Woodclan Ninja only)
    – Attackspeed: +1/2 attack per round 
    – Strenght: +1
    – Thaco Bonus: +1
    
    Weight: 2~
    
    // Copy items
    ADD_PROJECTILE ~GelNinj/PRO/GelShur.PRO~
    COPY ~GelNinj/Items/GelShu1.itm~ ~Override~
    	SAY NAME1 ~Ninja Star~ // Unindentified name
    	SAY NAME2 ~Ninja Star~ // Identified name
    	SAY UNIDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	SAY IDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	WRITE_SHORT 0x098 ~%GelShur%~
    
    // Copy spells
    COPY ~GelNinj/spells/GelShur.spl~ ~Override~
    	SAY NAME1 ~Create Ninja Stars~ // Unindentified name
    	SAY NAME2 ~Create Ninja Stars~ // Identified name
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi10.spl~ ~Override~
    	SAY NAME1 ~Backstab Every Hit~ // Unindentified name
    	SAY NAME2 ~Backstab Every Hit~ // Identified name
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi11.spl~ ~Override~
    	SAY NAME1 ~Remove: Backstab Every Hit~ // Unindentified name
    	SAY NAME2 ~Remove: Backstab Every Hit~ // Identified name
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi12.spl~ ~Override~
    	SAY NAME1 ~Ninja Charge~ // Unindentified name
    	SAY NAME2 ~Ninja Charge~ // Identified name
    	SAY DESC ~NINJA CHARGE: 
    The Woodclan Ninja turns invisible and rapidly charge into a selected enemy and attack him one round with backstab. The attack has a +4 bonus to Thaco.~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi13.spl~ ~Override~
    	SAY NAME1 ~Nature's Beauty~ // Unindentified name
    	SAY NAME2 ~Nature's Beauty~ // Identified name
    	SAY DESC ~Nature's Beauty
    (Illusion/Phantasm)
    
    Level: 7
    Sphere: Elemental
    Range: 0
    Duration: Instant
    Casting Time: 3
    Area of Effect: 15-ft. radius
    Saving Throw: Neg.
    
    When this spell is cast, the caster appears to undergo a remarkable transformation. The caster becomes the very ideal of beauty: For a male, this is usually a nymph; for a female, it varies. As with a nymph, anyone viewing the disguised caster must make a Saving Throw vs. Spell with +3 bonus(1 for level 20, -1 for level 22) or die of longing for the denied illusion. Even if the Saving Throw is successful, hapless viewers of the transformed Druid are all instantly smitten with permanent blindness (until dispelled). The transformation is instantaneous, but lasts only seconds, affecting those near the caster (excluding fellow party members).~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi14.spl~ ~Override~
    	SAY NAME1 ~Insect Plague~ // Unindentified name
    	SAY NAME2 ~Insect Plague~ // Identified name
    	SAY DESC ~Insect Plague Innate albility~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi15.spl~ ~Override~
    	SAY NAME1 ~Creeping Doom~ // Unindentified name
    	SAY NAME2 ~Creeping Doom~ // Identified name
    	SAY DESC ~Creeping doom innate albility~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi16.spl~ ~Override~
    	SAY NAME1 ~Invisibility~ // Unindentified name
    	SAY NAME2 ~Invisibility~ // Identified name
    	SAY DESC ~~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi17.spl~ ~Override~
    	SAY NAME1 ~Quivering Wepon~ // Unindentified name
    	SAY NAME2 ~Quivering Wepon~ // Identified name
    	SAY DESC ~Quivering Wepon
    The next successful attack forces the target to Save vs. Spell or die. This special ability automatically modifies normal attacks; no targeting needs to be done.~
    
    // Copy spells
    COPY ~GelNinj/spells/GelNi19.spl~ ~Override~
    	SAY NAME1 ~Energy Shurikens~ // Unindentified name
    	SAY NAME2 ~Energy Shurikens~ // Identified name
    	SAY DESC ~Energy Shurikens
    (Any School)
    
    Level: Quest
    Range: Special
    Duration: 4 turns
    Casting Time: 3
    Area of Effect: Special
    Saving Throw: None
    
    An energy shurikens is a ninja star crafted of pure energy. The shuriken gives +10 to THAC0, and when thrown does 1d4+5 slashing damage as well as 1d10 additional electrical damage. This spell creates 1 energy shuriken per level of the caster and sets the caster's attacks to 9 as long as the discs are held.~
    
    BEGIN ~Add kit GelNinj~
    
    INCLUDE "GelNinj/Argen77 add kit/a7-add_kit_ex/a7#add_kit_ex.tpa"
    
    LAF ADD_KIT_EX
    	INT_VAR
    		kit class = 12
    		mixed = RESOLVE_STR_REF(~Woodclan Ninja~)
    		lower = RESOLVE_STR_REF(~woodclan ninja~)
    		help = RESOLVE_STR_REF(~Woodclan Ninja: A stalker kit utilizing light Ninja Swords and Ninja Stars. As well as a few selective innate nature spells.
    
    Advantages:
    - May put 5 profience points into Darts (Ninja Stars = Darts Profience)
    - Gets Charm Animal spell as usual.
    - May use Stalker Gloves at full effectivness as well as gloves and a upgradedable version is availeble in BG2EE.
    - May use innate versions of Insect Plague(Level 11), Creeping Doom(Level 17) and Nature's Peace(Level 17)
    - Gets Shadowstep at level 2, 5, 8.
    - Gets invisibility at level 9 and 12.
    - Gets Ninja Charge Albility in level 1 and 7.
    - Starts with 2 profience points to Dual Wielding and may put a 3rd point.
    - Can put 3 points into Katana, Scimitar/Wakasaki and Quarterstaff.
    - Else same bonuses as stalker.
    
    Ninja Charge:
    The Woodclan Ninja turns invisible and rapidly charge into a selected enemy and attack him one round with backstab. The attack has a +4 bonus to Thaco.
    
    Dissadvantages:
    - 10 Thaco Penalty on none profient wepons. 
    - May not put profience point Bastardsword, 2 handed sword, Warhammer, Flail/Monrningstar, Crossbow, Longbow, Shortbow.
    - May not use ranged wepons other than darts and sling~)
    		briefdesc     = RESOLVE_STR_REF(~Woodclan Ninja: A stalker kit utilizing light Ninja Swords and Ninja Stars. As well as a few selective innate nature spells.
    
    Advantages:
    - May put 5 profience points into Darts (Ninja Stars = Darts Profience)
    - Gets Charm Animal spell as usual.
    - May use Stalker Gloves at full effectivness as well as gloves and a upgradedable version is availeble in BG2EE.
    - May use innate versions of Insect Plague(Level 11), Creeping Doom(Level 17) and Nature's Peace(Level 17)
    - Gets Shadowstep at level 2, 5, 8.
    - Gets invisibility at level 9 and 12.
    - Gets Ninja Charge Albility in level 1 and 7.
    - Starts with 2 profience points to Dual Wielding and may put a 3rd point.
    - Can put 3 points into Katana, Scimitar/Wakasaki and Quarterstaff.
    - Else same bonuses as stalker.
    
    Ninja Charge:
    The Woodclan Ninja turns invisible and rapidly charge into a selected enemy and attack him one round with backstab. The attack has a +4 bonus to Thaco.
    
    Dissadvantages:
    - 10 Thaco Penalty on none profient wepons. 
    - May not put profience point Bastardsword, 2 handed sword, Warhammer, Flail/Monrningstar, Crossbow, Longbow, Shortbow.
    - May not use ranged wepons other than darts and sling~)
    		biography = ~Somehow you felt the Urge to explore the world outside the forests~
    	STR_VAR
    		kit_name = ~GelNinj~ // Woodclan Ninja 
    		unusable = ~0x00010000~ // Stalker
    		weapprof = ~0 0 0 0 0 0 0 0 0 2 2 0 0 3 3 2 0 2 2 2 0 0 3 0 0 0 5 2 2 2 2 3~
    ////////////////////////////L/S/B/S/B/S/A/M/B/L/S/A/T/K/S/D/W/C/S/H/F/M/Q/X/L/S/D/S/2/S/S/2/E/E/E/E/E/E/E/E/E/E/E/E/E/E
    ////////////////////////////A/H/O/P/L/P/X/I/A/O/H/X/W/A/C/A/A/L/P/A/L/A/U/B/O/H/A/L/H/W/I/W/X/X/X/X/X/X/X/X/X/X/X/X/X/X
    ////////////////////////////R/O/W/E/U/I/E/S/S/N/O/E/O/T/I/G/R/U/E/L/A/C/A/O/N/O/R/I/A/O/N/E/T/T/T/T/T/T/T/T/T/T/T/T/T/T
    ////////////////////////////G/R/*/A/U/K/*/S/T/G/R/*/H/A/M/G/H/B/A/B/I/E/R/W/G/R/T/N/N/R/G/P/R/R/R/R/R/R/R/R/R/R/R/R/R/R
    ////////////////////////////E/T/*/R/N/E/*/I/A/S/T/*/A/N/I/E/A/*/R/E/L/*/T/*/B/T/*/G/D/D/L/S/A/A/A/A/A/A/A/A/A/A/A/A/A/A
    ////////////////////////////S/S/*/*/T/D/*/L/R/W/S/*/N/A/T/R/M/*/*/R/M/*/E/*/O/B/*/*/E/S/E/T/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////W/W/*/*/*/*/*/E/D/O/W/*/D/*/A/*/M/*/*/D/O/*/R/*/W/O/*/*/D/H/W/Y/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////O/O/*/*/*/*/*/*/S/R/O/*/S/*/R/*/E/*/*/*/R/*/S/*/*/W/*/*/*/I/E/L/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////R/R/*/*/*/*/*/*/W/D/R/*/W/*/*/*/R/*/*/*/N/*/T/*/*/*/*/*/*/E/P/E/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    ////////////////////////////D/D/*/*/*/*/*/*/O/*/D/*/O/*/*/*/*/*/*/*/I/*/A/*/*/*/*/*/*/L/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
    		abclsmod = ~0 0 0 0 0 0~
    		clab_path = ~GelNinj/Tables/GeNiCla.2DA~
    		backstab = ~2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4~
    /////////////////////LVL////1/2/3/4/5/6/7/8/9/1/1/1/1/1/1/1/1/1/1/2/2/2/2/2/2/2/2/2/2/3/3/3/3/3/3/3/3/3/3/4////////////////
    /////////////////////LVL//////////////////////0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0////////////////
    		traplimt = 0
    		thiefskl = ~20 20~
    		thiefscl = ~0 0 0 100 100 0 0 0~ ///  PickPocket OpenLocks FindTraps MoveSilently HideInShadows DetectIllusion SetTraps Stealth
    		clasiskl = ~0 0 0 15 15 0 0~ /// PickPocket OpenLocks FindTraps MoveSilently HideInShadows DetectIllusion SetTraps
    		numwslot = ~4~ // Wepon slots
    		clswpbon = ~1 0 9~ // GetProfienceAPR UnarmoredDevisor Zero_Skill_Thaco
    		luabbr = ~GelNi~ // HLA table, Remember to copy
    		//hpclass = ~CustomNameHere~
    		clsrcreq = ~1 1 1 0 0 0 0~ // Which class required to pick to use
    ////////////////////////////H/E/H/D/H/G/H
    ////////////////////////////U/L/A/W/A/N/A
    ////////////////////////////M/F/L/A/F/O/L
    ////////////////////////////A/*/F/R/L/M/F
    ////////////////////////////N/*/E/F/I/E/O
    		clasthac = ~0~
    		sneakatt = ~1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6~ // My list was to lvl 50
    		crippstr = ~1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5~ // My list was to lvl 50
    /////////////LEVEL//////////0/1/2/3/4/5/6/7/8/9/1/1/1/1/1/1/1/1/1/1/2/2/2/2/2/2/2/2/2/2/3//3//3//3//3//3//3//3//3//3//4//4//4//4//4//4//4//4//4//5//
    /////////////LEVEL////////////////////////////0/1/2/3/4/5/6/7/8/9/0/1/2/3/4/5/6/7/8/9/0/1//2//3//4//5//6//7//8//9//0//1//2//3//4//5//6//7//8//9//0//
      RET
        kit_id				
    END
    
    PRINT ~GelNinj kit value = %kit_id%~
    
    BEGIN ~Install Script~
    COMPILE ~GelNinj/Scripts/GeNinj1.BAF~ ~Override~
    

    DEBUG FILE for second part, kit:
    Install Component [Add kit GelNinj]?
    [I]nstall, or [N]ot Install or [Q]uit? 
    Installing [Add kit GelNinj] [v1.0]
    ERROR: cannot convert kit or %kit% to an integer
    Stopping installation because of error.
    
    ERROR Installing [Add kit GelNinj], rolling back to previous state
    Unable to Unlink [GelNinj/backup/1/OTHER.1]: Unix.Unix_error(1, "unlink", "GelNinj/backup/1/OTHER.1")
    [GelNinj/backup/1/UNSETSTR.1] SET_STRING uninstall info not found
    Will uninstall   0 files for [GELNINJ/GELNINJ.TP2] component 1.
    Uninstalled      0 files for [GELNINJ/GELNINJ.TP2] component 1.
    Unable to Unlink [GelNinj/backup/1/READLN.1]: Unix.Unix_error(20, "unlink", "GelNinj/backup/1/READLN.1")
    Unable to Unlink [GelNinj/backup/1/READLN.1.TEXT]: Unix.Unix_error(20, "unlink", "GelNinj/backup/1/READLN.1.TEXT")
    MONKMOD/MONKMOD.TP2  0  0 Installed
    CDTWEAKS/SETUP-CDTWEAKS.TP2  0 2090 Installed
    CDTWEAKS/SETUP-CDTWEAKS.TP2  0 3310 Installed
    GEVAKIT/GEVAKIT.TP2  0  0 Installed
    GELNINJ/GELNINJ.TP2  0  0 Permanently_Uninstalled
    GELNINJ/GELNINJ.TP2  0  0 Installed ~Install and Copy Ninja Stuff~
    ERROR: Not_found
    Please make a backup of the file: SETUP-GELNINJ.DEBUG and look for support at: Gel87
    
  • Gel87Gel87 Member Posts: 330
    edited February 22
    Okay, thanks to chatgpt kit now install. All except my script which had a bad targeting command, but got help with ideas for that for tomorrow :D

    I will put them here to think about a way to combine theese for a correct targeting system :p
    IF
        Kit(Myself, GelNinj)
        Global("NinjaCharge","LOCALS",1)
    THEN
        RESPONSE #100
            MoveToObject(HitBy(Myself,PIERCING))
            ApplySpellRES("GelNi10",Myself) //Assassination//
            SetGlobal("NinjaCharge","LOCALS",2)
    END
    
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        StateCheck(Myself,STATE_INVISIBLE)
        See(NearestEnemyOf(Myself))
    THEN
        RESPONSE #100
            AttackOneRound(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi11",Myself)  //Remove Assassination//
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        !StateCheck(Myself,STATE_INVISIBLE)
    THEN
        RESPONSE #100
            ApplySpellRES("GelNi11",Myself) //Remove Assassination//
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    
    /////
    // Ninja Charge Script (GeNinj1.BAF)
    
    IF
        Global("NinjaCharge", "LOCALS", 1)  // Check if the ninja charge was triggered
        Local("TargetMonster", "LOCALS")  // Check if there's a target set
        DistanceToObject(Myself, Local("TargetMonster", "LOCALS")) > 0 // Ensure you're not already on the target
    THEN
        RESPONSE #100
            // Move to the target monster
            MoveToObject(Local("TargetMonster", "LOCALS"))
    
            // Apply backstab effect (GelNi10.spl) to the target
            ApplySpellRES("GelNi10", Local("TargetMonster", "LOCALS"))  // Backstab spell
    
            // Perform one round of attack
            AttackOneRound(Local("TargetMonster", "LOCALS"))
    
            // Remove invisibility automatically by the game rules (turn off invisibility)
            // This is handled automatically by the game when the backstab happens
    
            // Set NinjaCharge back to 0, so the ninja charge is no longer active
            SetGlobal("NinjaCharge", "LOCALS", 0)
    END
    
    IF
        Global("NinjaCharge", "LOCALS", 1)  // Ensure ninja charge is still active
        StateCheck(Myself, STATE_INVISIBLE) // Check if the character is still invisible
        Local("TargetMonster", "LOCALS")  // Make sure the target exists
        !DistanceToObject(Myself, Local("TargetMonster", "LOCALS")) > 0 // Check that you're close enough
    THEN
        RESPONSE #100
            // Apply backstab effect (GelNi10.spl) one more time if needed
            ApplySpellRES("GelNi10", Local("TargetMonster", "LOCALS"))
    
            // Stop backstab damage if visible (turn off invisibility)
            SetGlobal("NinjaCharge", "LOCALS", 0) // End the ninja charge
    END
    
  • Gel87Gel87 Member Posts: 330
    For test:
    IF
        Kit(Myself, GelNinj)
        Global("NinjaCharge","LOCALS",1)
        Global("GelTargetMonster", "LOCALS",1)
    THEN
        RESPONSE #100
            MoveToObject(Global("GelTargetMonster", "LOCALS", 1))
            ApplySpellRES("GelNi10",Myself) //Always Backstab
            SetGlobal("NinjaCharge","LOCALS",2)
    END
    
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        StateCheck(Myself,STATE_INVISIBLE)
        See(NearestEnemyOf(Myself))
    THEN
        RESPONSE #100
            AttackOneRound(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi11",Myself)  //Remove Always Backstab
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    
    IF
        Class(Myself,RANGER)
        Global("NinjaCharge","LOCALS",2)
        !StateCheck(Myself,STATE_INVISIBLE)
    THEN
        RESPONSE #100
            ApplySpellRES("GelNi11",Myself) //Remove Always Backstab
            AttackOneRound(NearestEnemyOf(Myself))
            SetGlobal("NinjaCharge","LOCALS",0)
    END
    

    For test:
    IF
        Kit(Myself, GelNinj)
        Global("NinjaCharge", "LOCALS", 1)
        Global("GelTargetMonster", "LOCALS", 1) // GelTargetMonster should hold the target object ID
    THEN
        RESPONSE #100
            // Ensure GelTargetMonster contains the correct object ID of the target
            MoveToObject(Global("GelTargetMonster", "LOCALS")) // Move to the target object
            ApplySpellRES("GelNi10", Myself) // Apply Always Backstab effect
            SetGlobal("NinjaCharge", "LOCALS", 2) // Change NinjaCharge state to 2 (attack phase)
    END
    
    IF
        Global("NinjaCharge", "LOCALS", 2)
        StateCheck(Myself, STATE_INVISIBLE) // Check if we're still invisible
        See(Global("GelTargetMonster", "LOCALS")) // Ensure we can still see the target
    THEN
        RESPONSE #100
            AttackOneRound(Global("GelTargetMonster", "LOCALS")) // Attack the specific target
            ApplySpellRES("GelNi11", Myself) // Remove Always Backstab effect
            SetGlobal("NinjaCharge", "LOCALS", 0) // Reset NinjaCharge state
    END
    
    IF
        Global("NinjaCharge", "LOCALS", 2)
        !StateCheck(Myself, STATE_INVISIBLE) // If not invisible, break invisibility
    THEN
        RESPONSE #100
            ApplySpellRES("GelNi11", Myself) // Remove Always Backstab effect
            AttackOneRound(NearestEnemyOf(Myself)) // Attack the nearest enemy instead
            SetGlobal("NinjaCharge", "LOCALS", 0) // Reset NinjaCharge state
    END
    
  • Gel87Gel87 Member Posts: 330
    edited February 23
    Well now the issue is that script refuse to compile, and nomatter how I much i specify the path it instead tries to install 3 other scripts from another mod...

    I even tried to move that entire other mod into another place on my pc. It dont help.
    I tried to move entire bg1ee from steamapps common, into C: Games, make sure write protection is off on the folder and all underlaying folders. Still this script refuse to try to install, and instead it complains about those 3 other scriptd which are not even present anymore.

    It also seems to refuse to write new names on spells, items, kit etc. Kit is findable in creation of character, the issue is thats its name is like half a page long, but squezed into that small kit chosing box. All spells and items refuse to take the new names.
    My ninja stars with new projectile and custom selfmade bams actually works.
    My ninja charge albility dont work, because there is no script to find, but now i remember i have forgotten to chose the global value though as well.

    Even thought my TP2 file command looks like this:
    BEGIN ~Install Script~
    COMPILE ~GelNinj/Scripts/GeNinj1.BAF~ ~Override~

    The weidu debug says:
    Compiling 4 scripts:
    Failed to install GelVa02.baf
    Failed to install GelVa20.baf
    Failed to install GelVa30.baf

    It does not even mentioning GeNinj1.baf....

    Is there a huge issue with steam version bg1ee?
    Back home i have full version of game.
    Is it worth to try in BG2EE instead? I heard something about patching of SOD files may cause a issue on steam and gog versions?

    My weidu versionb was 239.0.0.0.0 or smt

    Do i need to use some:
    DLC Merger

    Never tried such stuff before i think :P
  • Gel87Gel87 Member Posts: 330
    I lol'd...
    Kit works epic in BG2EE xD

    Steam version bgee...
    Time to get DLC Merger.

    Added all form of Ninja Stars.
    Added Stalker Gloves to Valgyar
    Now i just need to find out how to get Gromwell to have an option to upgrade those stalker gloves.

    Ninja Charge works now.
    Clab table assign the kit with OP code Set Script(82)

    Ninja Charge spell:
    - Blur 1 second (simulates acceleration)
    - Movement speed increase by 15 (4 seconds)
    - Invisibility 40 seconds(will be broken by game rules when attacking)
    - Taco bonus of 4 for 6 seconds
    - sets global value 1.

    Then this script:
    IF
        Class(Myself,RANGER)
        Kit(Myself,GelNinj)
        Global("GeNinj1","GLOBAL",1)
    THEN
        RESPONSE #100
            MoveToObject(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi10",Myself)  // Backstab Every Hit
            SetGlobal("GeNinj1","GLOBAL",2)
    END
    
    IF
        Global("GeNinj1","GLOBAL",2)
        StateCheck(Myself,STATE_INVISIBLE)
        See(NearestEnemyOf(Myself))
    THEN
        RESPONSE #100
            EquipMostDamagingMelee()
            AttackOneRound(NearestEnemyOf(Myself))
            ApplySpellRES("GelNi11",Myself)  // Remove: Backstab Every Hit
            SetGlobal("GeNinj1","GLOBAL",0)
    END
    
    IF
        Global("GeNinj1","GLOBAL",2)
        !StateCheck(Myself,STATE_INVISIBLE)
        See(NearestEnemyOf(Myself))
    THEN
        RESPONSE #100
            ApplySpellRES("GelNi11",Myself)  // Remove: Backstab Every Hit
            EquipMostDamagingMelee()
            AttackOneRound(NearestEnemyOf(Myself))
            SetGlobal("GeNinj1","GLOBAL",0)
    END
    
    IF
        OR(2)
        Global("GeNinj1","GLOBAL",1)
        Global("GeNinj1","GLOBAL",2)
        !See(NearestEnemyOf(Myself))
    THEN
        RESPONSE #100
            SetGlobal("GeNinj1","GLOBAL",0)
    END
    

    The issue is that I may land more than 1 backstab during 1 round attack.. But dno how to do it better xD
    First version i had my char was so stuck running script 24/7 i could not even use a scroll or book xD
    Please let me know if I need to use any ActionOverride() as i kinda dont understand that thing xD
  • Gel87Gel87 Member Posts: 330
    edited February 26
    I may need something like this for cromwell changes:
    OUTER_SET old_string = RESOLVE_STR_REF(@1)
    
    COPY_EXISTING ~gerde.dlg~ ~override~
      DECOMPILE_AND_PATCH BEGIN
        REPLACE_TEXTUALLY ~SAY #%old_string%~ ~SAY @2~
      END
    

    I may need below to let blind say blinded, instead of a long dialog when using different games:
    COPY_EXISTING ~spwi101.spl~ ~override/newfilename.spl~
      PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
        LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = 139 target = 1 timing = 1 parameter1 = RESOLVE_STR_REF (~Greased Lightning~) resist_dispel = 3 END
      END
      BUT_ONLY
    

    Or:
    COPY ~yourmodsfoldername/whateveryourspellfilesnameis.spl~ ~override/weysfni.spl~
    ... rest of the previous code
  • Gel87Gel87 Member Posts: 330
    edited February 26
    So to fix blind message on smoke bomb spell:
    // Copy Spell
    ADD_PROJECTILE ~GelNinj/PRO/GelSmok.PRO~
    COPY ~GelNinj/Spells/GelNi22.spl~ ~Override~
    	SAY NAME1 ~Black Powder Smoke Bomb~ // Unindentified name
    	SAY NAME2 ~Black Powder Smoke Bomb~ // Identified name
            SAY DESC ~~
    	WRITE_SHORT 0x098 ~%GelSmok%~
      PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
        LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = 139 target = 1 timing = 1 parameter1 = RESOLVE_STR_REF (~Blinded~) resist_dispel = 3 END
      END
      BUT_ONLY /// Do i need this when i copy my own stuff?
    

    To add item upgrade to cromwell:
    COPY_EXISTING ~Cromwell.dlg~ ~override~ //Need to check what real dlg name is.
      DECOMPILE_AND_PATCH BEGIN
        EXTEND_BOTTOM
           IF ~PartyHasItem("bdbrac05")~ BEGIN 10
      SAY @15 /* Outstanding! I see you have found urself some Stalker gloves, if you find a ankegg shell. I can combine them for a more powerfull item. But it will cost you 10000 gold. */ GOTO 11
      ~
         IF  ~PartyHasItem("Ankegg")~ BEGIN 11
      SAY /* ~Ah, I see you have urself an ankegg shell here as well, do you want me to combine them at the cost of 10000gold?~ */
    ++ ~Yes, please~   THEN DO ~SetGlobal("GelStalk","GLOBAL",1)
    TakePartyItem("bdbrac05")
    TakePartyItem("ankegg")
    DestroyItem("bdbrac05")
    DestroyItem("ankegg")
    GiveItemCreate("Gebrac05",LastTalkedToBy(),0,0,0)
    ~ EXIT
    ++ ~No, not at the moment~ 
    ~ EXIT
    END
    

    Ovbious i need to learn some more, xD
    Post edited by Gel87 on
  • Gel87Gel87 Member Posts: 330
    edited February 27
    Okay, so i used code from item upgrade mod to install stalker glove upgrade. And i added "blinded" string to Smokebomb spell.
    Code installed fine after some attemtps and fixes and i can test another evening :D

    Okay, tested the spell string. My epic charname of xmdgsgds got the text blinded^^
    Minsc still got the "Insert Random dialog string here" text.
    So fix will be to change parameter in code to affect preset target instead of self, and remove the old string from spell itself :D
    Changed into Target = 2

    Will spend some time getting to cromwell to test that part xD

    Also, Ninja star still gets wrong projectile... Have to manual change it... Im on version 4 of selfmade ninja stars now. Starting to look good xD

    ANY1 KNOW WHY MY NINJA STAR HAS GELSMOK.PRO instead of GELSTAR.PRO? Im starting BG2EE so i have the +2 wepon.
    Do i need to write: ADD_PROJECTILE ~GelNinj/PRO/GelSmok.PRO~ every time?
    EDIT: Also notice now i have copied old code here, the new projectile i have in code is %GelStar% ofc, %GelShur% is version 1 of ninjastar.
    // Copy Spell
    ADD_PROJECTILE ~GelNinj/PRO/GelSmok.PRO~
    COPY ~GelNinj/Spells/GelNi22.spl~ ~Override~
    	SAY NAME1 ~Black Powder Smoke Bomb~ // Unindentified name
    	SAY NAME2 ~Black Powder Smoke Bomb~ // Identified name
            SAY DESC ~~
    	WRITE_SHORT 0x098 ~%GelSmok%~
    
    // Copy items
    ADD_PROJECTILE ~GelNinj/PRO/GelShur.PRO~
    COPY ~GelNinj/Items/GelShu1.itm~ ~Override~
    	SAY NAME1 ~Ninja Star~ // Unindentified name
    	SAY NAME2 ~Ninja Star~ // Identified name
    	SAY UNIDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	SAY IDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	WRITE_SHORT 0x098 ~%GelShur%~
    
    Post edited by Gel87 on
  • Gel87Gel87 Member Posts: 330
    edited February 27
    Maby if i use this for smokebomb, and other version for item there wont be a mix where weidu assign GelSmok to all items/spells:
    ADD_PROJECTILE      ~path/proname.PRO~
    COPY ~path/spell.spl~ ~override~
     LPF ALTER_SPELL_HEADER INT_VAR projectile = %proname% END
    

    I find many ways of adding projectiles now...

    This way should work:
    ADD_PROJECTILE      ~AlchemistKitBGEE/pro/USALPG1.PRO~
    COPY ~AlchemistKitBGEE/spl/(AL)064B.SPL~ ~override~ 
     LPF ALTER_SPELL_HEADER INT_VAR projectile = %USALPG1% END
    

    This method works for someone else:
    ADD_PROJECTILE ~modname/spells/projname.PRO~
    COPY ~modname/spells/spellname.spl~ ~override~
    READ_LONG 0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    SET "delta" = 0
    FOR (index = 0; index < abil_num; index = index + 1) BEGIN
    WRITE_SHORT (%abil_off% + (0x28 * %index%) + 0x26) ~%projname%~
    END
    

    Ref this:
    https://forums.beamdog.com/discussion/63148/creating-new-dialogs-and-also-bams-and-projectiles
  • Gel87Gel87 Member Posts: 330
    Omg, im getting blocked from sending kit in mail to myself...
    Have to uplead it here then i guess.

  • Gel87Gel87 Member Posts: 330
    Updated. (for home usage, as mail got blocked xD)
Sign In or Register to comment.