-
[Sistema] Battlefield Event! V.1
Boa noite, O script está funcionando, porem quando termina o evento, ele n adiciona as parades novamentes, alguem pode me ajudar por favor? segue o LIB: _Lib_Battle_Info = { Reward = { exp = {false, 0}, items = {true, 9020, 50}, premium_days = {false, 0} }, TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=32505,y=32540,z=7}}, TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=32546,y=32538,z=7}}, storage_count = 180400, tpPos = {x=32365, y=32232, z=7}, limit_Time = 5 -- limite de tempo para adentrar o evento } function resetBattle() setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) end function OpenWallBattle() local B = { {1541,{x=32525, y=32540, z=6, stackpos = 1}}, {1542,{x=32525, y=32541, z=6, stackpos = 1}}, {1543,{x=32525, y=32542, z=6, stackpos = 1}}, {1544,{x=32525, y=32543, z=6, stackpos = 1}}, {1545,{x=32518, y=32528, z=6, stackpos = 1}}, {1546,{x=32518, y=32529, z=6, stackpos = 1}}, {1547,{x=32529, y=32528, z=6, stackpos = 1}}, {1548,{x=32529, y=32529, z=6, stackpos = 1}} } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid == 0 then doRemoveItem(getThingfromPos(B[i][2]).uid,1) else doCreateItem(B[i][1], 1, B[i][2]) end end end function doBroadCastBattle(type, msg) for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then doPlayerSendTextMessage(cid,type,msg) end end end function removeBattleTp() local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF) end function getWinnersBattle(storage) local str, c = "" , 0 for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, storage) == 1 then if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, storage, -1) c = c+1 end end str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!" resetBattle() OpenWallBattle() return doBroadcastMessage(str) end function CheckEvent(delay) if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts") elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1) setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1) end end doBroadcastMessage("The event cannot be started because not had enough players.") setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0) resetBattle() removeBattleTp() end addEvent(CheckEvent, 60000, delay-1) end
-
[AJUDA] BATTLEFIELD SCRIPT - WALLS
Boa noite, Eu adicionei o script do Vodkart no meu ot, o famoso Battlefield, funcionou tudo corretamente, porem há um problema, o script funciona normal, ao matar os players, todos são teleportados para o templo e o time ganhador ganha os premios, porem as paredes que separam os times não são adicionadas novamente, elas somem quando começa o evento, porem quando termina, não são adicionadas novamente, então na próxima vez que o evento rodar, vai bugar, pq n vai ter a parede lá separando os times até o evento começar, abaixo segue o script da LIB: _Lib_Battle_Info = { Reward = { exp = {false, 0}, items = {true, 9020, 50}, premium_days = {false, 0} }, TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=32505,y=32540,z=7}}, TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=32546,y=32538,z=7}}, storage_count = 180400, tpPos = {x=32365, y=32232, z=7}, limit_Time = 5 -- limite de tempo para adentrar o evento } function resetBattle() setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) end function OpenWallBattle() local B = { {1541,{x=32525, y=32540, z=6, stackpos = 1}}, {1542,{x=32525, y=32541, z=6, stackpos = 1}}, {1543,{x=32525, y=32542, z=6, stackpos = 1}}, {1544,{x=32525, y=32543, z=6, stackpos = 1}}, {1545,{x=32518, y=32528, z=6, stackpos = 1}}, {1546,{x=32518, y=32529, z=6, stackpos = 1}}, {1547,{x=32529, y=32528, z=6, stackpos = 1}}, {1548,{x=32529, y=32529, z=6, stackpos = 1}} } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid == 0 then doRemoveItem(getThingfromPos(B[i][2]).uid,1) else doCreateItem(B[i][1], 1, B[i][2]) end end end function doBroadCastBattle(type, msg) for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then doPlayerSendTextMessage(cid,type,msg) end end end function removeBattleTp() local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF) end function getWinnersBattle(storage) local str, c = "" , 0 for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, storage) == 1 then if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, storage, -1) c = c+1 end end str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!" resetBattle() OpenWallBattle() return doBroadcastMessage(str) end function CheckEvent(delay) if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts") elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1) setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1) end end doBroadcastMessage("The event cannot be started because not had enough players.") setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0) resetBattle() removeBattleTp() end addEvent(CheckEvent, 60000, delay-1) end Alguém poderia me ajudar por favor? preciso que essas paredes voltem a aparecer, nem que seja por meio de gambiarra. Obrigado.
-
[DUVIDA] NPC DE RUNAS / BUY WITH BACKPACK
ngm?
-
[DUVIDA] NPC DE RUNAS / BUY WITH BACKPACK
isso, porem já tentei de tudo e n vai
-
[DUVIDA] NPC DE RUNAS / BUY WITH BACKPACK
ngm não tem nenhuma ideia de como resolver, se é na source, na lib? eu tbm tentei por pra vender bp de mp e runas, tipo HI, BP OF MP, YES, e o npc n faz nada, acredito que n seja exatamente o script do npc e sim algo na source ou lib, alguem pode me ajudar por favor?
-
[DUVIDA] AO MATAR MONSTER, DAR STORAGE PARA TODOS
Boa noite, Estou com um problema, eu preciso que todos que matarem X monster, ganhem uma storage, porem só o player que dá o ultimo hit tá ganhando a storage, precisava de uma que todo que ajudaram a matar ganhasse a storage, podem me ajudar por favor? segue o código: function onDeath(cid, corpse, killer) local monstName = "Demon" -- nome do monstro local Storage = 30003 -- storage que o jogador ira ganhar if isMonster(cid) then if string.lower(getCreatureName(cid)) == string.lower(monstName) then setPlayerStorageValue(killer[1], Storage, 1) end end return TRUE end Obrigado.
-
DECREASE FRAG / BUG FRAG
Bom dia, Pessoal, é o seguinte, estou com um bug nos frags, vamos supor que coloquei para pegar red skull com 10 frags, o player pega 10 injusts e fica red, até ai tudo bem, a red skull dele sai dps de um tempo, porem os frags não estão saindo, então se ele volta a pegar só um injust, ele fica red novamente, os frags estão demorando de mais para sair, e era para sair junto com o red.. no meu antigo distro, tinha uma função de timedecreasefrag, onde eu colocava um tempo para cada frag sair, nessa nova distro, n encontrei nada do tipo e a função não funciona nela, eu precisava de alguma solução para remover os frags corretamente... segue meu player.cpp com a parte dos frags: bool Player::addUnjustifiedKill(const Player* attacked, bool countNow) { if(!g_config.getBool(ConfigManager::USE_FRAG_HANDLER) || hasFlag( PlayerFlag_NotGainInFight) || g_game.getWorldType() != WORLDTYPE_OPEN || hasCustomFlag(PlayerCustomFlag_NotGainUnjustified) || hasCustomFlag( PlayerCustomFlag_NotGainSkull) || attacked == this) return false; if(client && countNow) { char buffer[90]; sprintf(buffer, "Warning! The murder of %s was not justified.", attacked->getName().c_str()); client->sendTextMessage(MSG_STATUS_WARNING, buffer); } time_t now = time(NULL), today = (now - 84600), week = (now - (7 * 84600)); std::vector<time_t> dateList; IOLoginData::getInstance()->getUnjustifiedDates(guid, dateList, now); if(countNow) dateList.push_back(now); uint32_t tc = 0, wc = 0, mc = dateList.size(); for(std::vector<time_t>::iterator it = dateList.begin(); it != dateList.end(); ++it) { if((*it) > week) wc++; if((*it) > today) tc++; } uint32_t d = g_config.getNumber(ConfigManager::RED_DAILY_LIMIT), w = g_config.getNumber( ConfigManager::RED_WEEKLY_LIMIT), m = g_config.getNumber(ConfigManager::RED_MONTHLY_LIMIT); if(skull < SKULL_RED && ((d > 0 && tc >= d) || (w > 0 && wc >= w) || (m > 0 && mc >= m))) setSkullEnd(now + g_config.getNumber(ConfigManager::RED_SKULL_LENGTH), false, SKULL_RED); if(!g_config.getBool(ConfigManager::USE_BLACK_SKULL)) { d += g_config.getNumber(ConfigManager::BAN_DAILY_LIMIT); w += g_config.getNumber(ConfigManager::BAN_WEEKLY_LIMIT); m += g_config.getNumber(ConfigManager::BAN_MONTHLY_LIMIT); if((d <= 0 || tc < d) && (w <= 0 || wc < w) && (m <= 0 || mc < m)) return true; if(!IOBan::getInstance()->addAccountBanishment(accountId, (now + g_config.getNumber( ConfigManager::KILLS_BAN_LENGTH)), 20, ACTION_BANISHMENT, "Unjustified player killing.", 0, guid)) return true; sendTextMessage(MSG_INFO_DESCR, "You have been banished."); g_game.addMagicEffect(getPosition(), MAGIC_EFFECT_WRAPS_GREEN); Scheduler::getInstance().addEvent(createSchedulerTask(1000, boost::bind( &Game::kickPlayer, &g_game, getID(), false))); } else { d += g_config.getNumber(ConfigManager::BLACK_DAILY_LIMIT); w += g_config.getNumber(ConfigManager::BLACK_WEEKLY_LIMIT); m += g_config.getNumber(ConfigManager::BLACK_MONTHLY_LIMIT); if(skull < SKULL_BLACK && ((d > 0 && tc >= d) || (w > 0 && wc >= w) || (m > 0 && mc >= m))) { setSkullEnd(now + g_config.getNumber(ConfigManager::BLACK_SKULL_LENGTH), false, SKULL_BLACK); setAttackedCreature(NULL); destroySummons(); } } return true; } Se alguem puder me ajudar, eu agradeceria muito. Obrigado.
-
[BUG] TALKACTIONS CITYWAR.LUA
Boa tarde, Instalei o citywar no meu server ( war anti-entrosa ), porem está com 2 bugs, o primeiro que é o mais critico, é que a primeira war funciona normalmente, os players dão /citywar go e vão para a cidade privada, porem na segunda vez, funciona também normalmente, porem na hora de usar o /citywar go dá um erro na distro e o comando não funciona para o player. Esse comando só volta a funcionar, quando do reload nas talkactions, segue a img do erro: O citywar.lua talkactions: -- /citywar invite, guild, cidade, numero, modo, tempo local function cityWarInvite(cid, param) local guildId = getGuildId(param[2]) if guildId == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid guild name.") return false end if guildId == getPlayerGuildId(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid guild invite.") return false end if isGuildAntiEntrosa(guildId) or isGuildAntiEntrosa(getPlayerGuildId(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Guild already on war.") return false end local nomeB = param[2] --if not cityWarExtraRequirements(cid, guildId) then --return false --end local ret, instance = isInAnyArray(War.cidade_string, param[3]) if ret then instanceid = Instance:getFree(instance) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid city name.") return false end local numero = 0 if tonumber(param[4]) and isInAnyArray(War.numero, tonumber(param[4])) then numero = tonumber(param[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid number of players.") return false end local ret, modo = isInAnyArray(War.modo_string, param[5]) if not ret then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid type name.") return false end local preco, tempo = 0, 0 if tonumber(param[6]) then tempo = tonumber(param[6]) ret, preco = isInAnyArray(War.tempo, tonumber(param[6])) if not ret then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid duration time.") return false end if not doPlayerWithdrawMoney(cid, War.preco[preco]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough money.") return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid duration time.") return false end local config = { desafiante = cid, nomeA = getPlayerGuildName(cid), nomeB = nomeB, tempo = tempo, valor = War.preco[preco], modo = modo, numero = numero, cidade = instance, instanceid = instanceid, guildA = getPlayerGuildId(cid), guildB = guildId } Wars(config) end -- /citywar accept, guild local function cityWarAccept(cid, param) local selfGuild = getPlayerGuildId(cid) local invitingGuild = getGuildId(param[2]) for _, v in pairs(Wars) do if type(v) == 'table' then if v:isGuildOnWar(invitingGuild) and v:isGuildOnWar(selfGuild) then if doPlayerWithdrawMoney(cid, v.valor) then v:start() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough money.") end end end end end -- /citywar go local function cityWarGo(cid) selfGuild = getPlayerGuildId(cid) for _, v in pairs(Wars) do if not v == false then if v:isGuildOnWar(selfGuild) then if getTileInfo(getThingPosition(cid)).protection == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please go to a protection zone.") return true end return v:newPlayer(cid) end end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your guild is not in a war.") end -- /citywar exit local function cityWarExit(cid) if getPlayerWarType(cid) <= 0 then return false end selfGuild = getPlayerGuildId(cid) for _, v in pairs(Wars) do if type(v) == 'table' then if v:isGuildOnWar(selfGuild) then if getTileInfo(getThingPosition(cid)).protection == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please go to a protection zone.") return true end v:removePlayer(cid) end end end end function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local comando = t[1] if comando == "accept" then if isGuildLeader(cid) then if getPlayerWarType(cid) < 1 then cityWarAccept(cid, t) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already in a war.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not a guild leader.") end elseif comando == "invite" then if isGuildLeader(cid) then if getPlayerWarType(cid) < 1 then cityWarInvite(cid, t) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already in a war.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not a guild leader.") end elseif comando == "go" then if not cityWarGo(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player number limit reached.") end elseif comando == "exit" then if not cityWarExit(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not in war.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid command param.") end return true end E o segundo bug, não tão critico, mas que atrapalha muito, é que quando uso o /citywar exit, para o player sair da cidade privada, ele fala que o player não está em war, mesmo estando. Alguem pode me ajudar por favor? Obrigado.
-
[DUVIDA]
Gostaria de editar aquele nome do server que aparece no otservlist, por exemplo OTX 1.2 e colocar o nome do meu servidor, MEUSERVIDOR 1.2, procurei o resources.h, porem não achei ele, alguem item ideia de onde mudo isso no tfs 0.4 rev 3777? Obrigado.
-
[DUVIDA] ENTRADA HOUSE
tfs 0.4 3777
-
[DUVIDA] MENU SITE GESIOR
Bom dia, estou com o seguinte problema, os menus que adicionei em meu gesior, VIDEOS E ABOUT TIBIA ficam abertos quando se entra no site, como segue na imagem: o correto seria ficar assim quando entra no site: Alguém sabe como arrumo isto? Obrigado.
-
[DUVIDA] ENTRADA HOUSE
ok, fico no aguardo
-
[DUVIDA] ENTRADA HOUSE
eu estava com essa duvida, porem acho que o megatibia mesmo não dá para puxar, será que tem algo que dá para fazer?
-
[DUVIDA] ENTRADA HOUSE
Boa noite, Em meu OT, os players que não são dono da house, conseguem puxar item no local onde fica a porta (entrada) da house: tem como resolver e bloquear isso? Obrigado.
-
[DUVIDA] NPC DE RUNAS / BUY WITH BACKPACK
Quando tento comprar algum item que seja RUNA, FLUIDO, OU QUE TENHA CHARGE,o npc não deixa eu comprar ele com backpack, e queria que comprasse com backpack tambem, caso eu colocasse buy with backpack no cliente, eu dei uma olhada e a unica coisa que achei a respeito, foi esses códigos no module dos npcs: if(SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE) then if(itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) or isItemFluidContainer(itemid)) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else self:addBuyableItem(nil, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', itemid, cost) end elseif(name ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) or isItemFluidContainer(itemid)) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else if(name ~= nil and container ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) or isItemFluidContainer(itemid)) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else local names = {} table.insert(names, name) self:addBuyableItemContainer(names, container, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, container, itemid, cost) end local names = {} table.insert(names, name) self:addBuyableItem(names, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, itemid, cost) end Alguem pode me ajudar por favor? Obrigado.