Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <mod name="Team War" version="1.0" author="-----" contact="otland.net" enabled="yes">
- <description>
- This should teleport all players to a new random town in intervals and add them into a team.
- </description>
- <config name="config"><![CDATA[
- config = {
- a = getPlayerStorageValue(cid, 6666),
- b = getPlayerStorageValue(cid, 6667),
- d = getPlayerStorageValue(target, 6667),
- f = getPlayerStorageValue(target, 6666),
- t1 = "fagarians", -- blue team name
- t2 = "homosexualsins", -- red team name
- gstg = 7000,
- t1stg = 6666,
- t2stg = 6667,
- access = 3, -- minimum access to bypass teleportation.
- temples = {1,2,3} --townids to teleport to.
- }
- ]]></config>
- domodlib('config')
- <event type="login" name="tlog" event="script"><![CDATA[
- local conditionBlue = createConditionObject(CONDITION_OUTFIT)
- setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, 1800 * 1000)
- addOutfitCondition(conditionBlue, {lookType = 152, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})
- local conditionRed = createConditionObject(CONDITION_OUTFIT)
- setConditionParam(conditionRed, CONDITION_PARAM_TICKS, 1800 * 1000)
- addOutfitCondition(conditionRed, {lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})
- function onLogin(cid)
- if getPlayerGroupId(cid) < 3 then
- if getGlobalStorageValue(config.gstg) == 1 then
- doAddCondition(cid, conditionRed)
- setPlayerStorageValue(cid, config.t1stg, 1)
- doPlayerSendTextMessage(cid, 21, "You're going to fight for the "..config.t1.." so pew the shit out of the "..config.t2.."")
- setGlobalStorageValue(config.gstg, -1)
- else
- doAddCondition(cid, conditionBlue)
- setPlayerStorageValue(cid, config.t2stg, 1)
- doPlayerSendTextMessage(cid, 21, "You're going to fight for the "..config.t2.." so pew the shit out of the "..config.t1.."")
- setGlobalStorageValue(config.gstg, 1)
- end
- end
- return TRUE
- end
- ]]></event>
- <event type="logout" name="tout" event="script"><![CDATA[
- domodlib('config')
- function onLogout(cid)
- if config.a == 1 then
- doBroadCastMessage("it works nigguh", MESSAGE_STATUS_WARNING)
- setPlayerStorageValue(cid, config.t1stg, -1)
- setGlobalStorageValue(config.gstg, 1)
- elseif config.b == 1 then
- setPlayerStorageValue(cid, config.t2stg, -1)
- setGlobalStorageValue(config.gstg, -1)
- end
- return true
- end
- ]]></event>
- <event type="death" name="tded" event="script"><![CDATA[
- domodlib('config')
- function onDeath(cid, corpse, killer)
- if config.a == 1 then
- setPlayerStorageValue(cid, config.t1stg, -1)
- setGlobalStorageValue(config.gstg, 1)
- elseif config.b == 1 then
- setPlayerStorageValue(cid, config.t2stg, -1)
- setGlobalStorageValue(config.gstg, -1)
- end
- return true
- end
- ]]></event>
- <event type="combat" name="tcom" event="script"><![CDATA[
- domodlib('config')
- function onCombat(cid, target)
- if isPlayer(cid) and isPlayer(target) then
- if config.a == 1 and config.f == 1 then
- return doPlayerSendCancel(cid, "You may not attack your teammates.") and false
- elseif config.b == 1 and config.d == 1 then
- return doPlayerSendCancel(cid, "You may not attack your teammates.") and false
- end
- end
- return true
- end
- ]]></event><event type="login" name="Map Login" event="script"><![CDATA[
- function onLogin(cid)
- doPlayerSetTown(cid, getGlobalStorageValue(3454))
- doTeleportThing(cid, getPlayerMasterPos(cid))
- return true
- end
- ]]></event>
- <globalevent name="Map Change" interval="1200000" event="script"><![CDATA[
- domodlib('config')
- function onThink(interval, lastExecution, thinkInterval)
- repeat
- RDM = math.random(1,#config.temples)
- until RDM ~= getGlobalStorageValue(3454) and isInArray(config.temples, RDM)
- for _, pid in ipairs(getPlayersOnline()) do
- if getPlayerAccess(pid) < config.access then
- doPlayerSetTown(pid, config.temples[RDM])
- doTeleportThing(pid, getTownTemplePosition(config.temples[RDM]), false)
- doSendMagicEffect(getCreaturePosition(pid), 37)
- doRemoveCondition(pid, CONDITION_INFIGHT)
- doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
- doCreatureAddMana(pid, (getCreatureMaxMana(pid) - getCreatureMana(pid)))
- doBroadcastMessage("Map has been changed! next map change will be in 20 minutes! have a nice fight!", MESSAGE_STATUS_WARNING)
- setGlobalStorageValue(3454, config.temples[RDM])
- end
- end
- return true
- end
- ]]></globalevent>
- </mod>
Add Comment
Please, Sign In to add comment