Ir para conteúdo
Banner com Efeitos

L3K0T

Diretor
  • Registro em

  • Última visita

Tudo que L3K0T postou

  1. L3K0T postou uma resposta no tópico em Portal
    vou dar meu melhor! Agradeço pela oportunidade.
  2. recompila novamente no modo rebuild
  3. L3K0T postou uma resposta no tópico em Suporte Tibia OTServer
    function onStartup() local Dia = os.date("%A") if Dia == "Monday" then -- Segunda-Feira RashidPos = {x = 32309, y = 31156, z = 7} elseif Dia == "Tuesday" then -- Terça-Feira RashidPos = {x = 32302, y = 32832, z = 7} elseif Dia == "Wednesday" then -- Quarta-Feira RashidPos = {x = 32577, y = 32753, z = 7} elseif Dia == "Thursday" then -- Quinta-Feira RashidPos = {x = 33066, y = 32879, z = 6} elseif Dia == "Friday" then -- Sexta-Feira RashidPos = {x = 33240, y = 32484, z = 7} elseif Dia == "Saturday" then -- Sabado RashidPos = {x = 33166, y = 31811, z = 6} elseif Dia == "Sunday" then -- Domingo RashidPos = {x = 32329, y = 31786, z = 6} end doCreateNpc("Rashid", RashidPos) end <globalevent name="rashid" type="start" event="script" value="rashid.lua"/>
  4. L3K0T postou uma resposta no tópico em Sprites
    bem legal
  5. else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2; else if(tmpStr == "extendedopcode") m_type = CREATURE_EVENT_EXTENDED_OPCODE; else { std::cout << "[Error - CreatureEvent::configureEvent] No valid type for creature event." << str << std::endl; return false; }
  6. os créditos já está no tópico e outra fiz correções obg!!!
  7. baixa ai e testa da rebuild na source se der eerro na compilação posta o erro creatureevent.cpp game.cpp creatureevent.h @Spooky Ghost
  8. manda o creatureevet.cpp e .h e game.cpp eu posso colocar pra vc, agora n estou tão ocupada
  9. isso quer dizer que imoveitem2 não foi colocado na source direito, esqueceu algo sequiser posso fazer pra vc só manda o arquivos
  10. pra por em cima é o itemmove2 local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 6 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInteste(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue lixo no depot!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/> registerCreatureEvent(cid, "MoveItem2") se vc tá em adm no moveitem2 ele passa então esse bloqueia até adm
  11. Galera vo fazer o novo UPDATE moveitem2 - FEITO!
  12. TUTORIAL BY L3K0T PT~EN Olá pessoal, trago a vocês uma atualização que fiz no sistema, contendo 3 novas funcionalidades de movimentação de itens e uma proteção contra Elf Bot. Estas adições foram cuidadosamente implementadas para aperfeiçoar a experiência de jogo e manter a integridade do seu servidor. As novas funcionalidades têm a função vital de impedir que jogadores deixem itens indesejados em locais inapropriados, como na entrada de sua casa, em cima de seus depósitos ou em teleportes. Agora, apenas proprietários, subproprietários e convidados têm permissão para manipular itens nesses locais. Este pacote de atualização foi meticulosamente revisado para evitar abusos por parte de jogadores mal-intencionados e garantir um ambiente de jogo justo e equilibrado para todos os usuários. Iniciando o Tutorial 1Abra o arquivo "creatureevents.cpp" com o editor de sua preferência. Eu pessoalmente recomendo o Notepad++. Em creatureevents.cpp: return "onPrepareDeath"; Adicione abaixo: case CREATURE_EVENT_MOVEITEM: return "onMoveItem"; case CREATURE_EVENT_MOVEITEM2: return "onMoveItem2"; Em: return "cid, deathList"; Adicione abaixo: case CREATURE_EVENT_MOVEITEM: return "moveItem, frompos, topos, cid"; case CREATURE_EVENT_MOVEITEM2: return "cid, item, count, toContainer, fromContainer, fromPos, toPos"; Em: m_type = CREATURE_EVENT_PREPAREDEATH; Adicione abaixo: else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2; Procure por: bool CreatureEvents::playerLogout(Player* player, bool forceLogout) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGOUT && (*it)->isLoaded() && !(*it)->executeLogout(player, forceLogout) && result) result = false; } return result; } Adicione abaixo: uint32_t CreatureEvents::executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos) { // fire global event if is registered for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_MOVEITEM) { if(!(*it)->executeMoveItem(actor, item, frompos, pos)) return 0; } } return 1; } Em: bool CreatureEvents::playerLogin(Player* player) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGIN && (*it)->isLoaded() && !(*it)->executeLogin(player) && result) result = false; } if (result) { for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { CreatureEvent* event = *it; if(event->isLoaded() && ( event->getRegister() == "player" || event->getRegister() == "all") ) player->registerCreatureEvent(event->getName()); } } return result; } Adicione Abaixo: uint32_t CreatureEvent::executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos) { //onMoveItem(moveItem, frompos, position, cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(pos); std::stringstream scriptstream; env->streamThing(scriptstream, "moveItem", item, env->addThing(item)); env->streamPosition(scriptstream, "position", frompos, 0); env->streamPosition(scriptstream, "position", pos, 0); scriptstream << "local cid = " << env->addThing(actor) << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(pos); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); LuaInterface::pushThing(L, item, env->addThing(item)); LuaInterface::pushPosition(L, frompos, 0); LuaInterface::pushPosition(L, pos, 0); lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(4); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } uint32_t CreatureEvent::executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); //lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } Agora em em creatureevents.h: CREATURE_EVENT_PREPAREDEATH, Adicione abaixo: CREATURE_EVENT_MOVEITEM, CREATURE_EVENT_MOVEITEM2 Em: uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo: uint32_t executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack); Em: bool playerLogout(Player* player, bool forceLogout); Abaixo adicone também uint32_t executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack); Agora em em game.cpp: if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if(ret == RET_NOERROR) return true; player->sendCancelMessage(ret); return false; } Altere para: if (!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM2); for (CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if (!(*it)->executeMoveItem2(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if (!success) return false; if (g_config.getBool(ConfigManager::ANTI_PUSH)) { std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS); IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ",")); if (tmpVec[0] != 0) { for (IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it) { if (item->getID() == uint32_t(*it) && player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "Please wait a few seconds to move this item."); return false; } } } } int32_t delay = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY); if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, delay, 0, false, 1)) player->addCondition(condition); if (!g_creatureEvents->executeMoveItems(player, item, mapFromPos, mapToPos)) return false; ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if (ret != RET_NOERROR) { player->sendCancelMessage(ret); return false; } player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::ACTIONS_DELAY_INTERVAL) - 10); return true; } Agora em configmanager.h ADMIN_ENCRYPTION_DATA Adicione abaixo: ANTI_PUSH_ITEMS, em: STAMINA_DESTROY_LOOT, Adicione abaixo: ANTI_PUSH_DELAY, em: ADDONS_PREMIUM, Adicione abaixo: ANTI_PUSH Agora você pode compilar a Source. Configurando no servidor: Abra seu config.lua do servidor e adicione isso dentro qualquer lugar: -- Anti-Push useAntiPush = true antiPushItems = "2148,2152,2160,3976" antiPushDelay = 500 Navegue até o diretório 'creaturescripts' e localize o arquivo 'login.lua'. em resgistros de eventos adicione: login.lua registerCreatureEvent(cid, "MoveItem") registerCreatureEvent(cid, "MoveItem2") Agora abra o aquivo creaturescript .xml <event type="moveitem" name="MoveItem" event="script" value="houseprotecao.lua"/> <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/> Crie um novo arquivo lua em scripts com o nome houseprotecao.lua e adicione isso: function onMoveItem(moveItem, frompos, position, cid) if position.x == CONTAINER_POSITION then return true end local house = getHouseFromPos(frompos) or getHouseFromPos(position) --correção 100% if type(house) == "number" then local owner = getHouseOwner(house) if owner == 0 then return false, doPlayerSendCancel(cid, "Isso não é Possível.") end if owner ~= getPlayerGUID(cid) then local sub = getHouseAccessList(house, 0x101):explode("\n") local guest = getHouseAccessList(house, 0x100):explode("\n") local isInvited = false if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then isInvited = true end if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then isInvited = true end if not isInvited then return false, doPlayerSendCancel(cid, "Desculpe, você não está invitado.") end end end return true end Crie um novo arquivo lua em scripts com o nome moveitem2.lua e adicione isso abaixo: local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 3 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInArea(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue item ai!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end ajudei?? REP+ CRÉDITOS: @L3K0T Fir3element Summ Wise GOD Wille Yan Lima
  13. L3K0T postou uma resposta no tópico em Portal
    Gostaria de me inscrever para Assistente (Scripting/Web)
  14. Como diz o titulo? você pode gerar suas funções do seu tfs em um arquivo texto, para fazer isso é só ir na lib 050 e adicionar isso no final, depois é só ligar o seu servidor e assim todas funções do seu server vai aparecer no arquivo txt. "Isso é bom pra resolver problemas de scripts e trabalhar de forma melhor, com a manipulação do mesmo." function getLuaFunctions() local str = "" for f,k in pairs(_G) do if type(k) == 'function' then str = str..f..',' elseif type(k) == 'table' then for d,o in pairs(k) do if type(o) == 'function' then if f ~= '_G' and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..',' end elseif type(o) == 'table' then for m,n in pairs(o) do if type(n) == 'function' then if d == "_M" and m ~= "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..m.."," elseif f ~= '_G' and m ~= "_G" and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..m..',' end elseif type(n) == 'table' then for x,p in pairs(n) do if type(p) == 'function' then if m == "_M" and d ~= "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..x..',' elseif m == "_M" and d == "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..x..',' elseif m ~= "_M" and d == "_M" and f ~= "_G" and f ~= 'package' then str = str..f..'.'..m..'.'..x..',' elseif f ~= '_G' and m ~= "_G" and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..m..'.'..x..',' end end end end end end end end end return string.explode(str,',') end local k = getLuaFunctions() local file__ = io.open('funcoes do seu servidor.txt','w') table.sort(k) for i=1,#k do if k[i] ~= "" then file__:write((i-1)..' - '..k[i]..'\n') end end file__:close() Créditos: Mock
  15. vo passar o meu minGW ai se troca o seu, pelo meu a pasta do disco C https://www.mediafire.com/file/oc6w2t6cf40vhcd/MinGW.rar/file scan: https://www.virustotal.com/gui/file/42e501946ac775387e6a7491ac7f3ae6c72b1a5e4ef742d55637b0476a1e5ad2/detection
  16. L3K0T postou uma resposta no tópico em Portal
    boa sorte a todos!
  17. recompila usando a opção REBUILD
  18. TENTA DA "REBUILD" PRA COMPILAR A SOURCE NÃO CLICA EM BUILDER OLHA A SETA NA IMAGEM DO CODEBLOCK ou tenta por isso no game things do otclient em otclient-0.6.6\modules\game_things abre game_things.lua ache function load() local version = g_game.getClientVersion() em baixo coloca g_game.enableFeature(GameSpritesU32) e salva abra o cliente e ve se tá normal.

Informação Importante

Confirmação de Termo