Smoke Claws



  • Basic idea of this script is it should OnHit cause a Touch Attack against the player, on failing that attack they take damage every round until a saving throw. I'm not sure what I'm missing here because its not working. Anyone?

    //::///////////////////////////////////////////////
    //:: Smoke Claws
    //:: NW_S1_SmokeClaw
    //:: Copyright (c) 2001 Bioware Corp.
    //:://////////////////////////////////////////////
    /*
    If a Smoke elemental succeeds at a touch attack the
    target breaths in part of the elemental and suffers
    Hit Die d4 damage per round until a Fortitude save is
    made.
    */
    //:://////////////////////////////////////////////
    //:: Created By: Preston Watamaniuk
    //:: Created On: May 23 , 2001
    //:: Modified By: Moloch
    //:: Modified On: Dec. 28, 2017
    //:://////////////////////////////////////////////
    #include "NW_I0_SPELLS"
    #include "x2_inc_switches"
    void main ()
    {
    //Declare major variables
    object oTarget = GetSpellTargetObject();
    int bSave = FALSE;
    effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
    effect eSmoke = EffectVisualEffect(VFX_DUR_GHOST_SMOKE_2);
    float fDelay = 0.0;
    object oOwner = GetItemPossessor(OBJECT_SELF);
    int iDC = GetAbilityModifier(ABILITY_CHARISMA ,oOwner);
    int iDamage = GetHitDice(oOwner)/4;
    if (GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ONHITCAST)
    {
    //Make a touch attack
    if(TouchAttackMelee(oTarget))
    {
    if(!GetIsReactionTypeFriendly(oTarget))
    {
    //Make a saving throw check
    while (bSave == FALSE)
    {
    //Make a saving throw check
    if(!/FortSave/MySavingThrow(SAVING_THROW_FORT, oTarget, 14 + iDC, SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
    {
    bSave = TRUE;
    }
    else
    {
    //Set damage
    eSmoke = EffectDamage(d4(iDamage));
    //Apply the VFX impact and effects
    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSmoke, oTarget));
    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
    SpeakString("coughs wretchedly, their lungs filled with smoke", TALKVOLUME_TALK);
    //Increment the delay
    fDelay = fDelay + 6.0;
    }
    }
    }
    }
    }
    }



  • well, it's tag based scripting right? using the on hit special power?

    if so, your missing all the tag based scripting stuff and the script needs to be named

    itm_tagofclawitem


  • Admin [DM]

    Isn't this what the bleeding script does?



  • Script is named correctly.

    What tag based item stuff am I missing? I copied this right from the bone arrow scripts and they worked....



  • @mr-moloch

    Actually, I just read it wrong, possibly because it's all just forum instead of code looking stuff! I can never get code snippets to work properly nowdays.

    Anyway, the only thing I can see being an issue, is, if you have a delay command from an object, that will no longer continue to work if that object stops existing. So, say the player get's smoked, then, the enemy dies, they wont get smoked anymore after it's dead, because the calw item the script is running on, will be gone!

    Other than that... just start chucking debug messages into it until you find where it's broke, sorry man, on some weird mac not at home so don't have any real tools to look at anything.



  • No worries, we have players who can script. Someone else will catch the issue here.


  • Admin [DM]

    1. You declared eSmoke to give you smoke vfx at the begining of the script. You then overwritten it with Damage effect so the smoke vfx will never appear.

    2. eVis should be set to Duration type temporary instead of instant.

    3. You forgot to encase the SpeakString action with AssignCommand and assign it to the target.



  • 1). Oops, that was from the original code for Belkar where it overwrites; I didn't even notice thanks!
    2). Yup, thanks again.
    3). And yes....dammit...I just presumed the original Bioware script was working and my trying to apply it as an item was the problem, Bioware's original idea for this was a cast spell.

    Main issue is though, it does not seem to fire at all. Players are not ever taking the damage; going to add in some debug lines and see where things are missed.


  • Admin [DM]

    There are 4 places that might have an issue and might result in the script not working. I would start debugging there.

    1. oTarget's decrlaration - Might be good to get the debug meesage return oTarget's name as its possible you might need to use a different function than SpellTarget.

    2. The Touch Attack condition

    3. The Reputation condition.

    4. The save condition - Usually MySavingThrow function causes such issues so its very likely it is being ignored.

    If you add the inc_debug_system include file to your script you can use the SendBasicDebuggingMessage () function to debug this without spamming the DM channel (You could also toggle it to write to the logfile and get the info even if you arent online).

    You can then just activate the debugging system with .dbgmode



  • Lords....I forgot to put the OnHitCastSpell property on the item. ffs.



  • @mr-moloch said in Smoke Claws:

    Lords....I forgot to put the OnHitCastSpell property on the item. ffs.

    LOL

    classic.


Log in to reply