wafuboe
Member
- Joined
- Dec 24, 2010
- Messages
- 882
- Solutions
- 2
- Reaction score
- 23
got this error when i clic on the crystal.
So this happen when i clic on the crystal the teleport instantly appears but it leads to nowhere. Also no monsterwaves are spawned.
Script:
Also i have a doubt..
Here in the positions, what actually it is? it is the area where fungus appears on warzone 1?
So this happen when i clic on the crystal the teleport instantly appears but it leads to nowhere. Also no monsterwaves are spawned.
Script:
Code:
local creatureNames, crystalPosition = { 'humongous fungus', 'hideous fungus' }, Position(810, 611, 15)
local function summonMonster(name, position)
Game.createMonster(name, position)
position:sendMagicEffect(CONST_ME_TELEPORT)
end
local function chargingText(cid, text, position)
local player = Player(cid)
player:say(text, TALKTYPE_MONSTER_SAY, false, player, position)
end
local function revertTeleport(position)
local teleportItem = Tile(position):getItemById(1387)
if teleportItem then
teleportItem:transform(17999)
end
end
local function clearArea(fromPosition, toPosition, bossName, exitPosition)
for x = fromPosition.x, toPosition.x do
for y = fromPosition.y, toPosition.y do
for z = fromPosition.z, toPosition.z do
local creature = Tile(Position(x, y, z)):getTopCreature()
if creature then
if creature:isPlayer() then
creature:teleportTo(exitPosition)
exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
creature:say('You were teleported out by the gnomish emergency device.', TALKTYPE_MONSTER_SAY)
end
if creature:isMonster() and creature:getName():lower() == bossName:lower() then
creature:remove()
end
end
end
end
end
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if Game.getStorageValue(GlobalStorage.Warzones) == 1 then
return false
end
Game.setStorageValue(GlobalStorage.Warzones, 1)
addEvent(Game.setStorageValue, 32 * 60 * 1000, GlobalStorage.Warzones, 0)
local pos
for i = 1, 6 do
for k = 1, 10 do
pos = Position(math.random(799, 604), math.random(802, 614), 15)
addEvent(summonMonster, (i - 1) * 20000, creatureNames[math.random(#creatureNames)], pos)
end
addEvent(chargingText, (i - 1) * 20000, player.uid, 'The crystals are charging.', toPosition)
end
local crystalItem = Tile(crystalPosition):getItemById(17999)
if crystalItem then
crystalItem:transform(1387)
addEvent(revertTeleport, 6 * 20 * 1000, crystalPosition)
end
addEvent(summonMonster, 6 * 20 * 1000, 'deathstrike', Position(814, 671, 15))
addEvent(clearArea, 32 * 60 * 1000, Position(795, 649, 15), Position(833, 685, 15), 'deathstrike', Position(708, 621, 15))
return true
end
Also i have a doubt..
Here in the positions, what actually it is? it is the area where fungus appears on warzone 1?
Code:
Game.setStorageValue(GlobalStorage.Warzones, 1)
addEvent(Game.setStorageValue, 32 * 60 * 1000, GlobalStorage.Warzones, 0)
local pos
for i = 1, 6 do
for k = 1, 10 do
pos = Position(math.random(799, 604), math.random(802, 614), 15)
addEvent(summonMonster, (i - 1) * 20000, creatureNames[math.random(#creatureNames)], pos)
end
addEvent(chargingText, (i - 1) * 20000, player.uid, 'The crystals are charging.', toPosition)
end