Jump to content

Help making a script


Guest Slaadi

Recommended Posts

Guest Slaadi
Posted

In Icewind Dale (+HoW & TotL) I made a script but don't work well. The script is:

 

IF
 See(NearestEnemyOf(Myself))
 Global("Spell1","LOCALS",0)
THEN
 RESPONSE #100
ForceSpell(Myself,WIZARD_SHIELD)
SetGlobal("Spell1","LOCALS",1)
SetGlobalTimer("Recast","LOCALS",28)
Continue()
END

IF
 See(NearestEnemyOf(Myself))
 GlobalTimerExpired("Recast","LOCALS")
 Global("Spell2","LOCALS",0)
THEN
 RESPONSE #100
 ForceSpell(LastSeenBy(Myself),WIZARD_HORROR)
 SetGlobal("Spell2","LOCALS",1)
 Continue()
END

 

Instead, the creature cast shield on self, but inmediatelly cast horror on the PC. In Baldur's Gate II this script work fine, the problem I think is "timer expired".

 

How can I fix this? I am looking to the script for the bombardier beetle:

 

IF
 Internal(Myself,4,2)
THEN
 RESPONSE #100
ChangeCurrentScript("")
END

IF
 !TimerActive(4)
 See(NearestEnemyOf(Myself))
 Range(NearestEnemyOf(Myself),7)
 !CreatureHidden(Myself)
THEN
 RESPONSE #100
IncrementInternal(Myself,4,1)
StartTimer(4,21)
ReallyForceSpell(Myself,INNATE_BOMBARDIER_BEETLE_CLOUD)
Wait(2)
END

 

Any ideas for the same effect of my script? (cast shield, 4 rounds later cast horror)

 

-----------------

 

The other question is about the codes for the innate spells. For example, I cant' find the code (SPIN) for the "innate_bombardier_beetle_cloud", "trap_arrow", "trap_disease_darts" and so on. Any help is welcome.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...