adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
Does anyone know why I get this error with this spell on my console?
My storages are fine
i used otbr tfs 1.3
ERROR
spell.lua
My storages are fine
i used otbr tfs 1.3
Code:
GlobalStorage = {
DangerousDepths = {
-- Reserved storage from 60001 - 60009
Geodes = {
WarzoneVI = 60001,
WarzoneV = 60002,
WarzoneIV = 60003
}
},
DreamScar = {
maxxeniusTimer = 531902,
alptramunTimer = 531903,
plaguerootTimer = 531904,
izcandarTimer = 531905,
malofurTimer = 531906,
alptramunSummonsKilled = 531907,
izcandarOutfit = 531908,
nightmareTimer = 531909,
lastBossCurse = 531910,
},
ERROR
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/monster/alptramun_summon.lua:onCastSpell
data/spells/scripts/monster/alptramun_summon.lua:22: attempt to index field 'DreamCourts' (a nil value)
stack traceback:
[C]: in function '__index'
data/spells/scripts/monster/alptramun_summon.lua:22: in function <data/spells/scripts/monster/alptramun_summon.lua:17>
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_PURPLE)
local area = createCombatArea(AREA_CIRCLE2X2)
combat:setArea(area)
local config = {
[1] = {name = "unpleasant dream"},
[2] = {name = "horrible dream"},
[3] = {name = "nightmarish dream"},
[4] = {name = "mind-wrecking dream"}
}
local maxsummons = 5
function onCastSpell(creature, var)
local monsterName = ""
local randomName = math.random(1, #config)
local randomSummon = math.random(1, 4)
local summonsKilled = Game.getStorageValue(GlobalStorage.DreamScar.alptramunSummonsKilled) or -1
if summonsKilled >= 0 and summonsKilled <= 9 then
monsterName = config[1].name
elseif summonsKilled > 9 and summonsKilled <= 18 then
monsterName = config[2].name
elseif summonsKilled > 18 and summonsKilled <= 27 then
monsterName = config[3].name
elseif summonsKilled > 27 and summonsKilled <= 36 then
monsterName = config[4].name
else
monsterName = config[randomName].name
end
local summoncount = creature:getSummons()
if #summoncount < maxsummons then
for i = 1, randomSummon do
local mid = Game.createMonster(monsterName, creature:getPosition())
if not mid then
return
end
mid:setMaster(creature)
mid:registerEvent("dreamCourtsDeath")
end
end
return combat:execute(creature, var)
end
Last edited: