Today I release this script I made, its about an annihilation, which you go inside, and theres a machine which its breaking itself and exploding, after 5 minutes it explodes and you die, you have 5 minutes to kill The elemental and go through the tp(The elemental blocks the exit speed"0" ), but there are several summons each minute!
Yes this idea was took from an OTserv
Okay, lets start!
data/actions/scripts/Elemental anni.lua
actions.xml
data/creaturescripts/scripts/Elemental annihilator.lua
login.lua add:
creaturescripts.xml
data/movements/scripts/Elemental annihilator tp.lua
movements.xml
data/monsters/The Elemental.xml
monsters.xml
Okay, now we have to setup the stuff which is inside the script!
1st go to the action script and set this:
Entry will be the playerPositions in the annihi room(The entry room where u pull switch)
Destination will be the 4 destinations of each player.
Now go to the creaturescript file and set the positions as explained (Everything is explained there after the '---'s, you can set the minimum dmg of bomb, max, attacks, etc.)
But I will explain a bit anyway:
[Think as each line of the table is a min(1st line, 5th min, 2nd line = 4th min, 3rd line = 3rdmin, and so on]
You can setup monsters for each min if you want here:
You can setup min dmg of bomb, max dmg of bomb too
You can setup the effects for each min(And the attack(If its ice, energy, earth))
Go to the monster file and set things up if you want (If its a rpg serv, you should lower its attacks a bit, they're too high, and their interval aswell).
Now put the switch(Annihi switch), put it uniqueID 8792
And put the TP to exit ActionID 8792
Now you gotta map a room, something like this:
Yes ^ of the elemental, the TP is there!
Yes I placed the elemental way to near the explotions, try to set it far away, else ull have to make it have inmunity against the types you want to put, but its your choice though.
And remember to put his spawntime a bit higher (or he will spawn again in-case someone kills it too fast!)
Some images :
http://img143.imageshack.us/img143/2470/1minq.png
http://img156.imageshack.us/img156/461/3minq.png
http://img109.imageshack.us/img109/9848/5minq.png
http://img821.imageshack.us/img821/4604/boomzp.png
Wont display 'em cause I know what it feels for low speed internet ;(
Tested and working in TFS 0.3.6(Crying Damson)
Enjoy! (I will try to make a video if i can)
If someone wants to FIX the mod(in-case its bugged), hes more than welcome to do it
MOD(Not tested):
Yes this idea was took from an OTserv
Okay, lets start!
data/actions/scripts/Elemental anni.lua
Lua:
local config = {
daily = "no", -- allow only one enter per day? (like in global Tibia)
level = 20,
storage = 30017, --- IF THIS STORAGE IS USED AND U CHANGE REMEMBER TO CHANGE IT AT THE TP FILE TOO!!
entry =
{
{x=558, y=432, z=7},
{x=558, y=433, z=7},
{x=558, y=434, z=7},
{x=558, y=435, z=7}
},
destination =
{
{x=568, y=435, z=7},
{x=571, y=433, z=7},
{x=568, y=431, z=7},
{x=565, y=433, z=7}
}
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 1946) then
if(config.daily) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
if(item.itemid ~= 1945) then
return true
end
local players = {}
for _, position in ipairs(config.entry) do
local pid = getTopCreature(position).uid
if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level or getGlobalStorageValue(7600) > 0) then
doPlayerSendCancel(cid, "Sorry not possible")
return true
end
table.insert(players, pid)
end
for i, pid in ipairs(players) do
doSendMagicEffect(config.entry[i], CONST_ME_POFF)
doTeleportThing(pid, config.destination[i], false)
doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
end
setGlobalStorageValue(7600,1)
doTransformItem(item.uid, item.itemid + 1)
return true
end
actions.xml
XML:
<action uniqueid="8792" event="script" value="Elemental anni.lua"/>
data/creaturescripts/scripts/Elemental annihilator.lua
Lua:
local positions = {{x=563, y=428, z=7}, {x=570, y=430, z=7}, {x=565, y=435, z=7}, {x=573, y=434, z=7}, {x=573, y=431, z=7}} --- Positions of monsters respawn!
local pos = {x=568, y=433, z=7, stackpos = 1} --- Position of machine
local textPositions = {{x=567, y=433, z=7}, {x=568, y=433, z=7}, {x=569, y=433, z=7}} --- positions = {{<- of machine}, {machine pos}, {-> of machine}}
local t = {
[1] = {storage = 2, minutes = {'5','minutes', 'left'}, min = 2000, max = 2500, combatdmg = CONST_ME_FIREAREA, combateffect = COMBAT_FIREAREA, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[2] = {storage = 3, minutes = {'4','minutes', 'left'}, min = 3000, max = 3500, combatdmg = CONST_ME_ENERGYAREA, combateffect = COMBAT_ENERGYDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[3] = {storage = 4, minutes = {'3','minutes', 'left'}, min = 4000, max = 4500, combatdmg = CONST_ME_SMALLPLANTS, combateffect = COMBAT_EARTHDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[4] = {storage = 5, minutes = {'2','minutes', 'left'}, min = 5000, max = 5500, combatdmg = CONST_ME_FIREAREA, combateffect = COMBAT_FIREAREA, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[5] = {storage = 6, minutes = {'1','minute', 'left'}, min = 6000, max = 6500, combatdmg = CONST_ME_ICEAREA, combateffect = COMBAT_ICEDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}}
} ----{dont touch , dont touch, min dmg of bomb, max dmg of bomb, combateffect = The dmg of the bomb (FIRE,ICE, ENERGY) you choose, combateffect = The effect of the bomb (FIRE, ICE, ENERGY) [It should match the combat dmg], monsters = 5 monsters of ur choice(u can add more but then u have to add more positions too)
local area = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
area = createCombatArea(area)
function onThink(cid, interval)
local v = t[getGlobalStorageValue(7600)]
if v then
for i = 1, #v.monsters do
doSummonCreature(v.monsters[i], positions[i])
end
for u = 1, #textPositions do
doSendAnimatedText(textPositions[u], v.minutes[u], 180)
end
doAreaCombatHealth(0, v.combateffect, pos, area, -v.min, -v.max, v.combatdmg)
setGlobalStorageValue(7600,0)
addEvent(setGlobalStorageValue, 1000*60, 7600, v.storage)
elseif getGlobalStorageValue(7600) > 5 then
doAreaCombatHealth(0, COMBAT_FIREDAMAGE, pos, area, -9999, -9999*100, CONST_ME_FIREAREA) -- Last --
doSendAnimatedText(pos, "BOOOOM!!!!", 180)
setGlobalStorageValue(7600,-1)
end
return true
end
login.lua add:
Lua:
registerCreatureEvent(cid, "AnnihiBomb")
creaturescripts.xml
XML:
<event type="think" name="AnnihiBomb" event="script" value="Elemental annihilator.lua"/>
data/movements/scripts/Elemental annihilator tp.lua
Lua:
local rewardRoom = {x=EDIT, y=EDIT, z=EDIT} --- Reward room pos
function onStepIn(cid, item, pos)
setPlayerStorageValue(cid,30017,1)
doTeleportThing(cid, rewardRoom)
return true
end
movements.xml
XML:
<movevent type="StepIn" actionid="8792" event="script" value="Elemental annihilator tp.lua" />
data/monsters/The Elemental.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="The Elemental" nameDescription="an elemental overlord" race="blood" experience="15000" speed="0" manacost="0">
<health now="15000" max="15000"/>
<look type="301" head="20" body="30" legs="40" feet="50" corpse="8933"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="1"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="125" attack="125"/>
<attack name="fire" interval="2000" chance="22" range="7" radius="4" target="1" min="-350" max="-500">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="firefield" interval="1000" chance="15" range="7" radius="4" target="1">
<attribute key="shootEffect" value="fire"/>
</attack>
<attack name="fire" interval="2000" chance="30" length="8" spread="3" min="-500" max="-600">
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="earth" interval="1000" chance="20" radius="7" target="0" min="-400" max="-800">
<attribute key="areaEffect" value="smallplants"/>
</attack>
<attack name="energy" interval="1000" chance="12" radius="7" target="0" min="-600" max="-900">
<attribute key="areaEffect" value="energy"/>
</attack>
</attacks>
<defenses armor="30" defense="35">
<defense name="healing" interval="1000" chance="25" min="1000" max="1100">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
<defense name="outfit" interval="2000" chance="40" monster="Massive Energy Elemental" duration="10000">
<attribute key="areaEffect" value="dice"/>
</defense>
<defense name="outfit" interval="2000" chance="30" monster="Massive Fire Elemental" duration="10000">
<attribute key="areaEffect" value="dice"/>
</defense>
<defense name="outfit" interval="2000" chance="30" monster="Massive Water Elemental" duration="10000">
<attribute key="areaEffect" value="dice"/>
</defense>
</defenses>
<elements>
<element energyPercent="20"/>
<element icePercent="-10"/>
<element earthPercent="80"/>
</elements>
<immunities>
<immunity fire="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="Burn!" yell="1"/>
<voice sentence="Freeze!" yell="1"/>
</voices>
<loot>
<item id="2148" countmax="70" chance1="100000" chancemax="0"/>
<item id="2148" countmax="80" chance1="100000" chancemax="0"/>
<item id="2672" countmax="5" chance1="80000" chancemax="0"/>
<item id="2033" chance="1818"/>
<item id="1976" chance="3333"/>
<item id="2413" chance="5000"/>
<item id="2498" chance="300"/>
<item id="2492" chance="200"/>
<item id="7378" countmax="2" chance1="2000" chancemax="0"/>
<item id="2547" countmax="7" chance1="8222" chancemax="0"/>
<item id="2796" countmax="1" chance1="6666" chancemax="0"/>
<item id="5948" countmax="1" chance1="5000" chancemax="0"/>
<item id="1987" chance="100000">
<inside>
<item id="2148" countmax="100" chance1="100000" chancemax="0"/>
<item id="2149" countmax="2" chance1="833" chancemax="0"/>
<item id="2392" chance="1428"/>
<item id="2146" countmax="2" chance1="3222" chancemax="0"/>
<item id="2528" chance="2033"/>
<item id="7402" chance="1833"/>
<item id="5882" countmax="1" chance1="5000" chancemax="0"/>
</inside>
</item>
</loot>
</monster>
monsters.xml
XML:
<monster name="The Elemental" file="The Elemental.xml"/>
Okay, now we have to setup the stuff which is inside the script!
1st go to the action script and set this:
Lua:
entry =
{
{x=558, y=432, z=7},
{x=558, y=433, z=7},
{x=558, y=434, z=7},
{x=558, y=435, z=7}
},
destination =
{
{x=568, y=435, z=7},
{x=571, y=433, z=7},
{x=568, y=431, z=7},
{x=565, y=433, z=7}
}
Entry will be the playerPositions in the annihi room(The entry room where u pull switch)
Destination will be the 4 destinations of each player.
Now go to the creaturescript file and set the positions as explained (Everything is explained there after the '---'s, you can set the minimum dmg of bomb, max, attacks, etc.)
But I will explain a bit anyway:
[Think as each line of the table is a min(1st line, 5th min, 2nd line = 4th min, 3rd line = 3rdmin, and so on]
You can setup monsters for each min if you want here:
Lua:
monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}
Lua:
min = 2000, max = 2500,
Lua:
combatdmg = CONST_ME_FIREAREA, combateffect = COMBAT_FIREAREA
Go to the monster file and set things up if you want (If its a rpg serv, you should lower its attacks a bit, they're too high, and their interval aswell).
Now put the switch(Annihi switch), put it uniqueID 8792
And put the TP to exit ActionID 8792
Now you gotta map a room, something like this:
Yes ^ of the elemental, the TP is there!
Yes I placed the elemental way to near the explotions, try to set it far away, else ull have to make it have inmunity against the types you want to put, but its your choice though.
And remember to put his spawntime a bit higher (or he will spawn again in-case someone kills it too fast!)
Some images :
http://img143.imageshack.us/img143/2470/1minq.png
http://img156.imageshack.us/img156/461/3minq.png
http://img109.imageshack.us/img109/9848/5minq.png
http://img821.imageshack.us/img821/4604/boomzp.png
Wont display 'em cause I know what it feels for low speed internet ;(
Tested and working in TFS 0.3.6(Crying Damson)
Enjoy! (I will try to make a video if i can)
If someone wants to FIX the mod(in-case its bugged), hes more than welcome to do it
MOD(Not tested):
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="The Elemental Annihilation Quest" version="1.0" author="Santi" contact="otland.net" enabled="yes">
<action uniqueid="8792" event="script"><![CDATA[
local config = {
daily = "no", -- allow only one enter per day? (like in global Tibia)
level = 20,
storage = 30017, --- IF THIS STORAGE IS USED AND U CHANGE REMEMBER TO CHANGE IT AT THE TP FILE TOO!!
entry =
{
{x=558, y=432, z=7},
{x=558, y=433, z=7},
{x=558, y=434, z=7},
{x=558, y=435, z=7}
},
destination =
{
{x=568, y=435, z=7},
{x=571, y=433, z=7},
{x=568, y=431, z=7},
{x=565, y=433, z=7}
}
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 1946) then
if(config.daily) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
if(item.itemid ~= 1945) then
return true
end
local players = {}
for _, position in ipairs(config.entry) do
local pid = getTopCreature(position).uid
if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level or getGlobalStorageValue(7600) > 0) then
doPlayerSendCancel(cid, "Sorry not possible")
return true
end
table.insert(players, pid)
end
for i, pid in ipairs(players) do
doSendMagicEffect(config.entry[i], CONST_ME_POFF)
doTeleportThing(pid, config.destination[i], false)
doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
end
setGlobalStorageValue(7600,1)
doTransformItem(item.uid, item.itemid + 1)
return true
end
]]> </action>
<event type="think" name="AnnihiBomb" event="script"><![CDATA[
local positions = {{x=563, y=428, z=7}, {x=570, y=430, z=7}, {x=565, y=435, z=7}, {x=573, y=434, z=7}, {x=573, y=431, z=7}} --- Positions of monsters respawn!
local pos = {x=568, y=433, z=7, stackpos = 1} --- Position of machine
local textPositions = {{x=567, y=433, z=7}, {x=568, y=433, z=7}, {x=569, y=433, z=7}} --- positions = {{<- of machine}, {machine pos}, {-> of machine}}
local t = {
[1] = {storage = 2, minutes = {'5','minutes', 'left'}, min = 2000, max = 2500, combatdmg = CONST_ME_FIREAREA, combateffect = COMBAT_FIREAREA, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[2] = {storage = 3, minutes = {'4','minutes', 'left'}, min = 3000, max = 3500, combatdmg = CONST_ME_ENERGYAREA, combateffect = COMBAT_ENERGYDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[3] = {storage = 4, minutes = {'3','minutes', 'left'}, min = 4000, max = 4500, combatdmg = CONST_ME_SMALLPLANTS, combateffect = COMBAT_EARTHDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[4] = {storage = 5, minutes = {'2','minutes', 'left'}, min = 5000, max = 5500, combatdmg = CONST_ME_FIREAREA, combateffect = COMBAT_FIREAREA, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}},
[5] = {storage = 6, minutes = {'1','minute', 'left'}, min = 6000, max = 6500, combatdmg = CONST_ME_ICEAREA, combateffect = COMBAT_ICEDAMAGE, monsters = {"Demon", "Demon", "Demon", "Demon", "Demon"}}
} ----{dont touch , dont touch, min dmg of bomb, max dmg of bomb, combateffect = The dmg of the bomb (FIRE,ICE, ENERGY) you choose, combateffect = The effect of the bomb (FIRE, ICE, ENERGY) [It should match the combat dmg], monsters = 5 monsters of ur choice(u can add more but then u have to add more positions too)
local area = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
area = createCombatArea(area)
function onThink(cid, interval)
local v = t[getGlobalStorageValue(7600)]
if v then
for i = 1, #v.monsters do
doSummonCreature(v.monsters[i], positions[i])
end
for u = 1, #textPositions do
doSendAnimatedText(textPositions[u], v.minutes[u], 180)
end
doAreaCombatHealth(0, v.combateffect, pos, area, -v.min, -v.max, v.combatdmg)
setGlobalStorageValue(7600,0)
addEvent(setGlobalStorageValue, 1000*60, 7600, v.storage)
elseif getGlobalStorageValue(7600) > 5 then
doAreaCombatHealth(0, COMBAT_FIREDAMAGE, pos, area, -9999, -9999*100, CONST_ME_FIREAREA) -- Last --
doSendAnimatedText(pos, "BOOOOM!!!!", 180)
setGlobalStorageValue(7600,-1)
end
return true
end
]]> </creatureevent>
<movevent type="StepIn" actionid="8792" event="script"><![CDATA[
local rewardRoom = {x=EDIT, y=EDIT, z=EDIT} --- Reward room pos
function onStepIn(cid, item, pos)
setPlayerStorageValue(cid,30017,1)
doTeleportThing(cid, rewardRoom)
return true
end
]]> </movevent>
</mod>
Last edited: