Jump to content

Multi-Level Menu Script help please


Mechaheart

Recommended Posts

Hi, I am trying to create a script where I can add as many doomstones as I want, and then optionally remove them as well. I made a script which worked but only removed them in alphabetical order. Now I am trying to create a menu to specifically remove any stone from any other stone.

 

This is what I have so far:

 

 

BOOL DOONCE=TRUE

Auto 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
menu()
ENDIF

ENDEVENT
Endstate


FUNCTION menu(Bool abMenu = True, Int aiButton = 0, Int aiMessage = 0) ; Menu will exit after selection
WHILE abMenu
IF aiButton != -1 ; Wait for input
aiButton = StoneRemovalQuestion.Show() ; Add or remove
IF aiButton == 0 ; Add stone


; //if we already have the power and this is the stone then kick the player out
IF(bApprentice && game.getPlayer().hasSpell(pDoomApprenticeAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bAtronach && game.getPlayer().hasSpell(pDoomAtronachAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bLady && game.getPlayer().hasSpell(pDoomLadyAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bLord && game.getPlayer().hasSpell(pDoomLordAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bLover && game.getPlayer().hasSpell(pDoomLoverAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bMage && game.getPlayer().hasSpell(pDoomMageAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bRitual && game.getPlayer().hasSpell(pDoomRitualAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bSerpent && game.getPlayer().hasSpell(pDoomSerpentAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bShadow && game.getPlayer().hasSpell(pDoomShadowAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bSteed && game.getPlayer().hasSpell(pDoomSteedAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bThief && game.getPlayer().hasSpell(pDoomThiefAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bTower && game.getPlayer().hasSpell(pDoomTowerAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomWarriorAbility))
pDoomAlreadyHaveMSG.show()
utility.wait(2)
doOnce = TRUE
ELSE

; // present them with the choice
IF(showSign() == 0)
addSign()
abMenu = False

SELF.playAnimation("playanim01")

utility.wait(15)

doOnce = TRUE
ELSE
utility.wait(2)
doOnce = TRUE
abMenu = False
ENDIF

ENDIF
ELSEIF aiButton == 1 ; Remove a blessing
aiMessage = 1
utility.wait(2)

ELSEIF aiMessage == 1
aiButton = StoneRemovalQuestion01.Show() ; A-R or S-Z

IF aiButton == 0 ; A-R
aiMessage = 2

utility.wait(2)

ELSEIF aiMessage == 2
aiButton = StoneRemovalQuestion02.Show() ; Which stone?
IF aiButton == 0
IF(game.getPlayer().hasSpell(pDoomApprenticeAbility))
game.getPlayer().removeSpell(pDoomApprenticeAbility)
game.getPlayer().removeSpell(pdoomApprenticeNegativeAbility)
pDoomApprenticeRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 1
IF(game.getPlayer().hasSpell(pDoomAtronachAbility))
game.getPlayer().removeSpell(pDoomAtronachAbility)
pDoomAtronachRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 2
IF(game.getPlayer().hasSpell(pDoomLadyAbility))
game.getPlayer().removeSpell(pDoomLadyAbility)
pDoomLadyRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 3
IF(game.getPlayer().hasSpell(pDoomLordAbility))
game.getPlayer().removeSpell(pDoomLordAbility)
pDoomLordRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 4
IF(game.getPlayer().hasSpell(pDoomLoverAbility))
game.getPlayer().removeSpell(pDoomLoverAbility)
pDoomLoverRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 5
IF(game.getPlayer().hasSpell(pDoomMageAbility))
game.getPlayer().removeSpell(pDoomMageAbility)
pDoomMageRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 6
IF(game.getPlayer().hasSpell(pDoomRitualAbility))
game.getPlayer().removeSpell(pDoomRitualAbility)
pDoomRitualRemovedMSG.show()
abMenu = False
ENDIF
ENDIF

ELSEIF aiButton == 1 ; S-Z
aiMessage = 3
utility.wait(2)

ELSEIF aiMessage == 3
aiButton = StoneRemovalQuestion03.Show()
ELSEIF aiButton == 0
IF(game.getPlayer().hasSpell(pDoomSerpentAbility))
game.getPlayer().removeSpell(pDoomSerpentAbility)
pDoomSerpentRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 1
IF(game.getPlayer().hasSpell(pDoomShadowAbility))
game.getPlayer().removeSpell(pDoomShadowAbility)
pDoomShadowRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 2
IF(game.getPlayer().hasSpell(pDoomSteedAbility))
game.getPlayer().removeSpell(pDoomSteedAbility)
pDoomSteedRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 3
IF(game.getPlayer().hasSpell(pDoomThiefAbility))
game.getPlayer().removeSpell(pDoomThiefAbility)
pDoomThiefRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 4
IF(game.getPlayer().hasSpell(pDoomTowerAbility))
game.getPlayer().removeSpell(pDoomTowerAbility)
pDoomTowerRemovedMSG.show()
abMenu = False
ENDIF
ELSEIF aiButton == 2
IF(game.getPlayer().hasSpell(pDoomWarriorAbility))
game.getPlayer().removeSpell(pDoomWarriorAbility)
pDoomWarriorRemovedMSG.show()
abMenu = False
ENDIF
ENDIF
ENDIF
doOnce = TRUE
ENDIF
ENDWHILE
endFUNCTION

 

 

It's getting confusing for me, considering I have only really tried scripting a few times.

 

Any help would be appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...