local config = {
rewards_id = {2494, 2472, 2514, 2493, 2470, 2195, 2173, 2160}, -- Rewards ID
crystal_counts = 20, -- used only if on rewards_id you have crystal coins (ID: 2160).
}
function onStepIn(cid, item, frompos, item2, topos)
local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
local item_name = getItemNameById(random_item)
if doPlayerSetTown(cid, 1) then
if(random_item == 2160) then
doPlayerAddItem(cid, random_item, config.crystal_counts)
doPlayerAddItem(cid, 10138, 1)
doPlayerSendTextMessage(cid,25, 'Your team won the dota round! You winner: '.. config.crystal_counts ..' '.. item_name ..'s and dota winner medal!')
else
doPlayerSendTextMessage(cid,25, 'Your team won the dota round! You winner: '.. item_name ..' and dota winner medal!')
doPlayerAddItem(cid, random_item, 1)
doPlayerAddItem(cid, 10138, 1)
end
end
return TRUE
end
function onSay(cid, words, param, channel)
local mensage1 = "[Evento Dota] Evento Iniciado! Destruam as Torres! quem destruir as 3 Torres primeiro, Ganha!" -- Mensagem Inicial
local monster1 = "Gerador Azul I" -- Geradores Iniciais
local monster2 = "Gerador Vermelho I" -- Geradores Iniciais
gatepos = {x=685, y=42, z=7, stackpos=1} -- Posição da Pedras 1
getgate = getThingfromPos(gatepos)
gatepos11 = {x=685, y=41, z=7, stackpos=1} -- Posição da Pedras 11
getgate11 = getThingfromPos(gatepos11)
gatepos12 = {x=685, y=40, z=7, stackpos=1} -- Posição da Pedras 12
getgate12 = getThingfromPos(gatepos12)
gatepos13 = {x=685, y=44, z=7, stackpos=1} -- Posição da Pedras 13
getgate13 = getThingfromPos(gatepos13)
gatepos14 = {x=685, y=43, z=7, stackpos=1} -- Posição da Pedras 14
getgate14 = getThingfromPos(gatepos14)
gatepos2 = {x=601, y=42, z=7, stackpos=1} -- Posição da Pedra 2
getgate2 = getThingfromPos(gatepos2)
gatepos21 = {x=601, y=41, z=7, stackpos=1} -- Posição da Pedra 21
getgate21 = getThingfromPos(gatepos21)
gatepos22 = {x=601, y=40, z=7, stackpos=1} -- Posição da Pedra 22
getgate22 = getThingfromPos(gatepos22)
gatepos23 = {x=601, y=43, z=7, stackpos=1} -- Posição da Pedra 23
getgate23 = getThingfromPos(gatepos23)
gatepos24 = {x=601, y=44, z=7, stackpos=1} -- Posição da Pedra 24
getgate24 = getThingfromPos(gatepos24)
if getgate.itemid == 1304 and getgate2.itemid == 1304 then
broadcastMessage(mensage1, MESSAGE_EVENT_ADVANCE)
doSummonCreature(monster1, {x=607, y=42, z=7})
doSummonCreature(monster2, {x=679, y=42, z=7})
doRemoveItem(getgate.uid,1)
doRemoveItem(getgate11.uid,1)
doRemoveItem(getgate12.uid,1)
doRemoveItem(getgate13.uid,1)
doRemoveItem(getgate14.uid,1)
doRemoveItem(getgate2.uid,1)
doRemoveItem(getgate21.uid,1)
doRemoveItem(getgate22.uid,1)
doRemoveItem(getgate23.uid,1)
doRemoveItem(getgate24.uid,1)
doCreateItem(1304, {x=677, y=14, z=7})
end
return 1
end
function onSay(cid, words, param, channel)
local mensage1 = "[Evento Dota] Liberada Sala dos Times! Quem quiser Participar, vá para a sala de times até o Evento começar. Depois que começar, sÓ na outra rodada! Gogo (TELEPORTE PARA O DOTA NO TEMPLO DA CIDADE PRINCIPAL)" -- Mensagem Inicial
gatepos = {x=677, y=14, z=7, stackpos=1} -- Posição da Pedra
getgate = getThingfromPos(gatepos)
if getgate.itemid == 1304 then
broadcastMessage(mensage1, MESSAGE_EVENT_ADVANCE)
doRemoveItem(getgate.uid,1)
end
return 1
end
function onStepIn(cid, item, frompos, item2, topos)
if doPlayerSetTown(cid, 1) then
end
return TRUE
end
function onStepIn(cid, item, pos, frompos)
local positions = {
{x=691, y=42, z=7},
{x=595, y=42, z=7}
}
local destino = math.random(#positions)
doTeleportThing(cid,positions[destino], true)
doSendMagicEffect(getPlayerPosition(cid), 10)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
gatepos = {x=685, y=42, z=7, stackpos=1} -- Posição da Parede 1
getgate = getThingfromPos(gatepos)
gatepos2 = {x=601, y=42, z=7, stackpos=1} -- Posição da Parede 2
getgate2 = getThingfromPos(gatepos2)
if item.uid == 5533 and item.itemid == 1945 and getgate.itemid == 1304 and getgate2.itemid == 1304 then
doRemoveItem(getgate.uid,1)
doRemoveItem(getgate2.uid,1)
doTransformItem(item.uid,1946)
elseif item.uid == 5533 and item.itemid == 1946 and getgate.itemid == 1304 and getgate2.itemid == 1304 then
doRemoveItem(getgate.uid,1)
doRemoveItem(getgate2.uid,1)
doTransformItem(item.uid,1945)
end
return 1
end
How do you start the event?
How do players join?