• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

HELP PLEASE CONVERT TO TFS 1.2

Fabio Martins

New Member
Joined
Jul 25, 2014
Messages
8
Reaction score
0
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.

-- //

COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas)
COH_AREA = {{x = 32458, y = 32332, z = 7}, {x = 32558, y = 32429, z = 7}} -- Canto superior esquerdo / inferior direito do Castle

-- // Não mexa daqui para baixo
COH_STATUS = 201320111714
COH_PREPARE1 = 201320111715
COH_PUSHSTOR = 201320111716
COH_PREPARE2 = 201320111717

function doCastleRemoveEnemies()

for index, creature in ipairs(getPlayersOnline()) do
if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then
if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then
doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature)))
end
end
end
return true
end

-------------------------------------------------------------------------

-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.

-- //

function onStepIn(cid, item, pos, fromPosition)
local pos = getThingPos(cid)

if item.actionid == 16203 then
if not isPlayer(cid) then
return true
end
if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
doSendMagicEffect(getThingPos(cid), 14)
doSendAnimatedText(pos, "CoH", math.random(1, 255))
else
doSendMagicEffect(getThingPos(cid), 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".")
end
return true
end

if item.actionid == 16202 then
if not isPlayer(cid) then
return true
end

if getPlayerGuildId(cid) > 0 then
if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
setGlobalStorageValue(COH_PREPARE1, -1)
setGlobalStorageValue(COH_PREPARE2, -1)
setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
doCastleRemoveEnemies()
doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
end
else
doSendMagicEffect(pos, 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
end
return true
end

if item.actionid == 16200 then
if not isPlayer(cid) then
return true
end
if getPlayerGuildId(cid) > 0 then
doSendAnimatedText(pos, "CoH", math.random(1, 255))
if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
end
else
doSendMagicEffect(pos, 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
return true
end
end

if item.actionid == 16201 then
if not isPlayer(cid) then
return true
end
doSendAnimatedText(pos, "CoH", math.random(1, 255))
if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
end
end
return true
end

Please see this post, also use code tags for code thanks.
https://otland.net/threads/update-script-to-tfs-1-2.246658/#post-2399658

i can ..
please update for me ?
 
Last edited by a moderator:
@up
help pleae

@up help me please people i disponibilize later all scripts for the event 1.2 ... help me please

@up please help !!!!!

@up
 
Last edited by a moderator:
Code:
-- //

COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas)
COH_AREA = {{x = 32458, y = 32332, z = 7}, {x = 32558, y = 32429, z = 7}} -- Canto superior esquerdo / inferior direito do Castle

-- // Não mexa daqui para baixo
COH_STATUS = 201320111714
COH_PREPARE1 = 201320111715
COH_PUSHSTOR = 201320111716
COH_PREPARE2 = 201320111717

function doCastleRemoveEnemies()

 for index, creature in ipairs(getPlayersOnline()) do
  if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then
   if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then
    doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature)))
   end
  end
end
return true
end

Code:
-- //

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)

if item.actionid == 16203 then
  if not isPlayer(cid) then
      return true
  end
  if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "CoH", math.random(1, 255))
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".")
  end
  return true
end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
 
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
          doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
       setGlobalStorageValue(COH_PREPARE1, -1)
       setGlobalStorageValue(COH_PREPARE2, -1)
       setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
       doCastleRemoveEnemies()
    doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
      end
     else
   doSendMagicEffect(pos, 2) 
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
   end
      return true
end

    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "CoH", math.random(1, 255))
   if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
    setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
    doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2) 
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")   
   return true
  end   
end

if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "CoH", math.random(1, 255))
  if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
   setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
   doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
  end
end
return true
end

@up
codes ... please help for tfs 1.2

skype juninho_panico
 
Last edited by a moderator:
You can convert it by yourself, just check out your compat.lua.
Look:
Code:
--from:
setGlobalStorageValue(value, int)
doTeleportThing(cid, pos, params)
doBroadcastMessage(message)
getGlobalStorageValue(value)
doPlayerSendCancel(cid, message)
getPlayersOnline()

--to:
Game.setStorageValue(value, int)
player:teleportTo(Position(pos))
Game.broadcastMessage(message)
Game.getStorageValue(value)
player:sendCancelMessage(message)
Game.getPlayers()
respectively.
 
Back
Top