Moqill
czejwone jabjuszko to ja!
- Joined
- Jan 4, 2008
- Messages
- 1,016
- Reaction score
- 22
Autor: Moqill
Licencja: X11
Tested: TFS 0.4_
Script stones.lua
You must add to movements.xml:
This is script bramka.lua
Script thrones.lua
Licencja: X11
Tested: TFS 0.4_
PHP:
<action uniqueid="2040-2057" script="quests/poi/stones.lua" />
PHP:
local config = {
-- 1 sala
[2040] = {stone = {x=X, y=Y, z=Z}, time=20, stoneid=1304, switch=1945},
[2041] = {stone = {x=608, y=645, z=10}, time=20, stoneid=1304, switch=1945}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = config[item.uid]
local stoneCheck = getTileItemById(cfg.stone, cfg.stoneid)
if item.itemid == 1945 then
doRemoveItem(stoneCheck.uid)
doCreatureSay(cid, "You deleted this stone for "..cfg.time.." minutes. Hurry up!", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, item.itemid + 1)
local function eventCreateItem(a) doCreateItem(a[1], a[2], a[3]) end
addEvent(eventCreateItem, cfg.time*60*1000, {cfg.stoneid, 1, cfg.stone})
local function eventDoTransformItem(b) doTransformItem(b[1], b[2]) end
addEvent(eventDoTransformItem, cfg.time*60*1000, {item.uid, cfg.switch})
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "The stone is deleted.")
end
return true
end
You must add to movements.xml:
PHP:
<!-- PoI -->
<movevent type="StepIn" uniqueid="2060-2065" script="quests/poi/thrones.lua"/>
<movevent type="StepIn" uniqueid="2066-2071" script="quests/poi/bramka.lua"/>
PHP:
local config = {
[2066] = {storage = 2060, name="Verminor´s", efekt = 20},
[2067] = {storage = 2061, name="Infernatil´s", efekt = 15},
[2068] = {storage = 2062, name="Tafariel´s", efekt = 2},
[2069] = {storage = 2063, name="Apocalypse´s", efekt = 4},
[2070] = {storage = 2064, name="Pumina's", efekt = 7},
[2071] = {storage = 2065, name="Ashfalor´s", efekt = 17}
}
function onStepIn(cid, item, pos)
local pos = {x=712, y=658, z=12}
local cfg = config[item.uid]
if getPlayerStorageValue(cid, cfg.storage) ~= 1 then
doTeleportThing(cid, pos)
doCreatureSay(cid, "Sorry, but you did not absorb enough energy! You must touch " ..cfg.name.. " throne!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid),cfg.efekt)
end
return true
end
Script thrones.lua
PHP:
local config = {
[2060] = {storage = 2060, name = "Verminor´s", efekt = 20},
[2061] = {storage = 2061, name = "Infernatil´s", efekt = 15},
[2062] = {storage = 2062, name = "Tafariel´s", efekt = 2},
[2063] = {storage = 2063, name = "Apocalypse´s", efekt = 4},
[2064] = {storage = 2064, name = "Pumina's", efekt = 7},
[2065] = {storage = 2065, name = "Ashfalor´s", efekt = 17}
}
function onStepIn(cid, item, pos)
local cfg = config[item.uid]
local pos = getCreaturePosition(cid)
if getPlayerStorageValue(cid, cfg.storage) == -1 then
setPlayerStorageValue(cid,cfg.storage,1)
doCreatureSay(cid, 'You have touched '..cfg.name..' throne and absorbed some of his spirit.', TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid),cfg.efekt)
doTeleportThing(cid, {x=pos.x, y=pos.y+2, z=pos.z})
doCreatureSay(cid,"Begone.", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'You have already absorbed some of '..cfg.name..' spirit.', TALKTYPE_ORANGE_1)
doTeleportThing(cid, {x=pos.x, y=pos.y+2, z=pos.z})
end
return true
end