Jump to content

Help with scripting - am I doing this right?


subtledoctor

Recommended Posts

Posted

I want a script that checks the current class and kit of a character (using the ol' invisible monster trick) and changes the kit accordingly. Essentially this is for dual-class characters; if you dual from a Berserker to cleric, I want the script to detect that and shift you into my new copy of the Berserker kit.

 

Is this right?

 

 

 

IF
    Class(LastSummonerOf(Myself),FIGHTER_CLERIC)
    Kit(LastSummonerOf(Myself),BERSERKER)
THEN
    RESPONSE #100
    ActionOverride(LastSummonerOf(Myself),AddKit(D5BERSK))
    DestroySelf()
END

IF
    Class(LastSummonerOf(Myself),FIGHTER_CLERIC)
    Kit(LastSummonerOf(Myself),WIZARDSLAYER)
THEN
    RESPONSE #100
    ActionOverride(LastSummonerOf(Myself),AddKit(D5WIZSL))
    DestroySelf()
END

IF
    Class(LastSummonerOf(Myself),FIGHTER_CLERIC)
    Kit(LastSummonerOf(Myself),KENSAI)
THEN
    RESPONSE #100
    ActionOverride(LastSummonerOf(Myself),AddKit(D5KENSA))
    DestroySelf()
END

IF
    Class(LastSummonerOf(Myself),FIGHTER_CLERIC)
    Kit(LastSummonerOf(Myself),TRUECLASS)
THEN
    RESPONSE #100
    ActionOverride(LastSummonerOf(Myself),AddKit(D5FIGHT))
    DestroySelf()
END

IF
    Kit(LastSummonerOf(Myself),D5FIGHT)
    OR
    Kit(LastSummonerOf(Myself),D5BERSK)
    OR
    Kit(LastSummonerOf(Myself),D5WIZSL)
    OR
    Kit(LastSummonerOf(Myself),D5KENSA)
THEN
    RESPONSE #100
    DestroySelf()
END

 

 

 

thx all.

Posted

This:

 

IF
Kit(LastSummonerOf(Myself),D5FIGHT)
OR
Kit(LastSummonerOf(Myself),D5BERSK)
OR
Kit(LastSummonerOf(Myself),D5WIZSL)
OR
Kit(LastSummonerOf(Myself),D5KENSA)
THEN
RESPONSE #100
DestroySelf()
END

Is not right, it should be:

IF
OR(4)
    Kit(LastSummonerOf(Myself),D5FIGHT)
    Kit(LastSummonerOf(Myself),D5BERSK)
    Kit(LastSummonerOf(Myself),D5WIZSL)
    Kit(LastSummonerOf(Myself),D5KENSA)
THEN
    RESPONSE #100
    DestroySelf()
END
Posted

I don' why this isn't working, i'm trying to get a certain spell to activate depending on whether or not you have 15 dexterity, whenever you equip a certain weapon. Here is the script I wrote.

If
CheckStat(Protagonist,15,Dex)
Then
RESPONSE #100
ApplySpell(Protagonist,DexThac0)
END
DexThac0 is the name of the spell, and the script editor in dltcep keeps saying something like non-existent IDS used.
Or line #5 is not a valid String.
Posted

If it is a resource name then: ApplySpellRES(Protagonist,"DexThac0")

Otherwise it must be listed in SPELL.IDS and have a numerical name like SPIN123

Posted

If the spell is already in SPELL.IDS, you can call it by either it's name or number

 

ApplySpell(Player1,1203)

-or-

ApplySpell(Player1,CLERIC_CHANT)

 

If it's not in the IDS, you'd use one of the "RES" actions

 

ApplySpellRES("MySpl01",Player1)

 

where MySpl01 is the name of the actual file.

 

======

 

Also, the various spellcasting scripting actions have different requirements. Some need the caster to know the spell, some don't. Some need the caster to be at the minimum level to cast, some don't. Etc.

Archived

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

×
×
  • Create New...