ScriptName EZQuestScript
short controlvar
float fQuestDelayTime
ref apparatus
short apparatusC
ref armor
short armorC
ref clothing
short clothingC
ref ingredient
short ingredientC
ref misc
short miscC
ref flora
short floraC
ref weapon
short weaponC
ref ammo
short ammoC
ref soulgem
short soulgemC
ref key
short keyC
ref alchemyitem
short alchemyitemC
ref sigilstone
short sigilstoneC
ref actor
short actorC
array_var actors
short index
short button
short controlvarC
Begin GameMode
if controlvar == -2
set button to getButtonPressed
set fQuestDelayTime to 0.001
if controlvarC == 0
MessageBox "Sollen Apparate (Alchemie) eingesammelt werden?" "Nein" "Alle" "mindestens Lehrling" "mindestens Geselle" "mindestens Experte" "nur Meister"
set apparatusC to getButtonPressed
set controlvarC to 1
elseif controlvarC == 1
MessageBox "Sollen Rüstungen eingesammelt werden?" "Nein" "Alle" "nur magische" "ab 100 Wert" "ab Wert mindestens 10x Gewicht" "Gewicht maximal 20"
set armorC to getButtonPressed
set controlvarC to 2
elseif controlvarC == 2
MessageBox "Soll Kleidung eingesammelt werden?" "Nein" "Alle" "nur magische"
set clothingC to getButtonPressed
set controlvarC to 3
elseif controlvarC == 3
MessageBox "Sollen Zutaten (nicht die von Pflanzen!) eingesammelt werden?" "Nein" "Alle"
set ingredientC to getButtonPressed
set controlvarC to 4
elseif controlvarC == 4
MessageBox "Soll Sonstiges eingesammelt werden?" "Nein" "Alle" "nur mit Funktion" "ab 10 Wert" "ab Wert mindestens gleich Gewicht"
set miscC to getButtonPressed
set controlvarC to 5
elseif controlvarC == 5
MessageBox "Sollen Pflanzen abgeerntet werden?" "Nein" "Alle"
set floraC to getButtonPressed
set controlvarC to 6
elseif controlvarC == 6
MessageBox "Sollen Waffen eingesammelt werden?" "Nein" "Alle" "nur magische" "ab 100 Wert" "ab Wert mindestens 10x Gewicht" "Gewicht maximal 20"
set weapon to getButtonPressed
set controlvarC to 7
elseif controlvarC == 7
MessageBox "Sollen Pfeile eingesammelt werden?" "Nein" "Alle" "nur magische"
set ammoC to getButtonPressed
set controlvarC to 8
elseif controlvarC == 8
MessageBox "Sollen Seelensteine eingesammelt werden?" "Nein" "Alle" "mindestens Klein (300)" "mindestens Allgemein (600)" "mindestens Größer (1200)" "nur Groß (1600)"
set soulgemC to getButtonPressed
set controlvarC to 9
elseif controlvarC == 9
MessageBox "Sollen Schlüssel eingesammelt werden?" "Nein" "Alle"
set keyC to getButtonPressed
set controlvarC to 10
elseif controlvar == 10
MessageBox "Sollen Tränke (und Gifte) eingesammel werden?" "Nein" "Alle" "Ab 100 Wert"
set alchemyitemC to getButtonPressed
set controlvarC to 11
elseif controlvarC == 11
MessageBox "Sollen Siegelsteine eingesammel werden? (gilt nicht, solange sie noch im Turm verankert sind)" "Nein" "Alle"
set sigilstoneC to getButtonPressed
set controlvar to 12
elseif controlvar == 12
MessageBox "Sollen Leichen ausgeraubt werden?" "Nein [vermeidet Abstürze]" "Alle" "nur Personen" "nur Kreaturen"
set actorC to getButtonPressed
set controlvar to 13
elseif controlvar == 13
set controlvar to -1
set controlvarC to 0
set fQuestDelayTime to 1
endif
elseif controlvar == 0
set fQuestDelayTime to 1
player.addspell EZZauber
player.additem EZControlItem 1
set controlvar to -1
elseif controlvar == 1
set apparatus to getfirstref 19 1
while apparatus
if apparatus.isOffLimits 7 == 0 && (apparatusC == 1 || (apparatus != 0 && apparatus.getQuality == 1.0) || (apparatusC == 2 && apparatus.getQuality == .25 ) || ((apparatusC == 2 || apparatusC == 3) && apparatus.getQuality == .50) || ((apparatusC == 2 || apparatusC == 3 || apparatusC == 4) && apparatus.getQuality == .75))
apparatus.activate player, 1
endif
set apparatus to getnextref
loop
set controlvar to 2
elseif controlvar == 2
set armor to getfirstref 20 1
while armor
if armor.isOffLimits 7 == 0 && (armorC == 1 || (armorC == 2 && armor.getEnchantment != 0) || (armorC == 3 && armor.getGoldValue >= 100) || (armorC ==4 && (armor.getGoldValue >= 5 * armor.getWeight)) || (armorC == 5 && armor.getWeight <= 20))
armor.activate player, 1
endif
set armor to getnextref
loop
set controlvar to 3
elseif controlvar == 3
set clothing to getfirstref 22 1
while clothing
if clothing.isOffLimits 7 == 0 && (clothingC == 1 || (clothingC == 2 && clothing.getEnchantment != 0))
clothing.activate player, 1
endif
set clothing to getnextref
loop
set controlvar to 4
elseif controlvar == 4
set ingredient to getfirstref 25 1
while ingredient
if ingredient.isOffLimits 7 == 0 && ingredientC == 1
ingredient.activate player, 1
endif
set ingredient to getnextref
loop
set controlvar to 5
elseif controlvar == 5
set misc to getfirstref 27 1
while misc
if misc.isOffLimits 7 == 0 && (miscC == 1 || (miscC == 2 && (misc.getBaseObject == Lockpick || misc.getBaseObject == Gold001 || misc.getBaseObject == RepairHammer || misc.getBaseObject ==VarlaStone || misc.getBaseObject == WelkyndStone)) || (miscC == 3 && misc.getGoldValue >= 10) || (miscC == 4 && (misc.getGoldValue >= misc.getWeight)))
misc.activate player, 1
endif
set misc to getnextref
loop
set controlvar to 6
elseif controlvar == 6
set flora to getfirstref 31 1
while flora
if flora.isOffLimits 7 == 0 && floraC == 1
flora.activate player, 1
endif
set flora to getnextref
loop
set controlvar to 7
elseif controlvar == 7
set weapon to getfirstref 33 1
while weapon
if weapon.isOffLimits 7 == 0 && (weaponC == 1 || (weaponC == 2 && weapon.getEnchantment != 0) || (weaponC == 3 && weapon.getGoldValue >= 100) || (weaponC ==4 && (weapon.getGoldValue >= 5 * weapon.getWeight)) || (weaponC == 5 && weapon.getWeight <= 20))
weapon.activate player, 1
endif
set weapon to getnextref
loop
set controlvar to 8
elseif controlvar == 8
set ammo to getfirstref 34 1
while ammo
if ammo.isOffLimits 7 == 0 && (ammoC == 1 || (ammoC == 2 && ammo.getEnchantment != 0))
ammo.activate player, 1
endif
set ammo to getnextref
loop
set controlvar to 9
elseif controlvar == 9
set soulgem to getfirstref 38 1
while soulgem
if soulgem.isOffLimits 7 == 0 && (soulgemC <= soulgem.getSoulGemCapacity)
soulgem.activate player, 1
endif
set soulgem to getnextref
loop
set controlvar to 10
elseif controlvar == 10
set key to getfirstref 39 1
while key
if key.isOffLimits 7 == 0 && keyC == 1
key.activate player, 1
endif
set key to getnextref
loop
set controlvar to 11
elseif controlvar == 11
set alchemyitem to getfirstref 40 1
while alchemyitem
if alchemyitem.isOffLimits 7 == 0 && (alchemyitemC == 1 || (alchemyitemC == 2 && alchemyitem.getGoldValue >= 100))
alchemyitem.activate player, 1
endif
set alchemyitem to getnextref
loop
set controlvar to 12
elseif controlvar == 12
set sigilstone to getfirstref 42 1
while sigilstone
if sigilstone.isOffLimits 7 == 0 && sigilstoneC == 1
sigilstone.activate player, 1
endif
set sigilstone to getnextref
loop
set controlvar to 13
elseif controlvar == 13
let actors := ar_construct map
let actor := getFirstRef 69 1
let index := 1
while actor
if actor.getIsReference player == 0 && actor.getDead && (actorC == 1 || (actorC == 2 && actor.getIsCreature == 0) || (actorC == 3 && actor.getIsCreature == 1))
let actors[index] := actor
let index += 1
endif
set actor to getNextRef
loop
let controlvar := 14
return
elseif controlvar == 14
let actor := actors[index]
let index -= 1
actor.removeAllItems player
if index == 0
let controlvar := 15
endif
endif
End