Jump to content


Photo

WIZARD_SLEEP and WIZARD_COLOR_SPRAY change


3 replies to this topic

#1 Gimble

Gimble
  • Members
  • 47 posts

Posted 05 January 2012 - 07:39 AM

Playing with the eSeries on BGT, I found that WIZARD_SLEEP does not fire. The offending script code is as follows:
  OR(2)
	 Range(Player1,0)													  //Either I'm Player1
	 CheckStatGT(Player1,5,LEVEL)										  // or they're high enough to be immune to this
  OR(2)
	 Range(Player2,0)													  //Either I'm Player2
	 CheckStatGT(Player2,5,LEVEL)										  // or they're high enough to be immune to this
  OR(2)
	 Range(Player3,0)													  //Either I'm Player3
	 CheckStatGT(Player3,5,LEVEL)										  // or they're high enough to be immune to this
  OR(2)
	 Range(Player4,0)													  //Either I'm Player4
	 CheckStatGT(Player4,5,LEVEL)										  // or they're high enough to be immune to this
  OR(2)
	 Range(Player5,0)													  //Either I'm Player5
	 CheckStatGT(Player5,5,LEVEL)										  // or they're high enough to be immune to this
  OR(2)
	 Range(Player6,0)													  //Either I'm Player6
	 CheckStatGT(Player6,5,LEVEL)										  // or they're high enough to be immune to this
I suggest moving the above code block from the WIZARD_SLEEP block to the WIZARD_COLOR_SPRAY block. WIZARD_SLEEP affects enemies only, so the check is not necessary. WIZARD_COLOR_SPRAY, however, can affect party members, so the check would be helpful to be added (to avoid blasting fellow party members).

I'm aware this is pretty much a non-issue in Amn and ToB, but for BG1 Sleep is a great spell and this simple change should make it more usable.

Edited by Gimble, 05 January 2012 - 07:40 AM.


#2 Gimble

Gimble
  • Members
  • 47 posts

Posted 22 September 2012 - 01:44 PM

The range check can be removed from WIZARD_SLEEP. After doing some things with WIZARD_COLOR_SPRAY lately, though, I found that its range is very considerable. As a result, it's not really possible to range check for WIZARD_COLOR_SPRAY that party members aren't too close... so it probably shouldn't be moved there.

#3 Horred the Plague

Horred the Plague
  • Members
  • 70 posts

Posted 16 January 2013 - 10:27 AM

If it only affects enemies then this check is not required, but what the Range(PlayerXX,0) check does is see if it's that player doing the casting. Nobody but (Myself) can be Range(0) by default, only Range(1) or higher. As per Color Spray, the real check needed is to see if the party members are in the Cone of effect or not, but there's no good IE scripting way of doing this. Thus, the sludgy workaround you see above. It's almost (but not entirely) safer to check if the party members are all close to the caster (where the cone has less spread to the arc, thus less residual danger threshold).

Surprising the spell would fail passing the conditions though. I've seen both sleep and color spray cast by low-level parties in BGEE via BP-series scripts (where the conditional check code is similar). No party member in BG2 should have a LEVEL stat below 6 unless dual-classed (perhaps Imoen?) Maybe a third check added in, for CheckStatGT(Playerxx,5,LEVEL2) , would do the trick?

Note that both spells need a formula change if you bring in something like Spell Revisions, that allows for higher victim levels than the original spells (dependent on caster level). Your only safety catch would be the "closeness" check I described above.

#4 Horred the Plague

Horred the Plague
  • Members
  • 70 posts

Posted 16 January 2013 - 04:18 PM

Here's what I whipped up for the next BP-Series release in a couple days, thanks for the tip-off. Feel free to use it w/ the e-Series if you like (global names will need changing or just the important bits spliced-out). Or, just come grab the BP-Series pack from SHS now that it's fit for BG2-vanilla/BGT/(prob???) TuTu/BGEE, as well as Detectable Spells-compatible (i.e. should be no issues w/ SCS/II/etc, not that there really was before). More importantly, it's actively supported by the author these days. ;)

IF
    HaveSpell(WIZARD_SLEEP)
    OR(2)
	    !GlobalTimerNotExpired("SPL_CAST","LOCALS")
	    CheckStat(Myself,1,WIZARD_IMPROVED_ALACRITY)
    OR(2)
	    ActionListEmpty()
	    GlobalTimerNotExpired("INTERUPT","LOCALS")
    GlobalGT("THREAT","LOCALS",0)
    NumCreatureGT([EVILCUTOFF],2)
    General(LastSeenBy(Myself),HUMANOID)
    CheckStatLT(LastSeenBy(Myself),5,LEVEL)
    !InParty(LastSeenBy(Myself))
    !Allegiance(LastSeenBy(Myself),GOODCUTOFF)
    !Race(LastSeenBy(Myself),ELF) // BGEE is set up to handle elf sleep resistance
    CheckStatLT(Myself,75,SPELLFAILUREMAGE)
    CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
    !HasItem("RAKRING",LastSeenBy(Myself)) // No such index
    !HasItem("IMMCHS",LastSeenBy(Myself)) // No such index
    !HasItem("IRONGOL",LastSeenBy(Myself)) // No such index
    !HasItem("MAGEAMUL",LastSeenBy(Myself)) // Necklace
THEN
    RESPONSE #100
	    SetGlobalTimer("SPL_CAST","LOCALS",6)
	    Spell(LastSeenBy(Myself),WIZARD_SLEEP)
END
IF
    HaveSpell(WIZARD_COLOR_SPRAY)
    OR(2)
	    !GlobalTimerNotExpired("SPL_CAST","LOCALS")
	    CheckStat(Myself,1,WIZARD_IMPROVED_ALACRITY)
    OR(2)
	    ActionListEmpty()
	    GlobalTimerNotExpired("INTERUPT","LOCALS")
    GlobalGT("THREAT","LOCALS",0)
    !General(LastSeenBy(Myself),UNDEAD)
    NumCreatureGT([EVILCUTOFF],1)
    HPGT(LastSeenBy(Myself),5)
    CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
    Range(LastSeenBy(Myself),6)
    !InParty(LastSeenBy(Myself))
    !Allegiance(LastSeenBy(Myself),GOODCUTOFF)
    OR(4)
	    Range(Player1,1) // I'm the caster, or right next to them
	    !Range(Player1,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player1,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player1,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    OR(4)
	    Range(Player2,1) // I'm the caster, or right next to them
	    !Range(Player2,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player2,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player2,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    OR(4)
	    Range(Player3,1) // I'm the caster, or right next to them
	    !Range(Player3,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player3,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player3,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    OR(4)
	    Range(Player4,1) // I'm the caster
	    !Range(Player4,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player4,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player4,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    OR(4)
	    Range(Player5,1) // I'm the caster, or right next to them
	    !Range(Player5,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player5,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player5,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    OR(4)
	    Range(Player6,1) // I'm the caster, or right next to them
	    !Range(Player6,8) // Range is 15 which means about 8 in script-measure
	    CheckStatGT(Player6,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
	    CheckStatLT(Player6,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
    CheckStatLT(Myself,75,SPELLFAILUREMAGE)
    CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
    CheckStatLT(LastSeenBy(Myself),5,LEVEL)
    !HasItem("RAKRING",LastSeenBy(Myself)) // No such index
    !HasItem("MAGEAMUL",LastSeenBy(Myself)) // Necklace
THEN
    RESPONSE #100
	    SetGlobalTimer("SPL_CAST","LOCALS",6)
	    Spell(LastSeenBy(Myself),WIZARD_COLOR_SPRAY)
END

I did my best in IE-language to account for the 60-degree (actually 120-degree total) arc-effect of the color spray spell. Thus the Range of <= 1 OR > 8 checks. Close enough to not be in it, or far enough away not to matter. Still quite clumbsy, but you'd only expect the proper scripting functions for geometry in a 3d game (e.g., NWN has very precise cone-shaped AoE detection).



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users