Questions about multiple simultaneous dominate effects
#1
Posté 06 février 2013 - 05:41
Also, http://nwvault.ign.com/View.php?view=nwn2scripts.detail&id=99 has managed to do this with summons and the control undead spell, but there is no script for .ncs file to either of them. I don't know if this was to keep the knowledge privy or it relates to the change in scripts to the Mask of the Betrayer expansion pack.
Information regarding how to do this would be much appreciated.
#2
Posté 06 février 2013 - 09:59
A custom aura (EffectAreaOfEffect using the 'custom' constant) on the creature could keep track of the duration of the domination via the aura's own heartbeat script, or it could have the faux-dominated creature do a will save every round to see if it breaks free and turns hostile again.
If you don't like the bug that causes the game to crash on exiting with a henchman in the party (there's a fix out there for that), then you could change the creature's faction to defender and add a custom AOE effect that causes them to follow a specified leader (usually the caster). There's an OnSpawn script in the game that also causes a creature to follow a leader stored as a local object on them, which might negate the need for a custom AOE effect. Their portraits wouldn't show up in the party - but if you wanted a lot of 'dominated' creatures, that's probably for the best.
I had multiple summoned creatures in Shaar Moan. An item summoned a dire rat called Ben, plus a bunch of lesser dire rats who followed the summoned rat (Ben's minions). The additional rats were defenders who kept close to Ben when not in combat.
Modifié par DannJ, 06 février 2013 - 10:01 .
#3
Posté 07 février 2013 - 02:35
I'm still a bit curious as to how Reeron managed to get the summons and control spells to work like they did. (I guess I could join the site and message the author(s)? directly.)
#4
Posté 07 février 2013 - 04:13
#5
Posté 09 février 2013 - 07:10
While turning the dominate spell effect into a henchman one wasn't too difficult, I am lost as to how to increase the henchman limit. I know there is a setmaxhenchmen function, but I am not too sure where to insert it in what file.
Here is what I have now, I haven't started the heart scripts, and yes there are unused variables so far.
EDIT: Took out the sript posted since it is now moot.
Modifié par Finislucent, 11 février 2013 - 06:22 .
#6
Posté 09 février 2013 - 05:47
- here's a quick heads up: Henchmen Game Crash Fix (LB)
#7
Posté 09 février 2013 - 11:05
Another question, the henchmen seem to be following just basic associate ai, well they seem to lack ai in general, would anyone know how to attach a script to modify their ai?
Prime example would be I try to issue a command and get no response.
#8
Posté 09 février 2013 - 11:46
PCDominate is one of them ... NPC_Default is probably already loaded on the mob. ( it should be barring customizations )
I don't know, maybe you want to try changing the AI to NPC_Associates (or even Player_Default) when the dominate takes effect and then change it back to normal NPC_Default when the dominate wears off ...
// SetCreatureScriptsToSet(oCreature, SCRIPTSET_*)
#9
Posté 10 février 2013 - 12:15
On that note, someone else accomplished what I was trying to do with much greater finesse and more.
http://nwvault.ign.c...l.detail&id=141
Tony you are a saint.
So this is the basic overall spell, again there are unused varibles; I am leaving them in as references for now.
As of right now there is no time limitations (something that will get fixed), this sets the script so the domination is now a henchman instead and uses the companion heartbeat scripts.
#include "x0_I0_SPELLS"
#include "x2_inc_spellhook"
void main(){SetMaxHenchmen(100);
/* Spellcast Hook Code Added 2003-06-23 by GeorgZIf you want to make changes to all spells,check x2_inc_spellhook.nss to find out more
*/ if (!X2PreSpellCastCode()){// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spellreturn; }
// End of Spell Cast Hook
//Declare major variablesobject
oTarget = GetSpellTargetObject();
object oMaster = OBJECT_SELF;
object oHenchman = GetSpellTargetObject();
object oCreature = GetSpellTargetObject();
effect eDom = EffectDominated();
eDom = GetScaledEffect(eDom, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_SPELL_DOM_MONSTER);
//Link domination and persistant VFX
effect eLink = EffectLinkEffects(eDur, eDom);
int nScriptset = SCRIPTSET_PLAYER_DEFAULT;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = 24*nCasterLevel;
nDuration = GetScaledDuration(nDuration, oTarget);
int nRacial = GetRacialType(oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_MONSTER, FALSE));
//Make sure the target is a monster
{
//Make SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a Will Save
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply linked effects and VFX Impact
AddHenchman(oMaster, oHenchman);
SetCreatureScriptsToSet(oCreature, nScriptset);
}
}
}
}
Wooooooooooo!!!! I'm still a novice scriptor!
Anyway this is the same as above except it removes the henchmen function after 60 seconds per caster level. Also, does anyone know where the unsummon command script(i.e. the one that dismisses a summon prematurely) would be, so I could look at it and see if I could copy and modify it so it would use removehenchman() function instead?
#include "x0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
SetMaxHenchmen(100);
/* Spellcast Hook Code Added 2003-06-23 by GeorgZIf you want to make changes to all spells,check x2_inc_spellhook.nss to find out more
*/ if (!X2PreSpellCastCode())
{// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spellreturn;}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
object oMaster = OBJECT_SELF;
object oHenchman = GetSpellTargetObject();
object oCreature = GetSpellTargetObject();
effect eDom = EffectDominated();
eDom = GetScaledEffect(eDom, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_SPELL_DOM_MONSTER);
//Link domination and persistant VFX
effect eLink = EffectLinkEffects(eDur, eDom);
int nScriptset = SCRIPTSET_PLAYER_DEFAULT;
int nScriptsetb = SCRIPTSET_NPC_DEFAULT;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = 24*nCasterLevel;
float fSeconds = 60.0*nCasterLevel;
nDuration = GetScaledDuration(nDuration, oTarget);
int nRacial = GetRacialType(oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_MONSTER, FALSE));
//Make sure the target is a monster
{
//Make SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a Will Save
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
{
//Check for metamagic extensionif (nMetaMagic == METAMAGIC_EXTEND)
{
fSeconds = fSeconds*2;
}
//Apply linked effects and VFX Impact
AddHenchman(oMaster, oHenchman);SetCreatureScriptsToSet(oCreature, nScriptset);
DelayCommand(fSeconds, RemoveHenchman(oMaster, oHenchman));
DelayCommand(fSeconds, SetCreatureScriptsToSet(oCreature, nScriptsetb));
}
}
}
}
Modifié par Finislucent, 10 février 2013 - 05:38 .
#10
Posté 10 février 2013 - 05:10
Finislucent wrote...
does anyone know where the unsummon command script(i.e. the one that dismisses a summon prematurely) would be, so I could look at it and see if I could copy and modify it so it would use removehenchman() function instead?
the unsummon (right click, bottom of menu) is handled by a GUI : contextmenu.xml
It's huge. TonyK put many of his party-AI extensions in here. I believe this is the section:
<UIRadialNode name="node-unsummon" style="BASE_RADIAL_NODE" strref="1569" OnInit='UIRadialNode_OnInit_Unsummon()' OnLeftClickCollapsed='UIRadialNode_Mouse_ActionUnsummon()' > <UIFrame state="base" fill="ife_bullheaded.tga" /> </UIRadialNode>
UIRadialNode_Mouse_ActionUnsummon() is a hardcoded Gui function, but there's probably a way to add a callback to a customized Gui-script that may or may not handle dismissing dominated henchmen .....
- search for Lance's XML Tutorial, it's in the Vault but i suspect there'll be a lot of trial & error, to get a script to fire (and not screw up Unsummon etc)
ps. Make a backup
#11
Posté 11 février 2013 - 02:46
Update to the dominate spell script again; I noticed I left an important factor out, which was that if it was cast on one of your roster members it would break them to the point of beyond repair; so I updated the script again so they only get the generic dominate feature. Here it is for the posterity.
Edit: couple of minor changes upon suggestion (from Morbane)
Edit 2: changed duration
#include "nw_i0_spells"
void main()
{
SetMaxHenchmen(100);
object oTarget = GetSpellTargetObject();
object oMaster = OBJECT_SELF;
object oHenchman = GetSpellTargetObject();
object oCreature = GetSpellTargetObject();
effect eDom = EffectDominated();
eDom = GetScaledEffect(eDom, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_SPELL_DOM_MONSTER);
eLink = EffectLinkEffects(eDur, eDom);
int nScriptset = SCRIPTSET_PLAYER_DEFAULT;
int nScriptsetb = SCRIPTSET_NPC_DEFAULT;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = nCasterLevel + 5;
nDuration = GetScaledDuration(nDuration, oTarget);
int nRacial = GetRacialType(oTarget);
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_MONSTER, FALSE));
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
{
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration*2;
}
if ((GetIsRosterMember(oCreature)) == TRUE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}
else
{
AddHenchman(oMaster, oHenchman);
SetCreatureScriptsToSet(oCreature, nScriptset);
DelayCommand(RoundsToSeconds(nDuration), RemoveHenchman(oMaster, oHenchman));
}
}
}
}
}
}
EDIT: After adding the removehenchman() to a feat linked through a spell; Reeron's summon/control mod does indeed seem to change them to henchmen. EDIT 3: Checking out supernatural/extraordinaryeffect-which yielded nothing
Modifié par Finislucent, 15 février 2013 - 04:58 .
#12
Posté 11 février 2013 - 06:39
use #include "nw_i0_spells"
rather than #include "x0_I0_SPELLS"
the second one just references the first anyway - more direct
:innocent:
Modifié par Morbane, 11 février 2013 - 06:40 .
#13
Posté 11 février 2013 - 06:43
#14
Posté 11 février 2013 - 06:47
void main()
{
SetMaxHenchmen(100);
object oTarget = GetSpellTargetObject();
object oMaster = OBJECT_SELF;
object oHenchman = GetSpellTargetObject();
object oCreature = GetSpellTargetObject();
effect eDom = EffectDominated();
eDom = GetScaledEffect(eDom, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_GLYPH_OF_WARDING);
effect eLink = EffectLinkEffects(eDur, eDom);
int nScriptset = SCRIPTSET_PLAYER_DEFAULT;
int nScriptsetb = SCRIPTSET_NPC_DEFAULT;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = 3*nCasterLevel;
float fSeconds = 18.0*nCasterLevel;
nDuration = GetScaledDuration(nDuration, oTarget);
int nRacial = GetRacialType(oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_MONSTER, FALSE));
//Make sure the target is a monster
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Make SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a Will Save
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
{
//Check for metamagic extension
if (nMetaMagic == METAMAGIC_EXTEND)
{
fSeconds = fSeconds*2;
nDuration = nDuration*2;
}
if ((GetIsRosterMember(oCreature)) == TRUE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}
else
{
//Apply linked effects and VFX Impact
AddHenchman(oMaster, oHenchman);
SetCreatureScriptsToSet(oCreature, nScriptset); //new to me
DelayCommand(fSeconds, RemoveHenchman(oMaster, oHenchman));
}
}
}
}
}
}
Modifié par Morbane, 11 février 2013 - 06:51 .
#15
Posté 11 février 2013 - 06:51
Thanks for suggestion, doubt I would have noticed them anytime soon.
EDIT: I would like to thank everyone who made it possible, that a master can now have the minions fight in his stead as he can now kickback and make some bets.
EDIT: Spoke too soon; there is another way to accomplish what I did, and that is through the "EffectCutsceneDominate" function which is much simpler than what I did.
On that note for summons change the "EffectSummon" to use "CreateObject" and then add the "EffectCutsceneDominate" to the object and that would net summons only limited to duration and number of castings
Modifié par Finislucent, 11 mars 2013 - 12:06 .





Retour en haut






