Spoiler
scriptName doomTKGuardianShrineScript extends ObjectReferenceimport gameimport utilityString property graphVariable auto; //which stone are weBOOL PROPERTY bMage AUTOBOOL PROPERTY bThief AUTOBOOL PROPERTY bWarrior AUTO; //list of the effectsSPELL PROPERTY pDoomMageAbility AUTOSPELL PROPERTY pDoomThiefAbility AUTOSPELL PROPERTY pDoomWarriorAbility AUTOSPELL PROPERTY pDoomMageAbility2 AUTOSPELL PROPERTY pDoomThiefAbility2 AUTOSPELL PROPERTY pDoomWarriorAbility2 AUTOSPELL PROPERTY pDoomMageAbility3 AUTOSPELL PROPERTY pDoomThiefAbility3 AUTOSPELL PROPERTY pDoomWarriorAbility3 AUTO; //list of the messagesMESSAGE PROPERTY pDoomMageMSG AUTOMESSAGE PROPERTY pDoomThiefMSG AUTOMESSAGE PROPERTY pDoomWarriorMSG AUTOMESSAGE PROPERTY pDoomCannotTakeGuardianMSG AUTO; //the already have messageMESSAGE PROPERTY pDoomAlreadyHaveMSG AUTO;************************************BOOL DOONCE=TRUEAuto State base EVENT onACTIVATE(OBJECTREFERENCE obj) ; //check to see if the player is the activator and we havent already activated IF(doOnce && obj AS ACTOR == game.getPlayer()) doOnce = FALSE ; //if we already have the power and this is the stone then kick the player out ; //if the player's stone selection is not a Charge of their guardian, kick him out ; //if the player has already selected a Guardian and tries to take another, kick him out ; //finally, disallow player interaction altogether if he has taken the Serpent IF(bMage && game.getPlayer().hasSpell(pDoomMageAbility)) pDoomAlreadyHaveMSG.show() utility.wait(2) doOnce = TRUE ELSEIF(bThief && game.getPlayer().hasSpell(pDoomThiefAbility)) pDoomAlreadyHaveMSG.show() utility.wait(2) doOnce = TRUE ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomWarriorAbility)) pDoomAlreadyHaveMSG.show() utility.wait(2) doOnce = TRUE ELSEIF(bMage && (game.getPlayer().hasSpell(pDoomThiefAbility) || game.getPlayer().hasSpell(pDoomWarriorAbility))) pDoomCannotTakeGuardianMSG.Show() utility.wait(2) doOnce = TRUE ELSEIF(bThief && (game.getPlayer().hasSpell(pDoomMageAbility) || game.getPlayer().hasSpell(pDoomWarriorAbility))) pDoomCannotTakeGuardianMSG.Show() utility.wait(2) doOnce = TRUE ELSEIF(bWarrior && (game.getPlayer().hasSpell(pDoomMageAbility) || game.getPlayer().hasSpell(pDoomThiefAbility))) pDoomCannotTakeGuardianMSG.Show() utility.wait(2) doOnce = TRUE ELSE ; // present them with the choice ; // Items 1, 2, 3 == Accept, Item 4 == Decline IF(showSign() == 0) addSign1() SELF.playAnimation("playanim01") utility.wait(15) doOnce = TRUE ELSEIF(showSign() == 1) addSign2() SELF.playAnimation("playanim01") utility.wait(15) doOnce = TRUE ELSEIF(showSign() == 2) addSign3() SELF.playAnimation("playanim01") utility.wait(15) doOnce = TRUE ELSE utility.wait(2) doOnce = TRUE ENDIF ENDIF ENDIF endEVENT endState; // Shows the sign confirmation message dialogue.int FUNCTION showSign() int signHolder IF(bMage) signHolder = pDoomMageMSG.show() ELSEIF(bThief) signHolder = pDoomThiefMSG.show() ELSEIF(bWarrior) signHolder = pDoomWarriorMSG.show() ENDIF RETURN signHolder endFUNCTION; //FUNCTION: addSign; //; // adds the sign of the stone to the playerFUNCTION addSign1() game.AddAchievement(29) ; // Standard signs IF(bMage) game.getPlayer().addSpell(pDoomMageAbility) ELSEIF(bThief) game.getPlayer().addSpell(pDoomThiefAbility) ELSEIF(bWarrior) game.getPlayer().addSpell(pDoomWarriorAbility) ENDIF endFUNCTION FUNCTION addSign2() game.AddAchievement(29) ; // Standard signs IF(bMage) game.getPlayer().addSpell(pDoomMageAbility2) ELSEIF(bThief) game.getPlayer().addSpell(pDoomThiefAbility2) ELSEIF(bWarrior) game.getPlayer().addSpell(pDoomWarriorAbility2) ENDIF endFUNCTION FUNCTION addSign3() game.AddAchievement(29) ; // Standard signs IF(bMage) game.getPlayer().addSpell(pDoomMageAbility3) ELSEIF(bThief) game.getPlayer().addSpell(pDoomThiefAbility3) ELSEIF(bWarrior) game.getPlayer().addSpell(pDoomWarriorAbility3) ENDIF endFUNCTION;************************************State waiting ;do nothingendState;************************************