andypsylon
be be
based on a script from tfs :thumbup:
opportunities:
- default settings like in global Tibia but can be changed!
* allow only one enter per day (yes/no)
* allows more times (yes/no)
* without animation and info (yes/no)
- no executable if someone fight
- removes old monsters before summon new ones
- executable right after the last fighter to come out
- old fighter CAN'T DISTURB, thanks to use of magical door, can't reenter to demons room
- lever exhaustion
- works with every creature which is set, (default- Demon)
- gm test option (yes/no)
- not need to type all position if you have a standard map
- fightTime - coutdown, how long players can fight
- new option: customMobs - Freely selectable monsters
instalation:
in yourots/data/actions/actions.xml add:
in yourots/data/actions/scripts/quests/annihilator_neu.lua
on your map replace door to the magic and add aid on it and 1 out tile
in yourots/data/movements/movements.xml add:
-- annihilator v1.6
- test on tfs v.0.4 -> OK:thumbup:
- test on tfs v.0.3.6 -> OK:thumbup:
have you any wishes?
opportunities:
- default settings like in global Tibia but can be changed!
* allow only one enter per day (yes/no)
* allows more times (yes/no)
* without animation and info (yes/no)
- no executable if someone fight
- removes old monsters before summon new ones
- executable right after the last fighter to come out
- old fighter CAN'T DISTURB, thanks to use of magical door, can't reenter to demons room
- lever exhaustion
- works with every creature which is set, (default- Demon)
- gm test option (yes/no)
- not need to type all position if you have a standard map
- fightTime - coutdown, how long players can fight
- new option: customMobs - Freely selectable monsters
instalation:
in yourots/data/actions/actions.xml add:
lever uniqueid may be the same as anniStor<action uniqueid="11111" event="script" value="quests/annihilator_neu.lua"/>
in yourots/data/actions/scripts/quests/annihilator_neu.lua
Lua:
-- ver. 1.6 2013-07-12
-- author tfs, otland.net/members/andypsylon
local c = {
daily = "yes", -- if 'yes' than like in global Tibia allow only one enter per day
withEffects = "yes", -- if 'no' than like in global Tibia without Effects
onlyOnce = "yes", -- if 'yes' than like in global Tibia allow only once for player
anniStor = 11111, -- if onlyOnce is "yes" you free Storage Nr., may be the same as lever uniqueid!
level = 100, -- player level
tempAid = 22222, -- your free nr - temp storage for magic doors and tile, IMPORTANT !anniStor ~= tempAid! - must be different
mob = "Demon", -- monster name
customMobs = "yes", -- if you will different mobs
normalMap = "yes", -- must "no" if you have custom map, example vertically anni
test = "no", -- here 'yes' if you will test it with 1 player
fightTime = 15, -- min. - coutdown, how long players can fight
exhaustion = 4, -- sek. - exhaustion for lever
exhaustionStor = 33333, -- your Storage Nr. for Exhaustion
entry = {
{x=169, y=247, z=10}, -- 1 player, The first position just behind switch!
{x=168, y=247, z=10},
{x=167, y=247, z=10},
{x=166, y=247, z=10}
},
des = {
{x=178, y=247, z=10}, -- 1 player
{x=177, y=247, z=10},
{x=176, y=247, z=10},
{x=175, y=247, z=10}
},
mobPos = { -- you cann ignore this if you have 'normalMap = "yes"'
{x=175, y=245, z=10},
{x=177, y=245, z=10},
{x=179, y=247, z=10}, -- here position opposite 1
{x=180, y=247, z=10}, -- here position opposite 2
{x=176, y=249, z=10},
{x=178, y=249, z=10}
},
customMobName = { -- you cann ignore this if you have 'customMobs = "no"'
"Rat",
"Rat",
"Cave Rat", -- where position opposite 1
"Cave Rat", -- where position opposite 2
"Rat",
"Rat"
}
}
c.daily = getBooleanFromString(c.daily)
c.withEffects = getBooleanFromString(c.withEffects)
c.onlyOnce = getBooleanFromString(c.onlyOnce)
c.customMobs = getBooleanFromString(c.customMobs)
c.normalMap = getBooleanFromString(c.normalMap)
c.test = getBooleanFromString(c.test)
local anniEvent = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 1946) then
if(not c.daily) or c.test then
doTransformItem(item.uid, 1945)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return true
end
if(item.itemid ~= 1945) then return true end
if(exhaustion.check(cid, c.exhaustionStor)) then return true end
exhaustion.set(cid, c.exhaustionStor, c.exhaustion)
local fighter = {}
fighter = getSpectators(c.des[1], 3, 3)
if fighter ~= nil then
for _, pid in ipairs(fighter) do
if isPlayer(pid) then
if(c.withEffects) then
doCreatureSay(cid, "Halo! Halo!\nWe are still fighting here!", TALKTYPE_MONSTER, nil, cid, c.des[1])
end
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
end
for _, pid in ipairs(fighter) do
if isCreature(pid) then
doRemoveCreature(pid)
end
end
end
if(anniEvent ~= 0) then stopEvent(anniEvent) end
local players = {}
for _, position in ipairs(c.entry) do
local pid = getTopCreature(position).uid
if(pid == 0 or not isPlayer(pid) or getPlayerLevel(pid) < c.level) then
if(c.withEffects) then
doCreatureSay(cid, "Need a player\nwith lvl."..c.level, TALKTYPE_MONSTER, nil)
doSendMagicEffect(position, CONST_ME_TUTORIALARROW)
end
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
elseif(c.onlyOnce and getCreatureStorage(pid, c.anniStor) > 0) then
if(c.withEffects) then
doCreatureSay(cid, "That fighter\ncan't do anni again.", TALKTYPE_MONSTER, nil)
doSendMagicEffect(position, CONST_ME_TUTORIALARROW)
end
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
table.insert(players, pid)
if c.test then break end
end
if normalMap then
local zmienne = {{'-3','-2'}, {'-1','-2'}, {'-2','2'}, {'0','2'}, {'1','0'}, {'2','0'}} -- horizontally
for i, pos in ipairs(zmienne) do
c.mobPos = c.des[1]
c.mobPos.x = c.mobPos.x + tonumber(pos[1])
c.mobPos.y = c.mobPos.y + tonumber(pos[2])
doCreateMonster(c.customMobs and c.customMobName[i] or c.mob, c.mobPos)
end
else
for i, pos in ipairs(c.mobPos) do
doCreateMonster(c.customMobs and c.customMobName[i] or c.mob, pos)
end
end
for i, pid in ipairs(players) do
doSendMagicEffect(c.entry[i], CONST_ME_POFF)
doTeleportThing(pid, c.des[i], false)
doSendMagicEffect(c.des[i], CONST_ME_ENERGYAREA)
doCreatureSetStorage(pid, c.tempAid, 1)
if c.test then break end
end
doTransformItem(item.uid, 1946)
anniEvent = addEvent(function()
for i, pid in ipairs(players) do
if getCreatureStorage(pid, c.tempAid) == 1 then
doCreatureSetStorage(pid, c.tempAid, -1)
doRemoveCondition(pid, CONDITION_INFIGHT)
local pos = getClosestFreeTile(cid, c.entry[i], false, false)
pos.y = pos.y +1
doTeleportThing(pid, pos, false)
doSendMagicEffect(getThingPosition(pid), CONST_ME_TELEPORT)
doCreatureSay(pid, "Time is up!", TALKTYPE_MONSTER)
end
end
doTransformItem(item.uid, 1945)
end, c.fightTime*60*1000)
return true
end
on your map replace door to the magic and add aid on it and 1 out tile
in yourots/data/movements/movements.xml add:
in yourots/data/movements/scripts/quests/annihilator_neu.lua<movevent type="StepIn" actionid="22222" event="script" value="guests/annihilator_neu.lua"/>
Lua:
-- ver. 1.3
-- author tfs, otland.net/members/andypsylon
local c = {
[22222] = "Congratulations!" -- Annihilator
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then return true end
local i = item.actionid
if c[i] and (not isItemDoor(item.itemid)) then
if(getCreatureStorage(cid, i)) == 1 then
doCreatureSetStorage(cid, i, -1)
doCreatureSay(cid, c[i], TALKTYPE_MONSTER)
end
end
return true
end
- test on tfs v.0.4 -> OK:thumbup:
- test on tfs v.0.3.6 -> OK:thumbup:
have you any wishes?
Last edited: