Jump to content

Original class flag


Salk

Recommended Posts

Hello!

 

I'd like to detect via script the original class flag for dual class characters.

 

My script works in fact correctly only for single and multiclasses but would work if I could detect the dual class flag.

 

I noticed these flags can be set from NI but I must detect them in my script.

 

Is it possible?

 

Thanks!

Link to comment

Actually, we would need to know what the purpose of the whole thing is to give acquitted advice ... my suspicions go around the find familiar spell and it's class-to-level-tie-in, but how, I got no clue. Cause you can't summon a familiar while the chars mage-class is not active... well except from inventory and that gives the familiar item which can store the level factor...

Link to comment

This is my code:

 

IF
Global("MAGEIN1","LOCALS",0)
OR(2)
  Class(Player1,MAGE)
  Class(Player1,MAGE_THIEF)
!OriginalClass(Player1,FIGHTER)
!OriginalClass(Player1,CLERIC)
!OriginalClass(Player1,DRUID)
!OriginalClass(Player1,RANGER)
THEN
    RESPONSE #100
SetGlobal("MAGEIN1","LOCALS",1)
SetGlobal("MAGECLASS","LOCALS",1)
END


IF
Global("MAGEIN2","LOCALS",0)
Class(Player1,MAGE)
OR(4)
  OriginalClass(Player1,FIGHTER)
  OriginalClass(Player1,CLERIC)
  OriginalClass(Player1,DRUID)
  OriginalClass(Player1,RANGER)
THEN
    RESPONSE #100
SetGlobal("MAGEIN2","LOCALS",1)
SetGlobal("MAGECLASS","LOCALS",2)
END


IF
Global("MAGEIN2","LOCALS",0)
OR(4)
  Class(Player1,FIGHTER_MAGE)
  Class(Player1,CLERIC_MAGE)
  Class(Player1,FIGHTER_MAGE_THIEF)
  Class(Player1,FIGHTER_MAGE_CLERIC)
THEN
    RESPONSE #100
SetGlobal("MAGEIN2","LOCALS",1)
SetGlobal("MAGECLASS","LOCALS",2)
END

The Familiar is summoned by either a single class Mage, a multiclass Mage or a dual class Mage.

 

To level up the Familiar I must either check the LEVEL or LEVEL2 number depending on the class.

When MAGECLASS is set to 1, I check LEVEL. When MAGECLASS is set to 2, I check LEVEL2.

Preliminary testing has been successful but if you find a logic hole or any other problem please let me know although I hope it's not the case.

Link to comment

IF

Global("MAGEIN2","LOCALS",0)

Class(Player1,MAGE)

OR(4)

OriginalClass(Player1,FIGHTER)

OriginalClass(Player1,CLERIC)

OriginalClass(Player1,DRUID)

OriginalClass(Player1,RANGER)

THEN

RESPONSE #100

SetGlobal("MAGEIN2","LOCALS",1)

SetGlobal("MAGECLASS","LOCALS",2)

END

The game has no duals with mages to or from: druids or rangers... :D So you don't have to check for the two. Because the game will crash if the players try to force them...
Link to comment

I think this works, and is a bit simpler/more efficient:

 

IF
      Global("MAGECLASS","LOCALS",0)
      Class(Player1,MAGE_ALL)
THEN
     RESPONSE #100
         SetGlobal("MAGECLASS","LOCALS",1)
         Continue()
END

IF
      Global("MAGECLASS","LOCALS",0)
      Class(Player1,MAGE_ALL)
      !OriginalClass(Player1,MAGE)
      !OriginalClass(Player1,THIEF)
      !Class(Player1,MAGE_THIEF)
THEN
      RESPONSE #100
         SetGlobal("MAGECLASS","LOCALS",2)
END    
Link to comment

Hello DavidW and thanks for the assist.

 

A couple of questions, though.... well one:

 

 

I think this works, and is a bit simpler/more efficient:

IF
      Global("MAGECLASS","LOCALS",0)
      Class(Player1,MAGE_ALL)
THEN
     RESPONSE #100
         SetGlobal("MAGECLASS","LOCALS",1)
         Continue()
END

IF
      Global("MAGECLASS","LOCALS",0) 
      Class(Player1,MAGE_ALL)        
      !OriginalClass(Player1,MAGE)
      !OriginalClass(Player1,THIEF)
      !Class(Player1,MAGE_THIEF)
THEN
      RESPONSE #100
         SetGlobal("MAGECLASS","LOCALS",2)
END    

 

When does the second block ever come true if any kind of mage sets "MAGECLASS" to 1?

 

Wouldn't this work?

 

IF
Global("MAGECLASS","LOCALS",0)
Class(Player1,MAGE_ALL)
THEN
RESPONSE #100
SetGlobal("MAGECLASS","LOCALS",1)
END


IF
Global("MAGECLASS","LOCALS",1)
OR(6) 
  Class(Player1,CLERIC_MAGE)  // the first 4 ORs should cover multiclasses and dual classes M->F and M->C 
  Class(Player1,FIGHTER_MAGE)
  Class(Player1,FIGHTER_MAGE_THIEF)
  Class(Player1,FIGHTER_MAGE_CLERIC)
  OriginalClass(Player1,FIGHTER) // this covers dual class F->M
  OriginalClass(Player1,CLERIC) // this covers dual class C->M
THEN
RESPONSE #100
SetGlobal("MAGECLASS","LOCALS",2)
END 

 

Link to comment

Variables only update at the end of each scripting round (at least, unless I've completely forgotten how the game works in the last year, which isn't imposssible. So the Continue() in the first block means that the second is encountered before MAGECLASS gets set to anything other than 1. (Obviously, test it, in case I'm confused or misremembering.)

 

The problem with your suggested fix is that if Player1 is (say) a single-classed mage, the first block will set MAGECLASS to 1 and the second will have to be checked every script round. That's not a disaster but too many blocks like that can lead to performance problems.

Link to comment

reverse their order (and continue) or check for 1.

So all you are saying is to set the first proportion up like this:

IF
Class(Player1,MAGE_ALL)
Global("MAGECLASS","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("MAGECLASS","LOCALS",1)
Continue()
END 
Link to comment

no, that's practically identical. David is right about trigger execution order there. They're all evaluated before actions are run. Not really intuitive, but that's the way it is, one just doesn't hit it without using continue.

Link to comment

Archived

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

×
×
  • Create New...