You are here

how to change defensive stance? SOLVED

9 posts / 0 new
Last post
Cursed Eclipse
Cursed Eclipse's picture
how to change defensive stance? SOLVED

Hi all.

I tried to modify the script "X2_S1_DefStance" but nothing happend.

 

So i tried with nwnx ,through vir_events

 

in 3 way

 

 

#include "nwnx_events"
void RandomBypass(object oPC)
{
        BypassEvent();
        //WriteTimestampedLogEntry("The action was cancelled");
        FloatingTextStringOnCreature("Azione annullata", oPC, FALSE);
}

void main()
{
    int nEventType = GetEventType();
    WriteTimestampedLogEntry("NWNX Event fired: "+IntToString(nEventType)+", '"+GetName(OBJECT_SELF)+"'");
    object oPC, oTarget, oItem;
    vector vTarget;
    int nSubID;
    switch(nEventType)
    {
       [CUT]
////////////////////////////////////////////////////////////////////////////////
//----------------------------------FEAT----------------------------------------
        case EVENT_TYPE_USE_FEAT:
            oPC = OBJECT_SELF;
            nSubID = GetEventSubType();   //FEAT_*
            oTarget = GetEventTarget();

if(nSubID == FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE || nSubID == 8)
  {
  int nLevel = GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER,oPC);
  int nRes;
  int nMolt;
  int nAB;

   if (nLevel < 5)
      {
      nAB = 1;
      nMolt = 1;
      nRes = 10;
      }
   else if (nLevel < 10)
      {
      nAB = 2;
      nMolt = 2;
      nRes = 20;
      }
   else if (nLevel < 15)
      {
      nAB = 3;
      nMolt = 3;
      nRes = 30;
      }
   else if (nLevel < 20)
      {
      nAB = 4;
      nMolt = 4;
      nRes = 40;
      }
   else if (nLevel < 25)
      {
      nAB = 5;
      nMolt = 5;
      nRes = 50;
      }
    else
      {
      nAB = 9;
      nMolt = 9;
      nRes = 90;
      }
   effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
   effect eAB = EffectAttackIncrease(nMolt);
   effect eAC = EffectACIncrease(nMolt);
   effect eLink = EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID,nRes),
   EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD,nRes));//EffectDamageResistance
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC,nRes));
   eLink = EffectLinkEffects(eLink, eAB);
   eLink = EffectLinkEffects(eLink, eAC);
   eLink = EffectLinkEffects(eLink, eDur);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oPC,RoundsToSeconds(nLevel));
}

break;

 

////////////////////////////////////////////////////////////////////////////////
//----------------------------------SPELL_---------------------------------
        case EVENT_TYPE_CAST_SPELL:
            oPC = OBJECT_SELF;
            nSubID = GetEventSubType();  //SPELL_*
            oTarget = GetEventTarget();
if(nSubID == SPELLABILITY_DW_DEFENSIVE_STANCE)
  {
  int nLevel = GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER,oPC);
  int nRes;
  int nMolt;

   switch (nLevel)
   {
   case 1: case 2: case 3: case 4: case 5:
   nMolt = 1;
   nRes = 10;
   break;
   case 6: case 7: case 8: case 9: case 10:
   nMolt = 2;
   nRes = 20;
   break;
   case 11: case 12: case 13: case 14: case 15:
   nMolt = 3;
   nRes = 30;
   break;
   case 16: case 17: case 18: case 19: case 20:
   nMolt = 4;
   nRes = 40;
   break;
   case 21: case 22: case 23: case 24:
   nMolt = 5;
   nRes = 50;
   break;

   default:
   nMolt = 9;
   nRes = 90;
   break;
   }
   effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
   effect eAB = EffectAttackIncrease(nMolt);
   effect eAC = EffectACIncrease(nMolt);
   effect eLink = EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID,nRes),
   EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD,nRes));//EffectDamageResistance
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC,nRes));
   eLink = EffectLinkEffects(eLink, eAB);
   eLink = EffectLinkEffects(eLink, eAC);
   eLink = EffectLinkEffects(eLink, eDur);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oPC,RoundsToSeconds(nLevel));
   BypassEvent();
}
break;

////////////////////////////////////////////////////////////////////////////////
//----------------------------------ACTION MODE---------------------------------
        case EVENT_TYPE_TOGGLE_MODE:
            oPC = OBJECT_SELF;
            nSubID = GetEventSubType();  //ACTION_MODE_*
            //WriteTimestampedLogEntry(GetName(oPC)+" toggled mode  #"+IntToString(nSubID));
            //dirty fighting
if(nSubID == FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE || nSubID == 8)
  {
  int nLevel = GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER,oPC);
  int nRes;
  int nMolt;
  int nAB;

   if (nLevel < 5)
      {
      nAB = 1;
      nMolt = 1;
      nRes = 10;
      }
   else if (nLevel < 10)
      {
      nAB = 2;
      nMolt = 2;
      nRes = 20;
      }
   else if (nLevel < 15)
      {
      nAB = 3;
      nMolt = 3;
      nRes = 30;
      }
   else if (nLevel < 20)
      {
      nAB = 4;
      nMolt = 4;
      nRes = 40;
      }
   else if (nLevel < 25)
      {
      nAB = 5;
      nMolt = 5;
      nRes = 50;
      }
    else
      {
      nAB = 9;
      nMolt = 9;
      nRes = 90;
      }
   effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
   effect eAB = EffectAttackIncrease(nMolt);
   effect eAC = EffectACIncrease(nMolt);
   effect eLink = EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID,nRes),
   EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD,nRes));//EffectDamageResistance
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE,nRes));
   eLink = EffectLinkEffects(eLink,EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC,nRes));
   eLink = EffectLinkEffects(eLink, eAB);
   eLink = EffectLinkEffects(eLink, eAC);
   eLink = EffectLinkEffects(eLink, eDur);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oPC,RoundsToSeconds(nLevel));
}

break;
[CUT]
    }
}

 

 

but i failed in all three cases. When Defensive Stance is activated the bonuses remain the same of the original game,ignoring the ones I put in the script.

 

Leanowar: 130.255.75.252

  • up
    50%
  • down
    50%
StraightOuttaAvernus
StraightOuttaAvernus's picture

The script name you're filling in for is a dummy script leftover from when that was going to be the way Bioware emulated it. At some point or another, it was going to be softcoded, but they decided against it. The same is true of quivering palm and smite evil.

You'll need to associate the new script with the feat by modifying the 2das.

Current development head of the Anderfell PW project, habitual player of halfdragons, and novice NWscripter

"Keep it simple, stupid" 

  • up
    100%
  • down
    0%
Cursed Eclipse
Cursed Eclipse's picture

Thx for the advice

You'll need to associate the new script with the feat by modifying the 2das.

Is feat 2da server side?

  • up
    50%
  • down
    50%
Shadooow
Shadooow's picture

nwnx_events cannot capture defensive stance

you need nwnx_patch at least if you host on windows, if not there might be other choices but I am not familiar with them

  • up
    100%
  • down
    0%
Cursed Eclipse
Cursed Eclipse's picture

nwnx_events cannot capture defensive stance

you need nwnx_patch at least if you host on windows, if not there might be other choices but I am not familiar with them

No my module run on ubuntu.

Someone wrote on http://nwn.wikia.com/wiki/Talk:Defensive_stance that:

 

You can use the events plugin: the defensive stance is an EVENT_TYPE_TOGGLE_MODE subtype N°12 to script it

 

so i thought that it was possible.

 

  • up
    50%
  • down
    50%
Valas
Valas's picture

"[SOLVED]"?

What finally worked?

  • up
    50%
  • down
    50%
Cursed Eclipse
Cursed Eclipse's picture

the modify the defensive stance. Through nwnx_events i have been able to bypass the feat and run my custom code.

 

  • up
    100%
  • down
    0%
Shadooow
Shadooow's picture

seems that nwnx_events was updated since the time I tried or you run linux version then

  • up
    50%
  • down
    50%
Cursed Eclipse
Cursed Eclipse's picture

@Shado0ow

Linux

  • up
    50%
  • down
    50%