Skip to content

Creature levels and scripts.

NK1990NK1990 Member Posts: 76
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 ?:

Comments

  • NK1990NK1990 Member Posts: 76
    IF
    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
  • sarevok57sarevok57 Member Posts: 6,002
    i suppose in theory you could, in bg2 there are some "spawns" that scale with your charname XP with the thresholds being; 400 000 xp, 1000 000 xp and 2 000 000 xp

    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
  • jmerryjmerry Member Posts: 3,881
    NK1990 wrote: »
    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 ?:

    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.
  • NK1990NK1990 Member Posts: 76
    Yeah I noticed too the resist magic line earlier it is because I copied the script for magic missile, and changed it to melf acid arrow slowly, I normally just edit it on the go while playing and keep tweaking the coding until the behaviour suits me.

    !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 ?.
  • NK1990NK1990 Member Posts: 76
    I was also wondering if I understand these spell states correctly.
    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.
  • kjeronkjeron Member Posts: 2,368
    ACID_LEVEL_2 and ACID_LEVEL_3 are used by Death Fog in IWDEE, to trigger it's increased damage. Nothing to do with Melf's Acid Arrow.
  • NK1990NK1990 Member Posts: 76
    So there is no STATE that indentifies that effect ?. Seems weird since, some of the NPC can figure out the effect fine. Is there a way to make a char cycle targets then, after a RESPONSE, so he does not use the ability twice in a row on the same target ?. But rather shoots a spell and change the target to next enemy ?.
  • jmerryjmerry Member Posts: 3,881
    Melf's Acid Arrow, in the standard game, does not inflict any state. As such, AI-controlled creatures will ignore it in their decision-making. The arrow's effect is just a bunch of damage effects with different delays on them.

    If you want to change this, edit the spell. And if no existing spell state covers that, you can just add one.
  • NK1990NK1990 Member Posts: 76
    jmerry wrote: »
    Melf's Acid Arrow, in the standard game, does not inflict any state. As such, AI-controlled creatures will ignore it in their decision-making. The arrow's effect is just a bunch of damage effects with different delays on them.

    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.
  • NK1990NK1990 Member Posts: 76
    It worked making my own spell state in the IDS library, but it acts weird when I compile it, first it asked me to put quotes in both ends, then it added multiple """" """" after I saved it. But it seems to work in-game, just weird with the symbols it throws in after compileing.
  • NK1990NK1990 Member Posts: 76
    NK1990 wrote: »
    It worked making my own spell state in the IDS library, but it acts weird when I compile it, first it asked me to put quotes in both ends, then it added multiple """" """" after I saved it. But it seems to work in-game, just weird with the symbols it throws in after compileing.

    I found the error it should say melf not melf's it can not figure out the '
  • NK1990NK1990 Member Posts: 76
    It ended up looking like this.

    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
  • NK1990NK1990 Member Posts: 76
    also wrote this for breach, it's taking in all the spells listed in the description plus some more it affects.

    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
  • NK1990NK1990 Member Posts: 76
    I could also have used BUFF_PRO_WEAPONS for mantles and weapon protections.
  • NK1990NK1990 Member Posts: 76
    BUFF_PRO_DAMAGE for resistance
  • NK1990NK1990 Member Posts: 76
    that was more like it lol.

    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
  • SSS314908SSS314908 Member Posts: 1
    [quote="

    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
Sign In or Register to comment.