Skip to content

Need help with a simple backstab script.

Gel87Gel87 Member Posts: 246
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: 3,925
    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: 246
    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: 246
    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: 246
    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
    
Sign In or Register to comment.