Creature levels and scripts.
NK1990
Member Posts: 76
in BGII:EE Mods
Does creatures lvl stay the same or do they get stronger with you when you lvl up in the game. I want to use the trigger IDS LevelGT(LastSeenBy(Myself),5) like this to indentify threat, so spellcasters do not waste there spells on lesser enemies ?:
0
Comments
ActionListEmpty()
HaveSpell(WIZARD_MELF_ACID_ARROW) // SPWI211.SPL (Melf's Acid Arrow)
OR(2)
!GlobalTimerNotExpired("gh_SpellCastThisRound","LOCALS")
CheckStatGT(Myself,0,AURACLEANSING)
OR(6)
ActionListEmpty()
GlobalTimerNotExpired("gh_ActionIsInterruptable","LOCALS")
!CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
!CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
!CheckSpellState(LastSeenBy(Myself),ACID_LEVEL_3)
!CheckSpellState(LastSeenBy(Myself),ACID_LEVEL_2)
LevelGT(LastSeenBy(Myself),10)
HPGT(LastSeenBy(Myself),70)
!InParty(LastSeenBy(Myself))
!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
!StateCheck(Myself,STATE_SILENCED)
CheckStatLT(Myself,76,SPELLFAILUREMAGE)
CheckStatLT(LastSeenBy(Myself),30,RESISTACID)
CheckStatLT(LastSeenBy(Myself),20,RESISTMAGIC)
CheckStatLT(LastSeenBy(Myself),26,MAGICDAMAGERESISTANCE)
CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
!HasBounceEffects(LastSeenBy(Myself))
!HasItemEquiped("RAKRING",LastSeenBy(Myself)) // No such index
!HasItemEquiped("LICH",LastSeenBy(Myself)) // Ring
!HasItemEquiped("MAGEAMUL",LastSeenBy(Myself)) // Necklace
THEN
RESPONSE #100
SetGlobalTimer("gh_SpellCastThisRound","LOCALS",ONE_ROUND)
Spell(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW) // SPWI211.SPL (Melf's Acid Arrow)
END
although if you have it set to;
LevelGT(LastSeenBy(Myself),10)
there is not many enemies if ever this spell is going to cast on since very VERY rarely are you going to be fighting creatures that are 10 levels ahead of your caster ( just starting bg2 fresh with a wizerd and escaping chateau irenicus puts you at level 9, and it doesn't take long to hit level 12, which only a handful of enemies at most in SoA are pass level 22 )
also you have an unnecessary line in your code for melf's acid arrow;
CheckStatLT(LastSeenBy(Myself),26,MAGICDAMAGERESISTANCE)
this line means that if the target creature doesn't have less than 26% magic damage resistance then the spell will not cast, but its kind of pointless given the fact that magic damage resistance does not affect acid damage
plus you have a redundancy;
CheckStatLT(LastSeenBy(Myself),20,RESISTMAGIC)
CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
there is no need to have 2 magic resistance checks, although it won't really make much off a difference if the 76 is the one you care about, it's just more codes of line that don't need to be there if ya know what i mean
if you want to add some more lines you could also add;
!Race(LastSeenBy(Myself),DEMILICH)
!Race(LastSeenBy(Myself),RAKSHASA)
!Race(LastSeenBy(Myself),LICH)
this will make it so you don't waste a level 2 spell on creatures who are immune ( also great to set for all of your level 5 spells and lower, and once you do level 6 and higher, then you can just keep the demilich one )
plus some more "immunity" checks;
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TRAP)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
this will make it so your caster will not cast spells on enemies who have; spell trap, spell turning or spell deflection
Any given creature will be the same level every time you meet it. The challenges in the game only slightly scale to the player's level, and that's entirely a matter of spawning more creatures or different creatures.
On the other hand, a level check like that will look at the creature right now, including any level drain effects. You aren't checking a list of creatures, you're looking at one specific object.
There is one case that can get you "wrong" results - an incomplete dual class. If, say, Imoen is a level 6 thief-level 3 mage, the level detected will be 3, her level in her active class. But she still has 6 HD, making her immune to Sleep and Color Spray. Since no non-party members will ever have incomplete dual classes, this is a rare issue.
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TRAP), !CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION), !CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING).
I forgot about those comepletely thank you, but is spell deflection not defined in !HasBounceEffects(LastSeenBy(Myself)).
So the spell melf acid arrow does not fail to a resist magic check ?.
It does make a lot of sense what both you said about the LevelGT(LastSeenBy(Myself),10) I know the values are off by a large margin, this is a rough copy of the first script I made I already updated multiple times since I posted this topic, maybe it would be better to set a globalthreat value instead and define it by class hitpoints and thaco ?.
It is the acid after effect of the melf acid arrow spell ?.
!CheckSpellState(LastSeenBy(Myself),ACID_LEVEL_3)
!CheckSpellState(LastSeenBy(Myself),ACID_LEVEL_2)
I have been searching all of the IDS files and this is pretty much the only states I can find that would make any sense to be that after effect. The .spl file for melf acid arrow itself, does not have any reference to a state as far as I can see.
If you want to change this, edit the spell. And if no existing spell state covers that, you can just add one.
Thank you that was and awesome idea, already begun by adding the name in the IDS file for spell state IWD Mode 1, then just copy the damage stat with the longest duration under projectile effects, and edit it to a spell state with same properties, hope it works.
I found the error it should say melf not melf's it can not figure out the '
IF
ActionListEmpty()
HaveSpell(WIZARD_MELF_ACID_ARROW) // SPWI211.SPL (Melf's Acid Arrow)
OR(2)
!GlobalTimerNotExpired("gh_SpellCastThisRound","LOCALS")
CheckStatGT(Myself,0,AURACLEANSING)
OR(4)
ActionListEmpty()
GlobalTimerNotExpired("gh_ActionIsInterruptable","LOCALS")
!CheckSpellState(LastSeenBy(Myself),BUFF_PRO_SPELLS)
!CheckSpellState(LastSeenBy(Myself),MELF_ACID_ARROW)
!InParty(LastSeenBy(Myself))
!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
!StateCheck(Myself,STATE_SILENCED)
CheckStatLT(Myself,50,SPELLFAILUREMAGE)
CheckStatLT(LastSeenBy(Myself),30,RESISTACID)
CheckStatLT(LastSeenBy(Myself),20,RESISTMAGIC)
!HasBounceEffects(LastSeenBy(Myself))
!HasItemEquiped("RAKRING",LastSeenBy(Myself)) // No such index
!HasItemEquiped("LICH",LastSeenBy(Myself)) // Ring
!HasItemEquiped("MAGEAMUL",LastSeenBy(Myself)) // Necklace
THEN
RESPONSE #100
SetGlobalTimer("gh_SpellCastThisRound","LOCALS",ONE_ROUND)
Spell(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW) // SPWI211.SPL (Melf's Acid Arrow)
END
IF
HaveSpell(WIZARD_BREACH) // SPWI513.SPL (Breach)
OR(2)
!GlobalTimerNotExpired("gh_SpellCastThisRound","LOCALS")
CheckStatGT(Myself,0,AURACLEANSING)
OR(2)
ActionListEmpty()
GlobalTimerNotExpired("gh_ActionIsInterruptable","LOCALS")
OR(11)
!CheckSpellState(LastSeenBy(Myself),BUFF_PRO_SPELLS)
CheckSpellState(LastSeenBy(Myself),ABSOLUTE_IMMUNITY)
CheckSpellState(LastSeenBy(Myself),MANTLE)
CheckSpellState(LastSeenBy(Myself),IMPROVED_MANTLE)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_MAGICAL_WEAPONS)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_NORMAL_WEAPONS)
CheckSpellState(LastSeenBy(Myself),RED_FIRESHIELD)
CheckSpellState(LastSeenBy(Myself),BLUE_FIRESHIELD)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_EVIL)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_NORMAL_MISSILES)
CheckSpellState(LastSeenBy(Myself),WIZARD_SHIELD)
OR(14)
CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_NORMAL_WEAPONS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_NORMAL_MISSILES)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_THE_ELEMENTS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_ENERGY)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_RESIST_FEAR)
CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
CheckStatGT(LastSeenBy(Myself),0,DEATH_WARD)
CheckStatGT(LastSeenBy(Myself),0,DEFENSIVE_MODIFIER)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_SHIELD)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
!InParty(LastSeenBy(Myself))
!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
!StateCheck(Myself,STATE_POISONED)
!StateCheck(Myself,STATE_SILENCED)
CheckStatLT(Myself,50,SPELLFAILUREMAGE)
!HasItemEquiped("RAKRING",LastSeenBy(Myself)) // No such index
!HasItemEquiped("LICH",LastSeenBy(Myself)) // Ring
THEN
RESPONSE #100
SetGlobalTimer("gh_SpellCastThisRound","LOCALS",ONE_ROUND)
Spell(LastSeenBy(Myself),WIZARD_BREACH) // SPWI513.SPL (Breach)
DisplayStringHead(LastSeenBy(Myself),5021) // Breach
END
IF
HaveSpell(WIZARD_BREACH) // SPWI513.SPL (Breach)
OR(2)
!GlobalTimerNotExpired("gh_SpellCastThisRound","LOCALS")
CheckStatGT(Myself,0,AURACLEANSING)
OR(2)
ActionListEmpty()
GlobalTimerNotExpired("gh_ActionIsInterruptable","LOCALS")
OR(12)
!CheckSpellState(LastSeenBy(Myself),BUFF_PRO_SPELLS)
CheckSpellState(LastSeenBy(Myself),BUFF_PRO_DAMAGE)
CheckSpellState(LastSeenBy(Myself),ABSOLUTE_IMMUNITY)
CheckSpellState(LastSeenBy(Myself),MANTLE)
CheckSpellState(LastSeenBy(Myself),IMPROVED_MANTLE)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_MAGICAL_WEAPONS)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_NORMAL_WEAPONS)
CheckSpellState(LastSeenBy(Myself),RED_FIRESHIELD)
CheckSpellState(LastSeenBy(Myself),BLUE_FIRESHIELD)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_EVIL)
CheckSpellState(LastSeenBy(Myself),PROTECTION_FROM_NORMAL_MISSILES)
CheckSpellState(LastSeenBy(Myself),WIZARD_SHIELD)
OR(11)
CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_THE_ELEMENTS)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_ENERGY)
CheckStatGT(LastSeenBy(Myself),0,WIZARD_RESIST_FEAR)
CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
CheckStatGT(LastSeenBy(Myself),0,DEATH_WARD)
CheckStatGT(LastSeenBy(Myself),0,DEFENSIVE_MODIFIER)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_SHIELD)
!CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
!InParty(LastSeenBy(Myself))
!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
!StateCheck(Myself,STATE_POISONED)
!StateCheck(Myself,STATE_SILENCED)
CheckStatLT(Myself,50,SPELLFAILUREMAGE)
!HasItemEquiped("RAKRING",LastSeenBy(Myself)) // No such index
!HasItemEquiped("LICH",LastSeenBy(Myself)) // Ring
THEN
RESPONSE #100
SetGlobalTimer("gh_SpellCastThisRound","LOCALS",ONE_ROUND)
Spell(LastSeenBy(Myself),WIZARD_BREACH) // SPWI513.SPL (Breach)
DisplayStringHead(LastSeenBy(Myself),5021) // Breach
END
although if you have it set to;
LevelGT(LastSeenBy(Myself),10)
there is not many enemies if ever this spell is going to cast on since very VERY rarely are you going to be fighting creatures that are 10 levels ahead of your caster ( just starting bg2 fresh with a wizerd and escaping chateau irenicus puts you at level 9, and it doesn't take long to hit level 12, which only a handful of enemies at most in SoA are pass level 22 )
[/quote]
This info seems to be wrong. LevelGT(LastSeenBy(Myself),10) checks if "lastseen" is higher than level 10, not 10 levels higher