CheckSpellState(Player1,PROTECTION_FROM_EVIL) doesn't work :/
Dremor
Member Posts: 40
i made this piece of code... npc keep casting all copies of spell unable to tell if target has spell already on.
// CLERIC_PROTECT_FROM_EVIL SPPR107 - P1
IF
OR(2)
Range(Player1,0)
!StateCheck(Player1,STATE_IMPROVEDINVISIBILITY)
ActionListEmpty()
Global("SPELLoff","LOCALS",0)
OR(5)
Global("tempBUFFon","LOCALS",1)
Race(LastSeenBy(Myself),DEMONIC)
Race(LastSeenBy(Myself),RAKSHASA)
Race(LastSeenBy(Myself),GITHYANKI)
Race(LastSeenBy(Myself),GENIE)
!GlobalTimerNotExpired("SCAST","LOCALS")
CheckStatLT(Myself,25,SPELLFAILUREPRIEST)
HaveSpell(CLERIC_PROTECT_FROM_EVIL)
!CheckSpellState(Player1,1) //PROTECTION_FROM_EVIL
OR(2)
Global("tempBUFFon","LOCALS",1)
!InParty(LastSeenBy(Myself))
OR(2)
Global("tempBUFFon","LOCALS",1)
!Allegiance(LastSeenBy(Myself),NEUTRAL)
OR(2)
Global("tempBUFFon","LOCALS",1)
!Race(LastSeenBy(Myself),NO_RACE)
OR(2)
Global("tempBUFFon","LOCALS",1)
See(LastSeenBy(Myself))
!GlobalTimerNotExpired("P1ProtectionEvilCastLock","GLOBAL")
THEN
RESPONSE #100
SetGlobalTimer("P1ProtectionEvilCastLock","GLOBAL",6)
SetInterrupt(FALSE)
SetGlobalTimer("SCAST","LOCALS",6)
Spell(Player1,CLERIC_PROTECT_FROM_EVIL)
DisplayStringHead(Myself,12023) //Protection From Evil
SetInterrupt(TRUE)
END
// CLERIC_PROTECT_FROM_EVIL SPPR107 - P1
IF
OR(2)
Range(Player1,0)
!StateCheck(Player1,STATE_IMPROVEDINVISIBILITY)
ActionListEmpty()
Global("SPELLoff","LOCALS",0)
OR(5)
Global("tempBUFFon","LOCALS",1)
Race(LastSeenBy(Myself),DEMONIC)
Race(LastSeenBy(Myself),RAKSHASA)
Race(LastSeenBy(Myself),GITHYANKI)
Race(LastSeenBy(Myself),GENIE)
!GlobalTimerNotExpired("SCAST","LOCALS")
CheckStatLT(Myself,25,SPELLFAILUREPRIEST)
HaveSpell(CLERIC_PROTECT_FROM_EVIL)
!CheckSpellState(Player1,1) //PROTECTION_FROM_EVIL
OR(2)
Global("tempBUFFon","LOCALS",1)
!InParty(LastSeenBy(Myself))
OR(2)
Global("tempBUFFon","LOCALS",1)
!Allegiance(LastSeenBy(Myself),NEUTRAL)
OR(2)
Global("tempBUFFon","LOCALS",1)
!Race(LastSeenBy(Myself),NO_RACE)
OR(2)
Global("tempBUFFon","LOCALS",1)
See(LastSeenBy(Myself))
!GlobalTimerNotExpired("P1ProtectionEvilCastLock","GLOBAL")
THEN
RESPONSE #100
SetGlobalTimer("P1ProtectionEvilCastLock","GLOBAL",6)
SetInterrupt(FALSE)
SetGlobalTimer("SCAST","LOCALS",6)
Spell(Player1,CLERIC_PROTECT_FROM_EVIL)
DisplayStringHead(Myself,12023) //Protection From Evil
SetInterrupt(TRUE)
END
0