Lengthening duration of summons and scaling their attack &ac with PC
#1
Posté 26 octobre 2013 - 02:53
I would like to lengthen the time summons stay active and alter the summons so they scale their ac and attack bonuses based on the pc.
any pointers to what I need to would be helpful.
thanks
#2
Posté 26 octobre 2013 - 04:08
copy 'nw_s0_summon' from /Data to your override (and make sure the other .ncs is gone)
This is the basic spell:
int nSpellID = GetSpellId();
int nDuration = GetCasterLevel(OBJECT_SELF) + 3;
effect eSummon = SetSummonEffect(nSpellID);
int nMetaMagic = GetMetaMagicFeat();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2;
}
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), RoundsToSeconds(nDuration));
DelayCommand(2.f, DoBuffs(nSpellID)); // See below.The easiest way to increase the duration is change RoundsToSeconds() to either TurnsToSeconds() or HoursToSeconds()
a round is 6 seconds; a turn is 10 minutes; an hour is an hour. ( a round is measured in realtime but i think both turns and hours are measured in gametime.. ie, compressed time )
To add a buff, you have to wait till the creature has finished summoning. Ie, write & delay a helper function
void DoBuffs(int nSpellID)
{
int iBonus = 0;
switch (nSpellID)
{
case SPELL_SUMMON_CREATURE_I: iBonus = 1; break;
case SPELL_SUMMON_CREATURE_II: iBonus = 2; break;
case SPELL_SUMMON_CREATURE_III: iBonus = 3; break;
case SPELL_SUMMON_CREATURE_IV: iBonus = 4; break;
case SPELL_SUMMON_CREATURE_V: iBonus = 5; break;
case SPELL_SUMMON_CREATURE_VI: iBonus = 6; break;
case SPELL_SUMMON_CREATURE_VII: iBonus = 7; break;
case SPELL_SUMMON_CREATURE_VIII:
case SPELL_SHADES_TARGET_GROUND: iBonus = 8; break;
case SPELL_SUMMON_CREATURE_IX: iBonus = 9; break;
default: break;
}
if (iBonus)
{
effect eAC = EffectACIncrease(iBonus);
effect eAB = EffectAttackIncrease(iBonus);
effect eLink = EffectLinkEffects(eAC, eAB);
eLink = SupernaturalEffect(eLink);
object oSummons = GetAssociate(ASSOCIATE_TYPE_SUMMONED, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oSummons);
}
}Place this helper function above void main(), or declare it first and place this definition after (like the others, either way works) I'd put it just above void main() and spare the trouble of declaring it. Notice how it's delayed by 2 seconds in the core function
Modifié par kevL, 26 octobre 2013 - 05:56 .
#3
Posté 26 octobre 2013 - 05:56
#4
Posté 26 octobre 2013 - 02:43
thinking about I decided I wanted to have the ac and ab scale from my char level so adjusted and created something from what you posted. been a while since I really coded that much. would this work? I am wanting it to scale so that for each 3rd caster level I get 1 bonus up to a max of 5.
void DoBuffs(int nSpellID)
{
int iBonus = GetCasterLevel(OBJECT_SELF) / 3;
int sBonus =0;
switch (nSpellID)
{
case SPELL_SUMMON_CREATURE_I: spBonus = 1; break;
case SPELL_SUMMON_CREATURE_II: spBonus = 2; break;
case SPELL_SUMMON_CREATURE_III: spBonus = 3; break;
case SPELL_SUMMON_CREATURE_IV: spBonus = 4; break;
case SPELL_SUMMON_CREATURE_V: spBonus = 5; break;
case SPELL_SUMMON_CREATURE_VI: spBonus = 6; break;
case SPELL_SUMMON_CREATURE_VII: spBonus = 7; break;
case SPELL_SUMMON_CREATURE_VIII:
case SPELL_SHADES_TARGET_GROUND: spBonus = 8; break;
case SPELL_SUMMON_CREATURE_IX: spBonus = 9; break;
default: break;
}
if (iBonus >=5) sBonus =5;
else if (iBonus <5) sBonus =iBonus;
{
effect eAC = EffectACIncrease(sBonus);
effect eAB = EffectAttackIncrease(sBonus);
effect eLink = EffectLinkEffects(eAC, eAB);
eLink = SupernaturalEffect(eLink);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, OBJECT_SELF);
}
}
What I would like to add to the summons themselves is special abilities or spells like daze or stun or rage effects and I will use spBonus for that. I do not know where to look up these values though if you can point me in the right direction.. For example I want dire wolf to have the additional ability to stun 25% and shadow mastiff I would like to have some energy damage possibly. Are adding these values more into the tinkering of the templates or can it still be done in the scripts?
#5
Posté 26 octobre 2013 - 03:14
void DoBuffs()
{
object oAssoc = GetAssociate(ASSOCIATE_TYPE_SUMMONED, OBJECT_SELF);
if (GetIsObjectValid(oAssoc))
{
int iBonus = GetCasterLevel(OBJECT_SELF) / 3;
if (iBonus > 5) iBonus = 5;
if (iBonus)
{
effect eAC = EffectACIncrease(iBonus);
effect eAB = EffectAttackIncrease(iBonus);
effect eLink = EffectLinkEffects(eAC, eAB);
eLink = SupernaturalEffect(eLink);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oAssoc);
}
}
else
{
SendMessageToPC(OBJECT_SELF, "You can't buff an associate that you do not have.");
}
}A number of points here. you left 'spBonus' undeclared, so it won't compile. And spBonus wouldn't be used for effect types : all iBonus (and previously sBonus) are is int types -- a simple integer as opposed to the more complicated effects (or Feats).
There's no need to translate iBonus into sBonus (the prefix "s" means "string" type anyway).
You'll want to preserve the check -- if (iBonus) {...} -- because that ensures that iBonus is not 0. The engine can do funny things if the increasing-effects were 0
notice that OBJECT_SELF is the *caster* (the recipient should be the summoned associate, i corrected this). I also added a check for if it's Valid... never know what can happen in the two seconds between summoning and buffing.
The templates, or more accurately the resrefs, seem to be the place to go to add Feats. Although if i understand right, you want to grant Feats according to the spell's level. In this case you will want to keep passing in nSpellID and use the switch() to do
FeatAdd(oAssoc, feat#, FALSE);
cool idea! ( don't have to mess with
[ edit ] rearranged the oAssoc check.
Modifié par kevL, 26 octobre 2013 - 03:22 .
#6
Posté 26 octobre 2013 - 03:45
yes I want to add feats as well as specific damage types/effects
one example is dire bear with knockdown
and another example like I put earlier is the dire wolf with 25% ability to stun on hit much like a weapon enchant.
#7
Posté 26 octobre 2013 - 04:15
But here's a basis I believe can work:
void DoBuffs(int nSpellID)
{
object oAssoc = GetAssociate(ASSOCIATE_TYPE_SUMMONED, OBJECT_SELF);
if (GetIsObjectValid(oAssoc))
{
switch (nSpellID)
{
case SPELL_SUMMON_CREATURE_I:
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_II:
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_III:
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_IV:
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_V:
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_VI:
// FeatAdd(oAssoc, feat#, FALSE);
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_VII:
// FeatAdd(oAssoc, feat#, FALSE);
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_VIII:
case SPELL_SHADES_TARGET_GROUND:
// FeatAdd(oAssoc, feat#, FALSE);
// FeatAdd(oAssoc, feat#, FALSE);
break;
case SPELL_SUMMON_CREATURE_IX:
// FeatAdd(oAssoc, feat#, FALSE);
// FeatAdd(oAssoc, feat#, FALSE);
// FeatAdd(oAssoc, feat#, FALSE);
break;
default:
break;
}
int iBonus = GetCasterLevel(OBJECT_SELF) / 3;
if (iBonus > 5) iBonus = 5;
if (iBonus)
{
effect eAC = EffectACIncrease(iBonus);
effect eAB = EffectAttackIncrease(iBonus);
effect eLink = EffectLinkEffects(eAC, eAB);
eLink = SupernaturalEffect(eLink);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oAssoc);
}
effect eVis = EffectVisualEffect(VFX_DUR_SPELL_HEROISM);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oAssoc);
}
else
{
SendMessageToPC(OBJECT_SELF, "You can't buff an associate "
+ "that you do not have.");
}
}I commented the FeatAdd() lines because they need feat#'s added -- see Feat.2da for a couple thousand feats. ( replace "feat#" with the actual row # )
the extra FeatAdd's are just to show how to add more than one.
And i put in VFX_HEROISM so you know it goes off and looks nifty
Modifié par kevL, 26 octobre 2013 - 04:28 .
#8
Posté 26 octobre 2013 - 05:09
First, I note that a slight miscue in kevL's first example is being grandfathered in. Be sure to fix poor SPELL_SUMMON_CREATURE_VIII at some point.
Second, a general
Modifié par I_Raps, 26 octobre 2013 - 05:15 .
#9
Posté 26 octobre 2013 - 05:15
Looks like stunning fist would be a good candidate for stun.
A few questions on featadd to summons:
Will they automatically attempt to use these feats if they are assigned to them and do they have a priority when they use them?
Do I need to assign the pre-requisite feat if I want the improved version (Do I need knockdown to have improved knockdown?)
Does it break the game if I assign racial feats to summons or can I assign any feat to them I want to?
Thanks again for the help. I am beginning to have more fun tinkering than playing.
#10
Posté 26 octobre 2013 - 05:19
sapientCrow wrote...
Will they automatically attempt to use these feats if they are assigned to them and do they have a priority when they use them?
There's a thread around here from earlier this year about getting creatures to use their abilities.
sapientCrow wrote...
Does it break the game if I assign racial feats to summons or can I assign any feat to them I want to?
This is an interesting question. I'm not sure you can do that, since the racial feats are on different 2da's. I don't know if you can access them with a script - I join you in awaiting an answer.
#11
Posté 26 octobre 2013 - 05:21
The scaling part is mainly because I want them to each not act according to level but based on the caster. Each summon will now inherit specific feats and with their length of time alive end up becoming a party member in their own right rather than a little flash and gone in short order.
In standard state summons are more like meat shields to distract enemies rather than useful tactical entities.
#12
Posté 26 octobre 2013 - 05:27
I_Raps wrote...
There's a thread around here from earlier this year about getting creatures to use their abilities.
Here: monster powers; and this one might be helpful as well : monster spells
#13
Posté 26 octobre 2013 - 05:35
sapientCrow wrote...
@I_Raps
The scaling part is mainly because I want them to each not act according to level but based on the caster. Each summon will now inherit specific feats and with their length of time alive end up becoming a party member in their own right rather than a little flash and gone in short order.
In standard state summons are more like meat shields to distract enemies rather than useful tactical entities.
Yes, but I don't really see the problem with a temporarily summoned tool being a tool.
But I can relate to your thinking, though. I have improved the Gate spell, for example. And I have made new spells to summon new types of creatures with a bit more spunk.
But we're not talking about those; we're talking about the standard summonses (which the other guys will also use). I think you need to think about just how buff you want each critter to be. And do you really want an uncontrolled force to dominate the battle (many battles, given your extending durations)?
Modifié par I_Raps, 26 octobre 2013 - 05:35 .
#14
Posté 26 octobre 2013 - 05:38
yeah, sometimes that's my problem too. then i think about 500 spellscripts... and loadup insteadThanks again for the help. I am beginning to have more fun tinkering than playing.
re. Racial Feats
if they're in Feat.2da you can look up their Spells.2da entry and from there examine the spellscript ( if not hardcoded ). If they're in some racial.2da idk. The hypothesis i go by, is that the "racial" thing is merely a name and they can be assigned (in a pinch) to anyone.
But, eg, there might be something in their script that double checks for Race...
re. Do the feats get used? depends on the AI... use TonyK's AI and set the summons' Behavior to Ability Usage TRUE, Knockdown (global) TRUE, etc.
_Raps: I'm sure more than one bug gets grandfathered in with the stock script. Personally i'm using one of Kaedrin's old summon scripts, modified. For example, GetCasterLevel() is very basic; it doesn't account for many nifty boosts that can be had from various extra classes....
don't know what the problem is with Summon VIII tho
the FALSE arg. in FeatAdd() means no prerequisite neededsapientCrow wrote...
Do I need to assign the pre-requisite feat if I want the improved version (Do I need knockdown to have improved knockdown?)
Modifié par kevL, 26 octobre 2013 - 05:46 .
#15
Posté 26 octobre 2013 - 06:49
I've just taken a look at feat.2da and the only thing offbeat about Racial Feats is RACIALABILITY_FT_CAT.
Looking at feat.txt, we see "FeatCategory
+-------+---------------
Defines what category grouping the feat shows up on in feat selection and on the character sheet. HISTORY_FT_CAT category feats are not checked by character validation."
That "character validation" may be a stumbling block, but probably not. Off to experiment.
#16
Posté 26 octobre 2013 - 07:14
#17
Posté 27 octobre 2013 - 02:27
Reading through the posts on adding actual spells to creatures or summons it states I need to have the correct stats or other requirements met. How do I look up what base stats summons are born with?
I thought of something funny too. Even though it would negate my infinite summon request it would be hilarious to have my summon be born with an ability to summon who then could summon and so on and so on. A private army right there.
#18
Posté 27 octobre 2013 - 02:49
Does this also go before the void with the doBuffs?
#19
Posté 27 octobre 2013 - 02:57
what happened?sapientCrow wrote...
actually I just ran into a problem. I forgot to run the delay.
See the 2nd post, the Delay w/ DoBuffs() is tucked under ApplyEffectAt Location(), very last command in the void main() { code-section }Where does the delayCommand get placed in the script.
like "DelayCommand void Do Buffs" ? no. See 2nd postDoes this also go before the void with the doBuffs?
Modifié par kevL, 27 octobre 2013 - 02:59 .
#20
Posté 27 octobre 2013 - 03:02
#21
Posté 27 octobre 2013 - 05:25
How do I open the creature templates and edit them? I am not seeing any way to do this inside the toolset.
#22
Posté 27 octobre 2013 - 05:54
sapientCrow wrote...
How do I open the creature templates and edit them? I am not seeing any way to do this inside the toolset.
Here's the most recent treatise on that: once more into the breach
#24
Posté 27 octobre 2013 - 09:23
I will post when it is working
#25
Posté 28 octobre 2013 - 01:08
it's better now





Retour en haut






