adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
hello, is it possible to add time to this scripts on line 26 gives a storage to the monster, can it be given for a time of 20 seconds and remove it so that the same mechanics can be done again?
me use otbr tfs 1.3
It should go back to the initial storage which I think would be the one in this script
me use otbr tfs 1.3
Lua:
local config = {
["Blue Soul Stealer"] = {id = 37249, effect = CONST_ME_ICEATTACK, type = COMBAT_ICEDAMAGE},
["Green Soul Stealer"] = {id = 37250, effect = CONST_ME_PLANTATTACK, type = COMBAT_EARTHDAMAGE},
["Red Soul Stealer"] = {id = 37251, effect = CONST_ME_FIREAREA, type = COMBAT_FIREDAMAGE},
}
local area = createCombatArea(AREA_CIRCLE2X2)
local monsters = {"Red Soul Stealer", "Green Soul Stealer", "Blue Soul Stealer"}
local soulVortex = MoveEvent()
function soulVortex.onStepIn(creature, item, position, fromPosition)
if creature:isPlayer() or creature:getMaster() then
return true
end
local name = creature:getName()
if not isInArray(monsters, name) then
return true
end
local data = config[name]
position:sendMagicEffect(CONST_ME_MORTAREA)
local maiden = Creature("The Dread Maiden")
if not maiden then
return true
end
if data.id == item:getId() then
local oldStorage = maiden:getStorageValue(Storage.Quest.FeasterOfSouls.Bosses.TheDreadMaiden.Souls)
maiden:setStorageValue(Storage.Quest.FeasterOfSouls.Bosses.TheDreadMaiden.Souls, oldStorage + 1)
else
if math.random(2) == 2 then
doAreaCombatHealth(creature, data.type, creature:getPosition(), area, -750, -1250, data.effect)
else
doTargetCombatHealth(0, maiden, COMBAT_HEALING, 3500, 5500, CONST_ME_NONE)
end
end
creature:remove()
return true
end
soulVortex:type("stepin")
for index, value in pairs(config) do
soulVortex:id(value.id)
end
soulVortex:register()
It should go back to the initial storage which I think would be the one in this script
Lua:
local theDreadMaidenHealth = CreatureEvent("theDreadMaidenHealth")
function theDreadMaidenHealth.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if primaryType == COMBAT_DEATHDAMAGE or secondaryType == COMBAT_DEATHDAMAGE then
primaryType = COMBAT_HEALING
primaryDamage = (primaryDamage + secondaryDamage)
secondaryType = COMBAT_NONE
secondaryDamage = 0
end
if primaryType ~= COMBAT_HEALING then
local storage = creature:getStorageValue(Storage.Quest.FeasterOfSouls.Bosses.TheDreadMaiden.Souls)
local percentage = (storage + 1) * 3
primaryDamage = primaryDamage * (math.min(150, percentage) / 100)
secondaryDamage = secondaryDamage * (math.min(150, percentage) / 100)
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
theDreadMaidenHealth:register()