
Lovecraft
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
Lovecraft deu reputação a Vodkart em [MODS] - [8.6] Perfect Zombie System [Automático] [V1.0]como você é leigo nessa parte, vou te ajudar fazendo um passo a passo... me adc no skype: vodkart.luateam
-
Lovecraft deu reputação a Vodkart em (Resolvido)Error CTF MOD<?xml version="1.0" encoding="utf-8"?> <mod name="CTF" version="1.0" author="Doggynub" contact="otland.net" enabled="yes"> <config name="toto"><![CDATA[ --[[ Storage Settings]]-- Owner = 1900 -- put empty storage FLAG2_INn = 4000 -- put empty storage FLAG_IN = 4001 -- put empty storage TEAM1_FLAGS = 3030 -- put empty storage TEAM2_FLAGS = 3031 -- put empty storage Event_Start = 3032 -- put empty storage Event_timeend = 3033 -- put empty storage Event_Tile_Close = 3039 -- put empty storage joined = 2023 --put empty storage Timer = 1010 --put empty storage -------------------------------------- --[[ Places setting ]]-- BLUE_FLAG = {x=10499,y=9887,z=6} -- Blue flag Place RED_FLAG = {x=10553,y=9887,z=6} --red flag Place Tp_Place = {x=10160,y=10054,z=7} -- Place where the event teleport will be created. Wait_Place = {x=10522,y=9817,z=7} -- Positions Players will be sent when the enter event's teleport frompos = {x=10512, y=9807, z=7} --start sqm in the waiting room(1 floor) topos = {x=10532,y=9827,z=7} -- end sqm in the waiting room(1 floor) Red_Position = {x=10549,y=9887,z=6} -- Red team temple pos Blue_Position = {x=10503,y=9887,z=6} -- Blue team temple pos --------------------------------------- --[[Event setting ]]-- Event_WaitTime = 1 -- time for the collection of player then event will start (in minutes) Event_MaxTime = 10 --- in minutes ( this is the max time for an event to bb running ) Players_Speed = 20000 -- put the level of base speed in event ( like if you want the speed of lvl 300 then wright 300) Flag_Holder_Speed = 20000 -- [Old-Styled feature] speed for the player when he hold a flag better not to increase. TEAM2_NAME = "Red" -- team 2 name TEAM1_NAME = "Blue" -- team 1 name FLAG_SCORE = 2 -- score when team gets he wins Teleport_On_Score = false -- this teleport all players to their team main position when some one score a flag , make false to disable. Players_Least_Number = 2 -- this means if there is less than 2 players joined the event will be cancelled Min_Join_Level = 1 -- min lvl for a player to join event rewards_random = { [60] = { -- Rewards of 60% , if it is then it will randomly give one of the items in the items verible if there you put more than one item there items = {9971,9971,9971} }, [30] = { -- Rewards of 30% items = {9971,9971,9971} }, [10] = { -- Rewards of 10% items = {9971,9971,9971} } } ]]></config> <lib name="CTF-lib"><![CDATA[ function isTeamTwo(cid) return (isPlayer(cid) and getPlayerStorageValue(cid,5054) > -1) end function isTeamOne(cid) return (isPlayer(cid) and getPlayerStorageValue(cid,5055) > -1) end function resetTheTeams(cid) return (isPlayer(cid) and setPlayerStorageValue(cid,5054,-1) and setPlayerStorageValue(cid,5055,-1)) end function setflagOwner(cid) return setPlayerStorageValue(cid,Owner,1) end function flagOwner(cid) return (isPlayer(cid) and getPlayerStorageValue(cid,Owner) > 0) end function releaseBF(cid) setGlobalStorageValue(FLAG_IN,-1) setPlayerStorageValue(cid,103, 0) setPlayerStorageValue(cid,Owner,-1) return true end function releaseRF(cid) setGlobalStorageValue(FLAG2_INn,-1) setPlayerStorageValue(cid,103, 0) setPlayerStorageValue(cid,Owner,-1) return true end function setFirstTeam(cid) return setPlayerStorageValue(cid,5055,1) end function setSecondTeam(cid) return setPlayerStorageValue(cid,5054,2) end function addToRed() return setGlobalStorageValue(TEAM2_FLAGS,getGlobalStorageValue(TEAM2_FLAGS)+1) end function addToBlue() return setGlobalStorageValue(TEAM1_FLAGS,getGlobalStorageValue(TEAM1_FLAGS)+1) end function getBlueScore() return getGlobalStorageValue(TEAM1_FLAGS) end function getRedScore() return getGlobalStorageValue(TEAM2_FLAGS) end function getTheSpeed(level) value = (220 +(2 *(level -1))) return value end function resetTheStorage() setGlobalStorageValue(Event_Start,-1) setGlobalStorageValue(Event_timeend,-1) setGlobalStorageValue(TEAM1_FLAGS,0) setGlobalStorageValue(FLAG2_INn,-1) setGlobalStorageValue(FLAG_IN,-1) setGlobalStorageValue(TEAM2_FLAGS,0) return true end function blueStolen() return getGlobalStorageValue(FLAG_IN) end function redStolen() return getGlobalStorageValue(FLAG2_INn) end function giveReward(cid) local t = math.random(1,100) if t <= 10 then local rare = rewards_random[10].items[math.random(1,#rewards_random[10].items)] doPlayerAddItem(cid,rare,1) doPlayerSendTextMessage(cid,25,"Rare rate Reward : you won "..getItemNameById(rare)..".") elseif t > 10 and t <= 40 then local semi = rewards_random[30].items[math.random(1,#rewards_random[30].items)] doPlayerAddItem(cid,semi,1) doPlayerSendTextMessage(cid,25,"Semi rate Reward : you won "..getItemNameById(semi)..".") elseif t > 40 then local aver = rewards_random[60].items[math.random(1,#rewards_random[60].items)] doPlayerAddItem(cid,aver,1) doPlayerSendTextMessage(cid,25,"Averege rate Reward : you won "..getItemNameById(aver)..".") end return true end ]]></lib> <event type="login" name="Tutorial Login" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function onLogin(cid) if getGlobalStorageValue(Event_Start) < 1 then if isTeamOne(cid) or isTeamTwo(cid) then resetTheTeams(cid) end end registerCreatureEvent(cid, "Attk") registerCreatureEvent(cid, "ctff") registerCreatureEvent(cid, "prepare") return true end ]]></event> <event type="combat" name="Attk" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function onCombat(cid, target) if isTeamOne(cid) and isTeamOne(target) then return false end if isTeamTwo(cid) and isTeamTwo(target) then return false end return true end ]]></event> <event type="statschange" name="prepare" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') local corpse_ids = { [0] = 3065, -- female [1] = 3058 -- male } function onStatsChange(cid, attacker, type, combat, value) if combat == COMBAT_HEALING then return true end if getCreatureHealth(cid) > value then return true end if getGlobalStorageValue(Event_Start) > 0 then if flagOwner(cid) then if isTeamOne(cid) then doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").."[Flag Holder].") doTeleportThing(cid,Blue_Position,false) doSendMagicEffect(Blue_Position,10) doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) doCreatureAddMana(cid,getCreatureMaxMana(cid)) releaseRF(cid) for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) or isTeamTwo(cid) then doPlayerSendTextMessage(cid,22,getCreatureName(cid) .. " has died with the "..TEAM2_NAME.." team flag. The flag is returned back to the "..TEAM1_NAME.." team.") end end return false elseif isTeamTwo(cid) then doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").."[Flag Holder].") doTeleportThing(cid,Red_Position,false) doSendMagicEffect(Red_Position,10) doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) doCreatureAddMana(cid,getCreatureMaxMana(cid)) releaseBF(cid) for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) or isTeamTwo(cid) then doPlayerSendTextMessage(cid,22,getCreatureName(cid) .. " has died with the "..TEAM1_NAME.." team flag. The flag is returned back to the "..TEAM1_NAME.." team.") end end return false end else if isTeamOne(cid) or isTeamTwo(cid) then doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").."[Normal kill].") doTeleportThing(cid,( isTeamTwo(cid) and Red_Position or Blue_Position ),false) doSendMagicEffect(Red_Position,10) doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) doCreatureAddMana(cid,getCreatureMaxMana(cid)) return false end end end return true end ]]></event> <movevent type="StepIn" actionid="6000" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function eventEnds() doBroadcastMessage('CTF-Event : The '..TEAM2_NAME..' team won and reciaved their reward.') for _,cid in ipairs(getPlayersOnline()) do if isTeamTwo(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) giveReward(cid) elseif isTeamOne(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) doPlayerSendTextMessage(cid,22,'Your team have lost.') resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) end end addEvent(resetTheStorage,5) end function onStepIn(cid, item, position, fromPosition) if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then if isTeamTwo(cid) and redStolen() < 0 then if not flagOwner(cid) then doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) doPlayerSendTextMessage(cid, 27, "This is your team flag, you cant take it!") end elseif isTeamTwo(cid) and redStolen() > 0 and blueStolen() < 0 then doPlayerSendTextMessage(cid, 27, "Your team's Flag has been stolen, go get it back!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) return true end if isTeamTwo(cid) and flagOwner(cid) and blueStolen() > 0 and redStolen() < 0 then if getRedScore() == FLAG_SCORE -1 then addEvent(eventEnds,1000) addToRed() doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid) ) releaseBF(cid) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " have captured the last flag and earned match win to the ".. TEAM2_NAME.." team!") end end else releaseBF(cid) addToRed() doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid) ) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " have captured the flag and earned 1 point to the ".. TEAM2_NAME.." team!") if Teleport_On_Score == true then doTeleportThing(tid,( isTeamTwo(tid) and Red_Position or Blue_Position ), false) doSendMagicEffect(getThingPos(tid),10) end end end end end if isTeamOne(cid) then if blueStolen() < 0 and redStolen() > 0 then if flagOwner(cid) then doPlayerSendTextMessage(cid, 27, "You already holding the flag!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) elseif (not flagOwner(cid)) then doPlayerSendTextMessage(cid, 27, "Your Team mates already stole the oponent flag, defend him!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) end elseif blueStolen() > 0 and redStolen() < 0 then doPlayerSendTextMessage(cid, 27, "Your team's flag is taken you can't capture or steel a flag!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) end if redStolen() < 0 and blueStolen() < 0 then setGlobalStorageValue(FLAG2_INn,1) setflagOwner(cid) setPlayerStorageValue(cid,103, os.time()+300) doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Flag_Holder_Speed)- getCreatureSpeed(cid) ) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " stolen the "..TEAM2_NAME.." team flag!") end end end end end return true end ]]></movevent> <movevent type="StepIn" actionid="3435" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getStorage(Event_Tile_Close) > 0 then if getPlayerLevel(cid) < Min_Join_Level then doTeleportThing(cid,fromPosition,false) doSendMagicEffect(fromPosition,10) doPlayerSendTextMessage(cid,21,"Only players of level "..Min_Join_Level.." are allowed to pass.") else doTeleportThing(cid,Wait_Place,false) doSendMagicEffect(Wait_Place,10) end else doTeleportThing(cid,fromPosition,false) doSendMagicEffect(fromPosition,10) doPlayerSendTextMessage(cid,21,"Come back later, event is closed now.") end return true end ]]></movevent> <movevent type="StepIn" actionid="6001" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function eventEnded() if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then doBroadcastMessage('CTF-Event : The '.. TEAM1_NAME..' team won and reciaved their reward.') for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) giveReward(cid) elseif isTeamTwo(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) doPlayerSendTextMessage(cid,22,'Your team have lost.') resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) end end end addEvent(resetTheStorage,5) end function onStepIn(cid, item, position, fromPosition) if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then if isTeamOne(cid) and blueStolen() < 0 then if not flagOwner(cid) then doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) doPlayerSendTextMessage(cid, 27, "This is your team flag, you cant take it!") end elseif isTeamOne(cid) and blueStolen() > 0 and redStolen() < 0 then doPlayerSendTextMessage(cid, 27, "Your team's Flag has been stolen, go get it back!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) return true end if isTeamOne(cid) and flagOwner(cid) and redStolen() > 0 and blueStolen() < 0 then if getBlueScore() == FLAG_SCORE -1 then addEvent(eventEnded,1000) addToBlue() doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid) ) releaseRF(cid) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " have captured the last flag and earned match win to the ".. TEAM1_NAME.." team!") end end else releaseRF(cid) addToBlue() doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid) ) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " have captured the flag and earned 1 point to the ".. TEAM1_NAME.." team!") if Teleport_On_Score == true then doTeleportThing(tid,( isTeamTwo(tid) and Red_Position or Blue_Position ), false) doSendMagicEffect(getThingPos(tid),10) end end end end end if isTeamTwo(cid) then if blueStolen() > 0 and redStolen() < 0 then if flagOwner(cid) then doPlayerSendTextMessage(cid, 27, "You already holding the flag!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) elseif (not flagOwner(cid)) then doPlayerSendTextMessage(cid, 27, "Your Team mates already stole the oponent flag, defend him!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) end elseif redStolen() > 0 and blueStolen() < 0 then doPlayerSendTextMessage(cid, 27, "Your team's flag is taken you can't capture or steel a flag!") doTeleportThing(cid, fromPosition,TRUE) doSendMagicEffect(getThingPos(cid),2) end if blueStolen() < 0 and redStolen() < 0 then setGlobalStorageValue(FLAG_IN,1) setflagOwner(cid) setPlayerStorageValue(cid,103, os.time()+300) doTeleportThing(cid, fromPosition,TRUE) doChangeSpeed(cid, getTheSpeed(Flag_Holder_Speed)- getCreatureSpeed(cid) ) for _,tid in ipairs(getPlayersOnline()) do if isTeamOne(tid) or isTeamTwo(tid) then doPlayerSendTextMessage(tid,22,getCreatureName(cid) .. " stolen the "..TEAM1_NAME.." team flag!") end end end end end return true end ]]></movevent> <globalevent name="ctf" time="02:24" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') local players = {} local bmale = createConditionObject(CONDITION_OUTFIT) setConditionParam(bmale, CONDITION_PARAM_TICKS, -1) addOutfitCondition(bmale, {lookType = math.random(128,134), lookHead = 115, lookBody =114, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3}) local bfemale = createConditionObject(CONDITION_OUTFIT) setConditionParam(bfemale, CONDITION_PARAM_TICKS, -1) addOutfitCondition(bfemale, {lookType = math.random(136,142), lookHead = 115, lookBody =114, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3}) local rmale = createConditionObject(CONDITION_OUTFIT) setConditionParam(rmale, CONDITION_PARAM_TICKS, -1) addOutfitCondition(rmale, {lookType = math.random(128,134), lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3}) local rfemale = createConditionObject(CONDITION_OUTFIT) setConditionParam(rfemale, CONDITION_PARAM_TICKS, -1) addOutfitCondition(rfemale, {lookType = math.random(136,142),lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3}) local fight = createConditionObject(CONDITION_INFIGHT) setConditionParam(fight, CONDITION_PARAM_TICKS, -1) function eventEnd() if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then if getRedScore() > getBlueScore() then doBroadcastMessage('CTF-Event : The '.. TEAM2_NAME..' team won and recieved their reward.') for _,cid in ipairs(getPlayersOnline()) do if isTeamTwo(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) giveReward(cid) elseif isTeamOne(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) doPlayerSendTextMessage(cid,22,'Your team have lost.') resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) end end elseif getRedScore() < getBlueScore() then doBroadcastMessage('CTF-Event : The '.. TEAM1_NAME..' team won and recieved their reward.') for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) giveReward(cid) elseif isTeamTwo(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) doPlayerSendTextMessage(cid,22,'Your team have lost.') resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) end end elseif getRedScore() == getBlueScore() then doBroadcastMessage('CTF-Event : The Event ended with a draw between both teams.') for _,cid in ipairs(getPlayersOnline()) do if isTeamTwo(cid) or isTeamOne(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)),false) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10) doRemoveConditions(cid,false) doPlayerSendTextMessage(cid,22,'It was a draw between both teams.') resetTheTeams(cid) doChangeSpeed(cid, getTheSpeed(getPlayerLevel(cid)) - getCreatureSpeed(cid)) end end end addEvent(resetTheStorage,1000) end end function eventStart() doSetStorage(Event_Tile_Close,-1) setGlobalStorageValue(Event_timeend,1) setGlobalStorageValue(Timer, os.time() + Event_MaxTime*60) addEvent(eventEnd,Event_MaxTime*60*1000) for v = frompos.x , topos.x do for k = frompos.y , topos.y do for i = 1, 200 do position = {x = v, y = k, z = 7, stackpos = i} pid = getThingfromPos(position).uid if(pid ~= nil and isPlayer(pid)) then table.insert(players, pid) end end end end if math.mod(#players, 2) ~= 0 then doTeleportThing(players[#players],getTownTemplePosition(getPlayerTown(players[#players])),false) doSendMagicEffect(getThingPosition(players[#players]),10) doPlayerSendTextMessage(players[#players], 19, "Sorry, you have been kicked from event to balance teams.") table.remove(players) end if #players < Players_Least_Number then doBroadcastMessage("CTF event was cancelled because less than "..Players_Least_Number.." players joined") resetTheStorage() if #players > 0 then for i = 1,#players do doTeleportThing(players[i],getTownTemplePosition(getPlayerTown(players[i])),false) doSendMagicEffect(getThingPos(players[i]), 10) end end else doBroadcastMessage("CTF started") for i = 1, math.floor(#players/2) do setFirstTeam(players[i]) end for i = math.floor(#players/2)+1 , #players do setSecondTeam(players[i]) end for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) then if getPlayerSex(cid) == 1 then doAddCondition(cid, bmale) elseif getPlayerSex(cid) ~= 1 then doAddCondition(cid, bfemale) end doAddCondition(cid, fight) doTeleportThing(cid,Blue_Position,false) doSendMagicEffect(Blue_Position, 10) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid)) elseif isTeamTwo(cid) then if getPlayerSex(cid) == 1 then doAddCondition(cid, rmale) elseif getPlayerSex(cid) ~= 1 then doAddCondition(cid, rfemale) end doAddCondition(cid, fight) doTeleportThing(cid,Red_Position,false) doSendMagicEffect(Red_Position, 10) doChangeSpeed(cid, getTheSpeed(Players_Speed) - getCreatureSpeed(cid)) end end players = {} end end function onTime() function removeCtfTp() local t = getTileItemById(Tp_Place, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(Tp_Place, CONST_ME_POFF) end if getGlobalStorageValue(Event_Start) < 0 then setGlobalStorageValue(Event_Start,1) doSetStorage(Event_Tile_Close,1) doBroadcastMessage("CTF event is opened and teleport is created. It will start in "..Event_WaitTime.." minutes.") players = {} if getTileItemById(Tp_Place, 1387).uid < 1 then doItemSetAttribute(doCreateItem(1387,1, Tp_Place), "aid", 3435) end f= Event_WaitTime - 1 for i = 1,Event_WaitTime-1 do addEvent(doBroadcastMessage,i*60*1000,"CTF event is opened and teleport is created. It will start in "..f.." minutes.") f= f-1 end addEvent(eventStart, Event_WaitTime*60*1000) addEvent(removeCtfTp, Event_WaitTime*60*1000) end return true end ]]></globalevent> <event type="think" name="ctff" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') local bl = BLUE_FLAG local re = RED_FLAG function onThink(interval) if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then if redStolen() < 0 then doSendAnimatedText(re,"FLAG!",TEXTCOLOR_RED) doSendMagicEffect(re, CONST_ME_SOUND_RED) end if blueStolen() < 0 then doSendAnimatedText(bl,"FLAG!",TEXTCOLOR_BLUE) doSendMagicEffect(bl, CONST_ME_SOUND_BLUE) end for _, cid in ipairs(getPlayersOnline()) do if flagOwner(cid) then if isTeamOne(cid) or isTeamTwo(cid) then if hasCondition(cid,CONDITION_HASTE) then doRemoveCondition(cid,CONDITION_HASTE) end end pl = getThingPos(cid) if isTeamTwo(cid) then if getPlayerStorageValue(cid,103) < os.time() then releaseBF(cid) for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) or isTeamTwo(cid) then doPlayerSendTextMessage(cid,22,getCreatureName(cid) .. " wasted 5 minutes with FLAG."..TEAM2_NAME.." flag is again on spawn!") end end else doSendAnimatedText(pl,"FLAG!",TEXTCOLOR_BLUE) doSendMagicEffect(pl, CONST_ME_SOUND_BLUE) end elseif isTeamOne(cid) then if getPlayerStorageValue(cid,103) < os.time() then releaseRF(cid) for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) or isTeamTwo(cid) then doPlayerSendTextMessage(cid,22,getCreatureName(cid) .. " wasted 5 minutes with FLAG."..TEAM1_NAME.." flag is again on spawn!") end end else doSendAnimatedText(pl,"FLAG!",COLOR_RED) doSendMagicEffect(pl, CONST_ME_SOUND_RED) end end end end end return true end ]]></event> <globalevent name="timer" interval="0.4" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function onThink(interval) for _,cid in ipairs(getPlayersOnline()) do if isTeamOne(cid) or isTeamTwo(cid) then if getGlobalStorageValue(Event_Start) > 0 and getGlobalStorageValue(Event_timeend) > 0 then if getGlobalStorageValue(Timer)- os.time() >= 0 then doPlayerSendCancel(cid, "Time -> ".. os.date("%M:%S ",getGlobalStorageValue(Timer)- os.time()) .. " | ".. TEAM1_NAME.." Score : "..getBlueScore(cid).."/"..FLAG_SCORE.." captures | ".. TEAM2_NAME.." Score : "..getRedScore(cid).."/"..FLAG_SCORE.." captures") end end end end return true end ]]></globalevent> <globalevent name="starting" type="startup" event="script"><![CDATA[ domodlib('toto') domodlib('CTF-lib') function onStartup() resetTheStorage() return true end ]]></globalevent> </mod>
-
Lovecraft deu reputação a Vodkart em (Resolvido)Error CTF MODentão troca a cor, onde tiver
doSendAnimatedText(pl,"FLAG!",COLOR_RED) essa função 'doSendAnimatedText'
vc altera a cor que quiser...
algumas por exemplo:
COLOR_BLACK = 0 COLOR_BLUE = 5 COLOR_GREEN = 18 COLOR_TEAL = 35 COLOR_LIGHTGREEN = 66 COLOR_DARKBROWN = 78 COLOR_LIGHTBLUE = 89 COLOR_DARKPURPLE = 112 COLOR_BROWN = 120 COLOR_GREY = 129 COLOR_DARKRED = 144 COLOR_DARKPINK = 152 COLOR_PURPLE = 154 COLOR_DARKORANGE = 156 COLOR_RED = 180 COLOR_PINK = 190 COLOR_ORANGE = 192 COLOR_DARKYELLOW = 205 COLOR_YELLOW = 210 COLOR_WHITE = 215 COLOR_NONE = 255
vai de 0 á 255 de cor.
-
Lovecraft deu reputação a Vodkart em [MODS] [8.6] Fire Storm Event - Automáticologico né, só pode entrar no min 2 players no evento.
-
Lovecraft deu reputação a Vodkart em [MODS] [8.6] Fire Storm Event - Automáticoseu serve deve ser em milesegundos
troque essa linha:
<globalevent name="Storm_Fire_Start" interval="60" event="script"><![CDATA[
por
<globalevent name="Storm_Fire_Start" interval="60000" event="script"><![CDATA[
-
Lovecraft deu reputação a Vodkart em [MODS] - [8.6] Perfect Zombie System [Automático] [V1.0]Qual dúvida ou erro poste no tópico que estarei respondendo.
Obs: Antes que me falem besteiras, coloquei para os GM'S, CM'S E GOD'S não contarem no evento, então testem apenas com jogadores.
Zombie.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Perfect Zombie System" version="8.6" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="zombie_config"><![CDATA[ zombie_config = { storages = {172100, 172101, 172102}, -- n edite players = {min = 2, max = 30}, -- min, max players no evento rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento teleport = {{x=147, y=55, z=7}, {x=125 , y=304, z=7}}, -- position do tp onde aparece, position para onde o jogador vai ao entrar no tp arena = {{x=110,y=297,z=7},{x=145,y=321,z=7}}, -- area positions monster_name = "Zombie Event", timeBetweenSpawns = 20, min_Level = 20 } zombie_days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","22:50","22:00"}, ["Wednesday"] = {"21:57","18:00","20:00","23:17"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","21:45","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeZombieTp() local t = getTileItemById(zombie_config.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(zombie_config.teleport[1], CONST_ME_POFF) end function ZerarStoragesZombie() for _, stor in pairs(zombie_config.storages) do setGlobalStorageValue(stor, 0) end end function getPlayersInZombieEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), zombie_config.arena[1], zombie_config.arena[2]) and getPlayerAccess(pid) < 3 then t[#t+1] = pid end end return t end function getZombieRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function HaveCreatureZombie(area, remove) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end end function spawnZombie() if #getPlayersInZombieEvent() > 1 then local pos = {x=math.random(zombie_config.arena[1].x, zombie_config.arena[2].x), y=math.random(zombie_config.arena[1].y,zombie_config.arena[2].y), z=zombie_config.arena[1].z} if not isWalkable(pos, false, false, false) then spawnZombie() else doSummonCreature(zombie_config.monster_name, pos) doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(zombie_config.storages[2], getGlobalStorageValue(zombie_config.storages[2]) <= 0 and 1 or getGlobalStorageValue(zombie_config.storages[2])+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(zombie_config.storages[2]) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, zombie_config.timeBetweenSpawns *1000) end end end function CheckZombieEvent(delay) if getGlobalStorageValue(zombie_config.storages[1]) ~= (zombie_config.players.max+1) then if delay > 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.max then doBroadcastMessage("Zombie event starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.min then for _, cid in pairs(getPlayersInZombieEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) end removeZombieTp() doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. zombie_config.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStoragesZombie() elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) >= zombie_config.players.min then removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1]) .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end addEvent(CheckZombieEvent, 60000, delay-1) end end]]></config> <event type="statschange" name="ZombieStats" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isMonster(attacker) and getCreatureName(attacker) == zombie_config.monster_name then if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then if #getPlayersInZombieEvent() > 1 then doBroadcastMessage(getPlayerName(cid) .. " have been eated by Zombies!", MESSAGE_STATUS_CONSOLE_RED) local corpse = doCreateItem(getPlayerSex(cid) == 1 and 3058 or 6081, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) if #getPlayersInZombieEvent() == 1 then local winner = getPlayersInZombieEvent()[1] doBroadcastMessage(getCreatureName(winner)..' has survived at zombie event!') local goblet = doPlayerAddItem(winner, zombie_config.rewards.trophy, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(winner) .. " for winning the Zombie event.") getZombieRewards(winner, zombie_config.rewards.items) doTeleportThing(winner, getTownTemplePosition(getPlayerTown(winner)), false) doSendMagicEffect(getPlayerPosition(winner), CONST_ME_TELEPORT) doBroadcastMessage(getPlayerName(winner).." won the Zombie event! Congratulations!") HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end else doBroadcastMessage("No one survived in the Zombie Event.", MESSAGE_EVENT_ADVANCE) HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end return false end end return true]]></event> <globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[ domodlib('zombie_config') function onThink(interval, lastExecution) if zombie_days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(zombie_days[os.date("%A")], hrs) and getGlobalStorageValue(zombie_config.storages[3]) <= 0 then local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(zombie_config.CheckTime) setGlobalStorageValue(zombie_config.storages[1], 0) setGlobalStorageValue(zombie_config.storages[2], 0) HaveCreatureZombie(zombie_config.arena, true) end end return true end]]></globalevent> <event type="login" name="Zombie_Login" event="script"><![CDATA[ domodlib('zombie_config') function onLogin(cid) registerCreatureEvent(cid, "ZombieBattle") registerCreatureEvent(cid, "ZombieStats") if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="ZombieBattle" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="45110" event="script"><![CDATA[ domodlib('zombie_config') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, zombie_config.teleport[2]) end if getPlayerLevel(cid) < zombie_config.min_Level then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. zombie_config.min_Level .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(zombie_config.storages[1]) <= zombie_config.players.max then doTeleportThing(cid, zombie_config.teleport[2]) setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(zombie_config.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(zombie_config.storages[1]) == zombie_config.players.max then setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1])-1 .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end end return true end]]></movevent> <talkaction words="/zombiestart;!zombiestart" access="5" event="buffer"><![CDATA[ domodlib('zombie_config') if getGlobalStorageValue(zombie_config.storages[3]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(tonumber(param)) ZerarStoragesZombie() setGlobalStorageValue(zombie_config.storages[3], 1) HaveCreatureZombie(zombie_config.arena, true) ]]></talkaction> <globalevent name="ZombieDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('zombie_config') ZerarStoragesZombie() return true]]></globalevent> </mod>
OBS: Quem serve em milesegundos, mude essa parte:
<globalevent name="Zombie_Start" interval="60" event="script"><![CDATA[
para
<globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[
----------------------------------------------------- // --------------------------------------------------
o monstro você instala em data/monsters
zombie event.xml
<?xml version="1.0" encoding="UTF-8"?> <monster name="Zombie Event" nameDescription="an zombie event" race="undead" experience="280" speed="100" manacost="0"> <health now="500" max="500"/> <look type="311" corpse="9875"/> <targetchange interval="5000" chance="50"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="0"/> <flag hostile="1"/> <flag illusionable="0"/> <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" min="-35000" max="-35000"/> </attacks> <defenses armor="15" defense="10"/> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="You wont last long!"/> <voice sentence="Mmmmh.. braains!"/> </voices> <loot> <item id="2148" countmax="1" chance="100000"/><!-- gold coin --> </loot> </monster>
e a tag em monsters.xml
<monster name="Zombie Event" file="zombie event.xml"/>
Configuração
Sistema
zombie_config = {
storages = {172100, 172101}, -- não edite
players = {min = 2, max = 30}, -- número minimo e máximo para jogadores no evento
rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, -- premiações do jogador
timeToStartEvent = 30, -- segundos para começar o evento após dar start
CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento
teleport = {{x=145, y=50, z=7}, {x=176 , y=54, z=5}}, -- posiçãodo tp onde aparece, posição para onde o jogador vai ao entrar no tp
arena = {{x=173,y=52,z=5},{x=179,y=56,z=6}}, -- posição começo e final da area do evento
monster_name = "Zombie Event", -- nome do monstro que será sumonado
timeBetweenSpawns = 20, -- a cada quantos segundos é dado o respaw time do zombie no evento
min_Level = 20 -- level minimo para participar do evento
}
Dia e Horário
zombie_days = {
["Monday"] = {"13:00","18:00","20:00","22:00"},
["Tuesday"] = {"13:00","18:00","20:00","22:00"},
["Wednesday"] = {"13:00","18:00","20:00","22:00"},
["Thursday"] = {"13:00","18:00","20:00","22:00"},
["Friday"] = {"13:00","18:00","20:00","22:00"},
["Saturday"] = {"13:00","18:00","20:00","22:00"},
["Sunday"] = {"13:00","18:00","20:00","22:00"}
}
["Dia em inglês"] = {"horário do evento"}
Configurando a área:
zombie lua.rar
-
Lovecraft deu reputação a Vodkart em [MODS] [8.6] Fire Storm Event - AutomáticoEvento for fun para colocar no seu ot, quem é atingido pelo fogo morre, o último a sobreviver ganha.
O evento é automático, mas também possui um comando para dar inicio ao evento, só usar /firestart minutos
exemplo: /firestart 1
Fire_Storm_Event.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Fire Storm Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="fire_config"><![CDATA[ Fire = { storages = {172354, 172355}, -- storage Count players = {min = 2, max = 50}, -- min, max players no evento minLevel = 20, -- level minimo para entrar no event rewards = {{2160,10},{2494,1}}, -- premios que vai receber timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- time to check event teleport = {{x=158, y=53, z=7}, {x=189 , y=58, z=7}}, -- posição do teleport, posição para onde o jogador vai arena = {{x=186,y=54,z=7},{x=193,y=60,z=7}} -- posição começo e final da area } Fire_Days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","20:00","22:00"}, ["Wednesday"] = {"13:00","18:00","20:00","22:00"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","20:00","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeFireTp() local t = getTileItemById(Fire.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(Fire.teleport[1], CONST_ME_POFF) end function ZerarStorFire() setGlobalStorageValue(Fire.storages[1], 0) setGlobalStorageValue(Fire.storages[2], 0) end function getPlayersInFireEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), Fire.arena[1], Fire.arena[2]) then t[#t+1] = pid end end return t end function getFireRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function doFireInArea(n) if #getPlayersInFireEvent() > 1 then for i = 1, n do local pos = {x=math.random(Fire.arena[1].x, Fire.arena[2].x), y=math.random(Fire.arena[1].y,Fire.arena[2].y), z=Fire.arena[1].z} local m = getTopCreature(pos).uid doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) if m ~= 0 and isPlayer(m) then doSendMagicEffect(getCreaturePosition(m), CONST_ME_FIREAREA) doCreatureSay(m, "Ooh Burn Burn", TALKTYPE_ORANGE_1) local corpse = doCreateItem(3058, 1, getPlayerPosition(m)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(m) .. ". He was killed by Fire Field.") doSendMagicEffect(getPlayerPosition(m), CONST_ME_POFF) doTeleportThing(m, getTownTemplePosition(getPlayerTown(m))) doPlayerSendTextMessage(m, MESSAGE_EVENT_ADVANCE, "[Fire Storm Event] You died burned out.") end end local x = 2700-(200*n) addEvent(doFireInArea, x <= 0 and 500 or x, n+1) elseif #getPlayersInFireEvent() == 1 then local cid = getPlayersInFireEvent()[1] doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) getFireRewards(cid, Fire.rewards) doBroadcastMessage("Fire Storm Event have finished. The winner is ".. getCreatureName(cid).. ". Congratulations.", MESSAGE_EVENT_ADVANCE) ZerarStorFire() else doBroadcastMessage("No one Won the Fire Storm Event.", MESSAGE_EVENT_ADVANCE) ZerarStorFire() end end function CheckFireEvent(delay) if getGlobalStorageValue(Fire.storages[1]) ~= (Fire.players.max+1) then if delay > 0 and getGlobalStorageValue(Fire.storages[1]) < Fire.players.max then doBroadcastMessage("[Fire Stortm Event] Starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(Fire.storages[1]) < Fire.players.min then for _, cid in pairs(getPlayersInFireEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end removeFireTp() doBroadcastMessage("The Fire Storm event could not start because of to few players participating.\n At least " .. Fire.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStorFire() elseif delay == 0 and getGlobalStorageValue(Fire.storages[1]) >= Fire.players.min then removeFireTp() doBroadcastMessage("Good Lucky! The event will start on "..Fire.timeToStartEvent.." seconds. get ready!") addEvent(doFireInArea, Fire.timeToStartEvent*1000, 1) end addEvent(CheckFireEvent, 60000, delay-1) end end ]]></config> <globalevent name="Storm_Fire_Start" interval="60" event="script"><![CDATA[ domodlib('fire_config') function onThink(interval, lastExecution) if Fire_Days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(Fire_Days[os.date("%A")], hrs) and getGlobalStorageValue(Fire.storages[2]) <= 0 then local tp = doCreateItem(1387, 1, Fire.teleport[1]) doItemSetAttribute(tp, "aid", 45111) CheckFireEvent(Fire.CheckTime) setGlobalStorageValue(Fire.storages[1], 0) end end return true end]]></globalevent> <event type="login" name="Storm_Fire_Login" event="script"><![CDATA[ domodlib('fire_config') function onLogin(cid) registerCreatureEvent(cid, "FireStormBatle") if isInRange(getPlayerPosition(cid), Fire.arena[1], Fire.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="FireStormBatle" event="script"><![CDATA[ domodlib('fire_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), Fire.arena[1], Fire.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="45111" event="script"><![CDATA[ domodlib('fire_config') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, Fire.teleport[2]) end if getPlayerLevel(cid) < Fire.minLevel then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. Fire.minLevel .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(Fire.storages[1]) <= Fire.players.max then doTeleportThing(cid, Fire.teleport[2]) setGlobalStorageValue(Fire.storages[1], getGlobalStorageValue(Fire.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the fire stortm event! Currently " .. getGlobalStorageValue(Fire.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(Fire.storages[1]) == Fire.players.max then setGlobalStorageValue(Fire.storages[1], getGlobalStorageValue(Fire.storages[1])+1) removeFireTp() doBroadcastMessage("The event will start on "..Fire.timeToStartEvent.." seconds. get ready!") addEvent(doFireInArea, Fire.timeToStartEvent*1000, 1) end end return true end]]></movevent> <talkaction words="/firestart;!firestart" access="5" event="buffer"><![CDATA[ domodlib('fire_config') if getGlobalStorageValue(Fire.storages[2]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, Fire.teleport[1]) doItemSetAttribute(tp, "aid", 45111) CheckFireEvent(tonumber(param)) setGlobalStorageValue(Fire.storages[1], 0) setGlobalStorageValue(Fire.storages[2], 1) ]]></talkaction> <globalevent name="FireDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('fire_config') ZerarStorFire() return true]]></globalevent> </mod>
A configuração está explicita na lib do mods... valeu!
fire lua.rar
-
Lovecraft deu reputação a Vodkart em Simple Task 3.008/01/2017
SISTEMA ATUALIZADO PARA 4.0:
Mods:
-
Lovecraft deu reputação a Vodkart em [Sistema] Battlefield Event! V.1Mapa BattleField Feito Por AnneMotta :
Mapa Battlefield.rar
Scan: https://www.virustot...sis/1346548669/
Imagens do mapa
Descrição:
- O evento é automático e acontece em determinado dia e hora da semana
- Logo após é aberto um teleport então apenar um número limitado de players entra no evento
- São formados por dois times, os "Black Assassins" e os "Red Barbarians"
- Os times são balanceados automaticamente, quando o último jogador entra, esse teleport é fechado e depois de 5 minutos o evento começa, os 5 minutos são para os players ter tempo de planejar um ataque.
- O sistema tem por finalidade matar todos do time inimigo, e os players que sobreviverem recebem um prêmio.
Bônus:
- Durante o evento é mostrado na tela somente dos jogadores que estão no evento um placar de times.
- Até o último player entrar no evento, ficam mandando broadcast dizendo quanto players faltam para dar inicio ao jogo.
- Se o evento abrir e não atingir a meta de players colocada, o evento é finalizado e os players voltam para o templo.
Lembre-se:
- De colocar Pvp Tool na área
- De colocar área NoLogout
Imagens:
Instalação:
Data > Lib Data > CreatureScript > Script Data > GlobalEvents > Scripts Data > Movements > Script Configurações do evento -
Lovecraft deu reputação a Caronte em (Resolvido)[PEDIDO] Nascer respawn com player na telaIsso precisa ser feito nas source, e compilar novamente com o arquivo spawn.cpp editado.
Se quiser, siga o tutorial abaixo:
Em spawn.cpp
Procure por
bool Spawn::findPlayer(const Position& pos) E no lugar de:
bool Spawn::findPlayer(const Position& pos) { SpectatorVec list; g_game.getSpectators(list, pos); Player* tmpPlayer = NULL; for(SpectatorVec::iterator it = list.begin(); it != list.end(); ++it) { if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->hasFlag(PlayerFlag_IgnoredByMonsters)) return true; } return false; } Coloque:
bool Spawn::findPlayer(const Position& pos) { SpectatorVec list; g_game.getSpectators(list, pos); Player* tmpPlayer = NULL; for(SpectatorVec::iterator it = list.begin(); it != list.end(); ++it) { if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->hasFlag(PlayerFlag_IgnoredByMonsters)) return false; } return false; } Pronto, irá spawnar com ou sem player na tela, já foi testado por mim.