Guest User

Untitled

a guest
Oct 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.63 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <mod name="Team War" version="1.0" author="-----" contact="otland.net" enabled="yes">
  3.    <description>
  4.         This should teleport all players to a new random town in intervals and add them into a team.
  5.    </description>
  6.     <config name="config"><![CDATA[
  7.     config = {
  8.             a = getPlayerStorageValue(cid, 6666),
  9.             b = getPlayerStorageValue(cid, 6667),
  10.             d = getPlayerStorageValue(target, 6667),
  11.             f = getPlayerStorageValue(target, 6666),
  12.             t1 = "fagarians", -- blue team name
  13.             t2 = "homosexualsins", -- red team name
  14.             gstg = 7000,
  15.         t1stg = 6666,
  16.         t2stg = 6667,
  17.             access = 3, -- minimum access to bypass teleportation.
  18.         temples = {1,2,3} --townids to teleport to.
  19.         }
  20.  ]]></config>
  21. domodlib('config')
  22.    <event type="login" name="tlog" event="script"><![CDATA[
  23. local conditionBlue = createConditionObject(CONDITION_OUTFIT)
  24.         setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, 1800 * 1000)
  25.         addOutfitCondition(conditionBlue, {lookType = 152, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})
  26. local conditionRed = createConditionObject(CONDITION_OUTFIT)
  27.         setConditionParam(conditionRed, CONDITION_PARAM_TICKS, 1800 * 1000)
  28.         addOutfitCondition(conditionRed, {lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})
  29.  
  30. function onLogin(cid)
  31.     if getPlayerGroupId(cid) < 3 then
  32.        if getGlobalStorageValue(config.gstg) == 1 then
  33.             doAddCondition(cid, conditionRed)
  34.         setPlayerStorageValue(cid, config.t1stg, 1)
  35.         doPlayerSendTextMessage(cid, 21, "You're going to fight for the "..config.t1.." so pew the shit out of the "..config.t2.."")
  36.         setGlobalStorageValue(config.gstg, -1)
  37.                 else
  38.             doAddCondition(cid, conditionBlue)
  39.             setPlayerStorageValue(cid, config.t2stg, 1)
  40.             doPlayerSendTextMessage(cid, 21, "You're going to fight for the "..config.t2.." so pew the shit out of the "..config.t1.."")
  41.             setGlobalStorageValue(config.gstg, 1)
  42.            end
  43.       end
  44. return TRUE
  45. end
  46. ]]></event>
  47.    <event type="logout" name="tout" event="script"><![CDATA[
  48. domodlib('config')
  49. function onLogout(cid)
  50.     if config.a == 1 then
  51.     doBroadCastMessage("it works nigguh", MESSAGE_STATUS_WARNING)
  52.     setPlayerStorageValue(cid, config.t1stg, -1)
  53.         setGlobalStorageValue(config.gstg, 1)
  54.     elseif config.b == 1 then
  55.     setPlayerStorageValue(cid, config.t2stg, -1)
  56.         setGlobalStorageValue(config.gstg, -1)
  57.     end
  58. return true
  59. end
  60. ]]></event>
  61.    <event type="death" name="tded" event="script"><![CDATA[
  62. domodlib('config')
  63. function onDeath(cid, corpse, killer)
  64.     if config.a == 1 then
  65.     setPlayerStorageValue(cid, config.t1stg, -1)
  66.         setGlobalStorageValue(config.gstg, 1)
  67.     elseif config.b == 1 then
  68.     setPlayerStorageValue(cid, config.t2stg, -1)
  69.         setGlobalStorageValue(config.gstg, -1)
  70.     end
  71. return true
  72. end
  73. ]]></event>
  74.    <event type="combat" name="tcom" event="script"><![CDATA[
  75. domodlib('config')
  76. function onCombat(cid, target)
  77.     if isPlayer(cid) and isPlayer(target) then
  78.         if config.a == 1 and config.f == 1 then
  79.             return doPlayerSendCancel(cid, "You may not attack your teammates.") and false
  80.         elseif config.b == 1 and config.d == 1 then
  81.             return doPlayerSendCancel(cid, "You may not attack your teammates.") and false
  82.         end
  83.     end
  84.     return true
  85. end
  86.  
  87. ]]></event><event type="login" name="Map Login" event="script"><![CDATA[
  88.     function onLogin(cid)
  89.         doPlayerSetTown(cid, getGlobalStorageValue(3454))
  90.         doTeleportThing(cid, getPlayerMasterPos(cid))
  91.     return true
  92.     end
  93. ]]></event>
  94.     <globalevent name="Map Change" interval="1200000" event="script"><![CDATA[
  95.     domodlib('config')
  96.         function onThink(interval, lastExecution, thinkInterval)
  97.             repeat
  98.                 RDM = math.random(1,#config.temples)
  99.             until RDM ~= getGlobalStorageValue(3454) and isInArray(config.temples, RDM)
  100.             for _, pid in ipairs(getPlayersOnline()) do
  101.                 if getPlayerAccess(pid) < config.access then
  102.                         doPlayerSetTown(pid, config.temples[RDM])
  103.                         doTeleportThing(pid, getTownTemplePosition(config.temples[RDM]), false)
  104.                         doSendMagicEffect(getCreaturePosition(pid), 37)
  105.                         doRemoveCondition(pid, CONDITION_INFIGHT)
  106.                         doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
  107.                         doCreatureAddMana(pid, (getCreatureMaxMana(pid) - getCreatureMana(pid)))
  108.                             doBroadcastMessage("Map has been changed! next map change will be in 20 minutes! have a nice fight!", MESSAGE_STATUS_WARNING)
  109.                         setGlobalStorageValue(3454, config.temples[RDM])
  110.                 end
  111.             end
  112.         return true
  113.         end
  114. ]]></globalevent>  
  115. </mod>
Add Comment
Please, Sign In to add comment