nw_i0_spells and Basilisks too!
Zephirius
Member Posts: 419
Oh boy. Where to start.
I'm trying to alter the basilisks petrify attack. I need them to stop using their petrify attack and switch to their claws after I'm petrified. This bugs me to no end...
Is there an easy fix for this? I poked around nw_i0_spells and didn't find anything relating to being petrified???
Anyone have clue on how to tackle this?
I'm trying to alter the basilisks petrify attack. I need them to stop using their petrify attack and switch to their claws after I'm petrified. This bugs me to no end...
Is there an easy fix for this? I poked around nw_i0_spells and didn't find anything relating to being petrified???
Anyone have clue on how to tackle this?
0
Comments
I have a way to generally make creatures do what I want when certain conditions are met using custom AI overrides. It's a bit clunky but it works like this.
In nw_c2_default9 either uncomment the line that sets the creature to run END_COMBAT_ROUND_EVENTS or do this:
if( GetLocalInt(OBJECT_SELF,"ECRE") == 1 ) { SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); }Make a basilisk copy and add the variable ECRE|Int|1 to it.
Change the creature's OnUserDefined script handle to x2_def_userdef
Now, at the end of every combat round, the basilisk will run this next part.
In x2_def_userdef in the section:
else if(nUser == EVENT_END_COMBAT_ROUND || GetUserDefinedEventNumber() == 1003) // END OF COMBAT
put code to check if the basilisk's attack target is petrified. If so, set a custom AI script to run.
if( GetTag(OBJECT_SELF) == "betterbasilisk" ) { object oAttacker = GetAttackTarget(); if( GetIsObjectValid(oAttacker) ) { int bPetrified = FALSE; effect e = GetFirstEffect(oAttacker); while( GetIsEffectValid(e) ) { if( GetEffectType(e) == EFFECT_TYPE_PETRIFY ) { bPetrified = TRUE; break; } e = GetNextEffect(oAttacker); } } if( bPetrified ) { SetLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT","basilisk_ai"); } else DeleteLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT"); }Then make a basilisk_ai script. (using x2_ai_demo as the template)
#include "nw_i0_generic" #include "x2_inc_switches" void main() { // The following two lines should not be touched object oIntruder = GetCreatureOverrideAIScriptTarget(); ClearCreatureOverrideAIScriptTarget(); // ********************* Start of custom AI script **************************** if( GetIsObjectValid(oIntruder) ) ActionAttack(oIntruder); else DeleteLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT"); // ********************* End of custom AI script **************************** // This line *** has to be called here *** or the default AI will take over from // this point and really bad things are going to happen SetCreatureOverrideAIScriptFinished(); }I haven't tested this (so I'm sure there will be a problem