Jump to content

Scripting Help


Caedwyr

Recommended Posts

Currently I use the following code to apply my kit to Player1 via an item they can CLUAConsole. This is mostly for Tutu/BGT users who want the kit early.

 

//Apply geomancer kit and penalties

IF

Class(Player1,19)

CheckStatGT(Player1,12,WIS)

CheckStatGT(Player1,8,CHR)

!Alignment(Player1,LAWFUL_GOOD)

!Alignment(Player1,LAWFUL_EVIL)

!Alignment(Player1,CHAOTIC_GOOD)

!Alignment(Player1,CHAOTIC_EVIL)

THEN

RESPONSE #100

ActionOverride(Player1,AddKit(CA#DSORC))

ApplySpellRES("CA#STLOS",Player1)

DestroySelf()

END

 

IF

True()

THEN

RESPONSE #100

DisplayStringHead(Player1,@10)

DestroySelf()

END

 

The request has been made to let the item apply the kit to any valid NPC as well.

 

So, would the following be correct if I want to apply it to the clicker of the item so long as their stats and alignment is correct?

 

//Apply geomancer kit and penalties
IF
CheckStatGT(LastTrigger,12,WIS)
CheckStatGT(LastTrigger,8,CHR)
!Alignment(LastTrigger,LAWFUL_GOOD)
!Alignment(LastTrigger,LAWFUL_EVIL)
!Alignment(LastTrigger,CHAOTIC_GOOD)
!Alignment(LastTrigger,CHAOTIC_EVIL)
THEN
RESPONSE #100
 ActionOverride(LastTrigger,AddKit(CA#DSORC))
 ApplySpellRES("CA#STLOS",LastTrigger)
 DestroySelf()
END

IF
 True()
THEN
 RESPONSE #100
DisplayStringHead(LastTrigger,@10)
DestroySelf()
END

Link to comment

I doubt LastTrigger fires for using items (and you have to be careful since there are global events that set LastTrigger for everything).

 

You might get away with using LastSummonerOf (depending how the creature is summoned), although I would seriously consider giving the creature dialogue and just letting the player pick Player1-Player6.

Link to comment

Archived

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

×
×
  • Create New...