Ir para conteúdo

ADM Milord

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Curtir
    ADM Milord recebeu reputação de Tace em OTServer 7.6   
    Amigo caso queria inciar, com a versão Old School, essa aqui é base mais estável que tenho. Ele roda apenas em Linux, e tem alguns erros, por enquanto eu tô introduzindo o cast system nele, em breve posterei aqui no forum, mais se caso você estive com presa esse aqui é melhor.
  2. Gostei
    ADM Milord deu reputação a DukeeH em (Resolvido)Ajustando Script 2   
    Não que eu lembre, apenas adicionei 2 linhas. É para ter em quase todas as distros.
    Apenas arrume o time la em cima, que coloquei 5 em vez de 6 minutos.
    Qualquer erro eu posso ajudar.
  3. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Todos ganham item ao matar boss   
    Não achei o erro do script anterior, mas okay, que bom que funcionou. =')
  4. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Todos ganham item ao matar boss   
    local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in pairs(getPlayersOnline()) do if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid)) then return false end end return true end function onKill(cid, target) if isInArray(config.monster, getCreatureName(target)) then if isMC (cid) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) else doPlayerSendTextMessage (cid, 19, "Você não receberá recompensa por estar de MC.") end end return true end  
  5. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Todos ganham item ao matar boss   
    local config = { monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end end return true end function onKill(cid, target) if isInArray (config.monster, getCreatureName (target)) then if isMC (cid) then for i = 1, #config.item do doPlayerAddItem (cid, config.item, config.qnt) end doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) else doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.") end end return true end  
  6. Gostei
    ADM Milord deu reputação a Bodak Reborn em Item Premiado   
    actions/scripts
    nome_arquivo.lua
    local bpRandom = { [1] = {item = 2160, qnt = 5} [2] = {item = 2150, qnt = 2} [3] = {item = 2140, qnt = 10} --[um número maior que o anterior] = {ID do item, quantidade} } local config = { bpID = 1988, randomItem = math.random (#bpRandom), effect = 27 } function onUse(cid, item, frompos, item2, topos) bp = doPlayerAddItem (cid, config.bpID, 1) doAddContainerItem (bp, bpRandom[config.randomItem].item, bpRandom[config.randomItem].qnt) doPlayerSendTextMessage (cid, 19, "Você ganhou um "..getItemNameById(bpRandom[config.randomItem].item).."!") doSendAnimatedText (getThingPos (cid), "MSG em cima do player.", math.random (1, 255)) doRemoveItem (item.uid, 1) doSendMagicEffect (getThingPos (cid), config.effect) return true end  
    XML:
    <action itemid="5905" script="nome_arquivo.lua" />  
  7. Gostei
    ADM Milord deu reputação a DukeeH em (Resolvido)Ajustando Script 2   
    function onSay(cid, words, param, channel) local exstorage = 45714 -- any empty storage local time = 5*60 -- h*m*s (5 min = 5*60) if exhaustion.check(cid, exstorage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 6 minutes before changing outfit again.") return TRUE end if not isInParty(cid) or getPlayerParty(cid) ~= cid then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party") end local outfit = getCreatureOutfit(cid) local addons = outfit. for _, cid2 in ipairs(getPartyMembers(cid)) do outfit.lookAddons = 0 doCreatureChangeOutfit(cid2, outfit) doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") if canPlayerWearOutfit(cid2, outfit.lookType, addons) then outfit.lookAddons = addons doCreatureChangeOutfit(cid2, outfit) doSendMagicEffect(getCreaturePosition(cid2), 66) exhaustion.set(cid, exstorage, time) return true elseif addons == 3 then outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 doCreatureChangeOutfit(cid2, outfit) doSendMagicEffect(getCreaturePosition(cid2), 66) exhaustion.set(cid, exstorage, time) end end return true end  
  8. Gostei
    ADM Milord deu reputação a Fir3element em [TFS 0.4 - 8.6] Ajuda com Newtype   
    é só ir no script da talkaction e mudar esse número
  9. Gostei
    ADM Milord deu reputação a Bodak Reborn em Loteria apenas para Cast ON   
    =)
  10. Gostei
    ADM Milord deu reputação a xWhiteWolf em CAST SYSTEM TFS 1.0   
    TODOS OS CRÉDITOS DISSO VÃO PARA O MEMBRO CAOTIC DE OUTRO FÓRUM
    "ae galeerrra venho disponibilizar o famoso sistema de televisão poketibiano completo o sistema foi feito para ambos os clients tibianos.
    O sistema permite você assistir outro players jogando assim você fica sem usar itens,falar(so pm), se movimentar e etc...
    Vamos la:

    Vá em luascript.cpp e procure:
    int32_t LuaScriptInterface::luaGetTopCreature(lua_State* L) { //getTopCreature(pos) PositionEx pos; popPosition(L, pos); ScriptEnviroment* env = getEnv(); Tile* tile = g_game.getTile(pos); if(!tile) { pushThing(L, NULL, 0); return 1; } Thing* thing = tile->getTopCreature(); if(!thing || !thing->getCreature()) { pushThing(L, NULL, 0); return 1; } pushThing(L, thing, env->addThing(thing)); return 1; } E coloque embaixo:
    int32_t LuaScriptInterface::luaGetAllsTvs(lua_State* L) { //getAllsTvs(cid) ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; }     Tvlist::iterator it;     it = player->tv.begin();                lua_newtable(L); uint32_t tableplayers = 1; for(uint32_t i = 1; it != player->tv.end(); ++it, ++i) {           Player* players = env->getPlayerByUID(*it);         if (players) { lua_pushnumber(L, tableplayers); lua_pushnumber(L, env->addThing(players));         pushTable(L);         tableplayers = tableplayers+1; } } return 1;  } int32_t LuaScriptInterface::luaSetPlayerTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player_tv = env->getPlayerByUID(popNumber(L)); Creature* creature = env->getCreatureByUID(popNumber(L)); if (!creature) { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } Player* player = creature->getPlayer(); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } if (!player_tv) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } player_tv->tv.push_back(player->getID()); SpectatorVec::iterator it; SpectatorVec list = g_game.getSpectators(player->getPosition()); Player* tmpPlayer = NULL; Condition* condition = NULL; if((condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE))) {                   creature->setHideName(false); player->addCondition(condition); g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_DISAPPEAR); for(it = list.begin(); it != list.end(); ++it) { if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player)) tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF); } for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit) { if(!pit->second->canSeeCreature(player)) pit->second->notifyLogOut(player); } IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false); if(player->isTrading()) g_game.internalCloseTrade(player); player->clearPartyInvitations(); if(player->getParty()) player->getParty()->leave(player); g_game.internalTeleport(player, player_tv->getPosition(), true); } lua_pushboolean(L, true); } int32_t LuaScriptInterface::luaDoSendChannelsTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } player->sendChannelsDialog(true); lua_pushboolean(L, true); return 1; } int32_t LuaScriptInterface::luaDoRemovePlayerTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); Player* creature = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; }   for(std::list<uint32_t>::iterator it = player->tv.begin(); it != player->tv.end(); ++it) {      if ((*it) == creature->getID()) {                Tvlist tv = player->tv;                 if (!creature) {                         errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); return 1; }                              Player* player_tv = creature->getPlayer();                 if (!player) {                              return 1;                              }                 SpectatorVec::iterator its;                 SpectatorVec list = g_game.getSpectators(player_tv->getPosition());            Player* tmpPlayer = NULL; Condition* condition = NULL; creature->setHideName(false); if((condition = player_tv->getCondition(CONDITION_GAMEMASTER, CONDITIONID_DEFAULT, GAMEMASTER_INVISIBLE))) { IOLoginData::getInstance()->updateOnlineStatus(player_tv->getGUID(), true); for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit) { if(!pit->second->canSeeCreature(player_tv)) pit->second->notifyLogIn(player_tv); } for(its = list.begin(); its != list.end(); ++its) { if((tmpPlayer = (*its)->getPlayer()) && !tmpPlayer->canSeeCreature(player_tv)) tmpPlayer->sendMagicEffect(player_tv->getPosition(), MAGIC_EFFECT_TELEPORT); } player_tv->removeCondition(condition); g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_APPEAR);         *it = NULL;          }  } } lua_pushboolean(L, true); } Continuando em luascript.cpp procure:
    //doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]]) lua_register(m_luaState, "doCreatureSay", LuaScriptInterface::luaDoCreatureSay); Coloque embaixo:
    //doRemovePlayerTv(cid, id) lua_register(m_luaState, "removePlayerTv", LuaScriptInterface::luaDoRemovePlayerTv); //getAllsTv() lua_register(m_luaState, "getTvs", LuaScriptInterface::luaGetAllsTvs); //setPlayerTv(cid, player) lua_register(m_luaState, "setPlayerTv", LuaScriptInterface::luaSetPlayerTv); //doSendChannelstTv(cid) lua_register(m_luaState, "doSendChannelsTv", LuaScriptInterface::luaDoSendChannelsTv); Em luascript.h procure:
    static int32_t luaGetPlayerParty(lua_State* L); Coloque embaixo:
    static int32_t luaGetAllsTvs(lua_State* L); static int32_t luaSetPlayerTv(lua_State* L); static int32_t luaDoSendChannelsTv(lua_State* L); Vamos agora em game.cpp:
    Procure:
    bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text) E substitua função por esta nova função:
    bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false; std::string str; if  (player->getStorage(34421, str) && str == "true") { if (type == SPEAK_SAY) { player->getStorage(292924, str);              player->sendTextMessage(MSG_STATUS_SMALL, str.c_str()); return false; } switch(type) { case SPEAK_WHISPER: return playerWhisper(player, text); case SPEAK_YELL: return playerYell(player, text); case SPEAK_PRIVATE: case SPEAK_PRIVATE_RED: case SPEAK_RVR_ANSWER: return playerSpeakTo(player, type, receiver, text); case SPEAK_CHANNEL_O: case SPEAK_CHANNEL_Y: case SPEAK_CHANNEL_RN: case SPEAK_CHANNEL_RA: case SPEAK_CHANNEL_W: { if(playerTalkToChannel(player, type, text, channelId)) return true; return playerSay(playerId, 0, SPEAK_SAY, receiver, text); } case SPEAK_BROADCAST: return playerBroadcastMessage(player, SPEAK_BROADCAST, text); case SPEAK_RVR_CHANNEL: return playerReportRuleViolation(player, text); case SPEAK_RVR_CONTINUE: return playerContinueReport(player, text); default: break; } internalCreatureSay(player, SPEAK_SAY, text, false);           return false; } uint32_t muteTime = 0; bool muted = player->isMuted(channelId, type, muteTime); if(muted) { char buffer[75]; sprintf(buffer, "You are still muted for %d seconds.", muteTime); player->sendTextMessage(MSG_STATUS_SMALL, buffer); return false; }      if(player->isAccountManager()) { player->removeMessageBuffer(); return internalCreatureSay(player, SPEAK_SAY, text, false); } if(g_talkActions->onPlayerSay(player, type == SPEAK_SAY ? CHANNEL_DEFAULT : channelId, text, false)) return true; if(!muted) { ReturnValue ret = RET_NOERROR; if(!muteTime) { ret = g_spells->onPlayerSay(player, text); if(ret == RET_NOERROR || (ret == RET_NEEDEXCHANGE && !g_config.getBool(ConfigManager::BUFFER_SPELL_FAILURE))) return true; } player->removeMessageBuffer(); if(ret == RET_NEEDEXCHANGE) return true; } switch(type) { case SPEAK_SAY: return internalCreatureSay(player, SPEAK_SAY, text, false); case SPEAK_WHISPER: return playerWhisper(player, text); case SPEAK_YELL: return playerYell(player, text); case SPEAK_PRIVATE: case SPEAK_PRIVATE_RED: case SPEAK_RVR_ANSWER: return playerSpeakTo(player, type, receiver, text); case SPEAK_CHANNEL_O: case SPEAK_CHANNEL_Y: case SPEAK_CHANNEL_RN: case SPEAK_CHANNEL_RA: case SPEAK_CHANNEL_W: { if(playerTalkToChannel(player, type, text, channelId)) return true; return playerSay(playerId, 0, SPEAK_SAY, receiver, text); } case SPEAK_PRIVATE_PN: return playerSpeakToNpc(player, text); case SPEAK_BROADCAST: return playerBroadcastMessage(player, SPEAK_BROADCAST, text); case SPEAK_RVR_CHANNEL: return playerReportRuleViolation(player, text); case SPEAK_RVR_CONTINUE: return playerContinueReport(player, text); default: break; } return false; } Continuando em game.cpp procure a função:
    ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/) E substitua por esta função:
    ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/) { const Position& currentPos = creature->getPosition(); Cylinder* fromTile = creature->getTile(); Cylinder* toTile = NULL; Position destPos = getNextPosition(direction, currentPos); if(direction < SOUTHWEST && creature->getPlayer()) { Tile* tmpTile = NULL; if(currentPos.z != 8 && creature->getTile()->hasHeight(3)) //try go up { if((!(tmpTile = map->getTile(Position(currentPos.x, currentPos.y, currentPos.z - 1))) || (!tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID))) && (tmpTile = map->getTile(Position(destPos.x, destPos.y, destPos.z - 1))) && tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID)) { flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE; destPos.z--; } } else if(currentPos.z != 7 && (!(tmpTile = map->getTile(destPos)) || (!tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID))) && (tmpTile = map->getTile(Position( destPos.x, destPos.y, destPos.z + 1))) && tmpTile->hasHeight(3)) //try go down { flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE; destPos.z++; } } ReturnValue ret = RET_NOTPOSSIBLE; if((toTile = map->getTile(destPos))) ret = internalMoveCreature(NULL, creature, fromTile, toTile, flags); if(ret != RET_NOERROR) { if(Player* player = creature->getPlayer()) { player->sendCancelMessage(ret); player->sendCancelWalk(); } } Player* player = creature->getPlayer(); if (player) {     Tvlist::iterator it;     it = player->tv.begin();                for(uint32_t i = 1; it != player->tv.end(); ++it, ++i) {           Player* players =  getPlayerByID(*it);         if (players) {         internalTeleport(players, player->getPosition(), true, 0); } } } return ret; } Procure a função:
    bool Game::playerRequestChannels(uint32_t playerId) Substitua a função por: 
    bool Game::playerRequestChannels(uint32_t playerId) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false; player->sendChannelsDialog(false); return true; }  Agora vamos a protocolgame.cpp e procure a função;
    void ProtocolGame::sendChannelsDialog(bool tv) E substitua por esta função:
    void ProtocolGame::sendChannelsDialog(bool tv) {      NetworkMessage_ptr msg = getOutputBuffer(); std::string str; if(msg) { if (tv) { uint16_t bytes = 0; for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) {         it->second->getStorage(22120, str);                             if (str == "true") {         bytes = bytes+1; }    } if (bytes < 1) {           player->sendCancel("Não há nenhuma tv online");          return;          }      TRACK_MESSAGE(msg); msg->AddByte(0xAB); msg->AddByte(bytes); uint16_t id = 200; for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) {         it->second->getStorage(22120, str);                             if (str == "true") {         id = id+1;         it->second->getStorage(12121, str); msg->AddU16(id); msg->AddString(str); }              } return; }         TRACK_MESSAGE(msg); msg->AddByte(0xAB); ChannelList list = g_chat.getChannelList(player); msg->AddByte(list.size()); for(ChannelList::iterator it = list.begin(); it != list.end(); ++it) { if(ChatChannel* channel = (*it)) {                 msg->AddU16(channel->getId()); msg->AddString(channel->getName()); } } } } Procure em protocolgame.h a seguinta declaração:
    void sendChannelsDialog(); Substitua por:
    void sendChannelsDialog(bool tv); Agora vamos em player.h e procure:
    void sendChannelsDialog() {if(client) client->sendChannelsDialog();} E substitua por:
    void sendChannelsDialog(bool tv) {if(client) client->sendChannelsDialog(tv);} Vamos denovo a protocolgame.cpp e procure:
    if(player->isAccountManager()) { switch(recvbyte) { case 0x14: parseLogout(msg); break; case 0x96: parseSay(msg); break; default: sendCancelWalk(); break; } } Coloque embaixo:
    if (player->getStorage(34421, str) && str == "true") {       player->getStorage(292924, str);  switch(recvbyte) { case 0x14: parseLogout(msg); break; case 0x96: parseSay(msg); break; case 0x97: // request channels parseGetChannels(msg); break; case 0x98: // open channel parseOpenChannel(msg); break; case 0x99: // close channel parseCloseChannel(msg); break; case 0x9A: // open priv parseOpenPriv(msg); break; case 0x1E: // keep alive / ping response parseReceivePing(msg); break; default:     player->sendTextMessage(MSG_INFO_DESCR, str); break; } Seguidamente vá em creatureevent.cpp e procure:
    else if(tmpStr == "preparedeath") m_type = CREATURE_EVENT_PREPAREDEATH; Coloque embaixo:
    else if(tmpStr == "selecttv") m_type = CREATURE_EVENT_SELECTTV; Procure depois:
    case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath"; Coloque embaixo:
    case CREATURE_EVENT_SELECTTV: return "onSelectTv"; Procure:
    case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList"; Coloque embaixo:
    case CREATURE_EVENT_SELECTTV: return "cid, id"; Procure:
    uint32_t CreatureEvent::executeChannelJoin(Player* player, uint16_t channelId, UsersMap usersMap) { //onJoinChannel(cid, channel, users) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; scriptstream << "local channel = " << channelId << std::endl; scriptstream << "local users = {}" << std::endl; for(UsersMap::iterator it = usersMap.begin(); it != usersMap.end(); ++it) scriptstream << "users:insert(" << env->addThing(it->second) << ")" << 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); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushnumber(L, channelId); UsersMap::iterator it = usersMap.begin(); lua_newtable(L); for(int32_t i = 1; it != usersMap.end(); ++it, ++i) { lua_pushnumber(L, i); lua_pushnumber(L, env->addThing(it->second)); lua_settable(L, -3); } bool result = m_interface->callFunction(3); m_interface->releaseEnv(); return result; } } else { std::cout << "[Error - CreatureEvent::executeChannelJoin] Call stack overflow." << std::endl; return 0; } } Coloque embaixo:
    uint32_t CreatureEvent::executeSelectTv(Player* player, uint16_t id) { //onSelectTv(cid, id) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; scriptstream << "local id = " << id << 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); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushnumber(L, id); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::cout << "[Error - CreatureEvent::executeChannelJoin] Call stack overflow." << std::endl; return 0; } } Vá em creatureevent.h e procure:
    CREATURE_EVENT_ATTACK, Coloque embaixo:
    CREATURE_EVENT_SELECTTV Procure continuando em creatureevent.h:
    uint32_t executeCombat(Creature* creature, Creature* target); Coloque embaixo:
    uint32_t executeSelectTv(Player* player, uint16_t id); Vá agora em game.cpp denovo e procure a função:
    bool Game::playerOpenChannel(uint32_t playerId, uint16_t channelId) Substitua a função por:
    bool Game::playerOpenChannel(uint32_t playerId, uint16_t channelId) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false;      if (channelId >= 200) {     CreatureEventList tvEvents = player->getCreatureEvents(CREATURE_EVENT_SELECTTV);     for(CreatureEventList::iterator it = tvEvents.begin(); it != tvEvents.end(); ++it) (*it)->executeSelectTv(player, channelId); return true;      } ChatChannel* channel = g_chat.addUserToChannel(player, channelId); if(!channel) { #ifdef __DEBUG_CHAT__ std::cout << "Game::playerOpenChannel - failed adding user to channel." << std::endl; #endif return false; } if(channel->getId() != CHANNEL_RVR) player->sendChannel(channel->getId(), channel->getName()); else player->sendRuleViolationsChannel(channel->getId()); return true; } Vá em data/lib e crie um novo arquivo lua chamado tv system:
    names = {} storage_hastv = 22120 storage_watchtv = 34421 storage_nametv = 12121 storage_idwatchtv = 21213 storage_msgwatch = 292924 storage_namewatchtv = 21923 storage_save_group_id = 63732 smallerros = false ERROR_ID_NOT_FOUND = "ERROR\nPLAYER NOT FOUND\nSet Storage FALSE ON LOGIN" MSG_TV_SYSTEM = "Esta ação não e possivel você esta assistindo" MSG_CREATE_TV = "Parabéns, você criou sua TV " MSG_LOGOUT_TV = "Você saiu da tv " MSG_LOGOUT_TV_TOWN = "Você retornou a sua cidade " ID_ITEM_TV = 1949 ---- IMPORTANTE ID DA SUA CAM(CAMERA) MSG_WATCH_TV = "Você esta assitindo a uma tv" MSG_HAS_TV = "Você ja tem tv" MSG_NO_HAS_TV = "Você não tem tv" MSG_ENTER_PLAYER = "Um novo player entrou - " MININUM_STRING_CARACTER = 4 HAS_TV = "Você ja tem uma tv" MSG_DELETE_TV = "Você deletou sua channel com sucesso" MSG_WATCH_TV_ENTER_TV = "Você entrou na channel " NAME_WRONG = "Nome incorreto" MSG_HAS_NAME_TV = "Desculpe, ja existe uma tv com este nome escolha outro por favor" function setBooleanStorage(cid, storage, bool) if not bool then setPlayerStorageValue(cid, storage, -1) return true end setPlayerStorageValue(cid, storage, "true") return true end function checkFindStrings(str, array) for i=1, #array do if string.find(str, array[i]) then return true end end return false end function playerHasTv(cid)  return getPlayerStorageValue(cid, storage_hastv) == "true" and true  end function playerWatchTv(cid)  return getPlayerStorageValue(cid, storage_watchtv) == "true" and true end function getTvOnlines() local t = {} local online = getPlayersOnline() for i=1, #online do if playerHasTv(online[i]) then table.insert(t, online[i]) end end return t end function getNamesTv(sep) local tvs = getTvOnlines() str = "" for i=1, #tvs do str = str..sep..getTvName(tvs[i]) end return str end function getIdByTvName(name) local tvs = getTvOnlines() for i=1, #tvs do if tvs[i] == name then return name end end return false end function stopWatchAllsPlayerTv(id) local onlines = getTvs(id) for i=1, #onlines do playerStopWatchTv(onlines[i]) end return true end function getNameTv(id) if not isPlayer(id) then print(ERROR_ID_NOT_FOUND) return false end local storage = getPlayerStorageValue(id, storage_nametv) if storage ~= -1 then return storage end return "" end function createNewTv(cid, name) if #name < MININUM_STRING_CARACTER or checkFindStrings(name, names) then doPlayerSendCancel(cid, NAME_WRONG) return false end local tvs = getTvOnlines() for i=1, #tvs do if getNameTv(tvs[i]) == name then doPlayerSendCancel(cid, MSG_HAS_NAME_TV) return false end end if playerHasTv(cid) then doPlayerSendCancel(cid, MSG_HAS_TV) return false end if playerWatchTv(cid) then doPlayerSendCancel(cid, MSG_WATCH_TV) return false end setBooleanStorage(cid, storage_hastv, true) setPlayerStorageValue(cid, storage_nametv, name) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_CREATE_TV..name) return true end function getTvNameById(id) if not isPlayer(id) then print(ERROR_ID_NOT_FOUND) return false end return getPlayerStorageValue(id, storage_nametv) end function playerWatchTv(cid, id) if not isPlayer(id) then if smallerros then print(ERROR_ID_NOT_FOUND) end return false end if playerHasTv(cid) then doPlayerSendCancel(cid, MSG_HAS_TV) return false end if playerWatchTv(cid) then doPlayerSendCancel(cid, MSG_WATCH_TV) return false end local name = getTvNameById(id) setBooleanStorage(cid, storage_watchtv, true) setPlayerStorageValue(cid, storage_msgwatch, MSG_TV_SYSTEM) setPlayerStorageValue(cid, storage_idwatchtv, id) setPlayerStorageValue(cid, storage_namewatchtv, name) setPlayerStorageValue(cid, storage_save_group_id, getPlayerGroupId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_WATCH_TV_ENTER_TV) doPlayerSendTextMessage(id, MESSAGE_STATUS_CONSOLE_BLUE, MSG_ENTER_PLAYER..getCreatureName(cid)) setPlayerTv(cid, id) return true end function playerStopWatchTv(cid) local id = getPlayerStorageValue(cid, storage_idwatchtv) local name = getPlayerStorageValue(cid, storage_namewatchtv) local town = getPlayerTown(cid) local namet = getTownName(town) local post = getTownTemplePosition(town) if getPlayerStorageValue(cid, storage_watchtv) ~= "true" then return true end removePlayerTv(cid, id) setBooleanStorage(cid, storage_watchtv, false) setPlayerStorageValue(cid, storage_idwatchtv, -1) setPlayerStorageValue(cid, storage_namewatchtv, -1) setPlayerGroupId(cid, getPlayerStorageValue(cid, storage_save_group_id)) doTeleportThing(cid, post) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_LOGOUT_TV..name) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_LOGOUT_TV_TOWN..namet) return true end function deleteTv(cid) if getPlayerStorageValue(cid, 22120) ~= "true" then return false end stopWatchAllsPlayerTv(cid) setBooleanStorage(cid, storage_hastv) setPlayerStorageValue(cid, storage_nametv, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_DELETE_TV) return true end Agora vamos em actions e crie um arquivo lua chamado tv e coloque:
    function onUse(cid, item, fromPosition, itemEx, toPosition) doSendChannelsTv(cid) end Vá em actions.xml e coloque a seguinte configurando com o id da sua tv:
    <!-- TV --> <action itemid="1445" event="script" value="tv.lua"/> Agora vamos em talkactions e crie um novo arquivo lua chamado delete e coloque isto:
    function onSay(cid, words, param, channel) deleteTv(cid) return true end Agora vamos em talkactions.xml e coloque a seguinte tag:
    <talkaction words="/delete" event="script" value="delete.lua"/> Agora vamos a creaturescripts e crie um arquivo lua chamado createTv e coloque:
    function onTextEdit(cid, it:em, newText) if item.itemid == ID_ITEM_TV then createNewTv(cid, newText) return true end return true end Crie outro chamado de tv e coloque:
    function onSelectTv(cid, id) local tv = getTvOnlines() local idstarter = 200 for i=1, #tv do local tv = tv[i] local sub_id = i+idstarter if sub_id == id then playerWatchTv(cid, tv) end end return true end Crie outro chamado de tvlogout :
    function onLogout(cid) if isPlayer(cid) then deleteTv(cid) playerStopWatchTv(cid) end return true end Vá em creaturescripts.xml e coloque as seguintes as tags:
    <event type="textedit" name="newTv" event="script" value="createTv.lua"/> <event type="selecttv" name="selecttv" event="script" value="tv.lua"/> <event type="logout" name="tvlogout" event="script" value="tvlogout.lua"/> Vá em data/xml/group.xml e abra o arquivo e coloque o novo group:
    <group id="8" name="Tv" flags="3845069447162" customFlags="2097151" access="1" violationReasons="4" nameViolationFlags="2"/>
  11. Gostei
    ADM Milord deu reputação a gugugpg em [MOD] Cavebot   
    Bom, recentemente eu tenho feito um modulo de cavebot pro otclient, ele é bastante útil quando combinado com candybot. Dando uma bela resumida ele simplesmente anda pelos waypoints que vc marca. Não possui auto target ainda.
     
     

     
     
    As opções são as seguintes:
     
    Add Waypoint Mode: Walk - Marca um waypoint em modo walk, anda como se estivesse clicando com o lado esquerdo do mouse(não marque waypoints( aconselho marcar entre 20 e 30 sqms de distancia para evitar problemas.) Use - Adiciona waypoint em modo use, como se vc estivesse clicando com o lado direito do mouse, é bom para subir aquelas escadas que vc tem que clicar( tem um limite de 5 sqm +/- , então use a cabeça e n marque mto distante), e tbm passa em cima do fogo.  
         2.  Add Stair Direction(adicionar a direção da escada que quer subir ou descer):
    North - adiciona que a escada esta para o north e anda para o north. E as outras opções fazem o mesmo porem para direções diferentes. Uma breve ajuda: marque um walk antes da escada, marque a direção em cima desse mesmo walk, e mais um walk dps de subir a escada, se n fizer isso vai dar errado  
         3. Sleep
    Adiciona uma pausa no waypoint anterior.   
         4. Mouse Popup
    Adiciona as opções de marcar no ctrlClick do mouse, as opções de escada e de andar ficam junto a aquelas de look, use...   
         5. Use find path
    Opção para andar em cima de fogo, poison em waypoints modo walk.(ele se "confunde" com escadas então marque Walk direitinho)  
    O resto não precisa de explicação , só de bater o olho vc já entede..
    Esse mod não tem target porque o candybot já tem, então por isso eu disse que pode ser bem útil quando combinado com ele, este mod serve só para andar mesmo.
     
    scan: https://www.virustotal.com/pt/file/12c3d207b3c2bce2ea6e4673aeb2368fdbf6874725cd6d9f928c02f4ab9a8846/analysis/1437335925/
     
    download: http://www.4shared.com/rar/cuv3O_JKba/cavebot_mod.html
  12. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Reward Item   
    function onUse(cid, item, frompos, item2, topos) local item = { [1] = {2156, 1, 1}, [2] = {3000, 1, 5}, [3] = {2113, 1, 10}, [4] = {2156, 1, 40}, [5] = {2160, 10, 60}, -- [um número maior que o anterior] = {ID do item, quantidade, chance} } local randomItem = math.random (1, 100) for i = 1, #item do if randomItem > 0 and randomItem <= item[i][3] then if doPlayerAddItem (cid, item[i][1], item[i][2]) then break; end end end doRemoveItem (item2.uid, 1) if randomItem > item[#item][3] then doPlayerSendTextMessage (cid, 19, "Seu item falhou.") end return true end  
  13. Gostei
    ADM Milord deu reputação a Yan Liima em (Resolvido)Todos ganham item ao matar boss   
    No caso isso daria o item pra qualquer jogador certo? até mesmo um player level 1 que desse 1 de dano no monstro iria receber, sem ajudar/fazer muito esforço. Eu acho que ficaria melhor por uma quantidade certa de dano. Por exemplo se os jogadores desse mais de 50 dano iria receber, já os que não chegaro a bater mais que isso não iria receber. Bom mais como eu não irei utilizar e é você que irá usa fique de sua escolha. Era apenas uma ideia xD
  14. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Todos ganham item ao matar boss   
    ...
    local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in pairs(getPlayersOnline()) do if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid)) then doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_BLUE, "MSG caso seja MC.") return true end end return true end function onKill(cid, target) if not isMC (cid) then if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end else doPlayerSendTextMessage (cid, 19, ".....") end return true end  
  15. Gostei
    ADM Milord deu reputação a Vodkart em (Resolvido)Todos ganham item ao matar boss   
    @Talesigorvr
     
    se você diz, ta dito!
     
    eu pensei em fazer por onDeath, fiz um esboço, claro que tem que arrumar para checar se o jogador tem CAP suficiente, se não tiver mandar o item pro depot e tal...
     
    function onDeath(cid, corpse, deathList) local monsters = {"Demon","Hydra"} -- Monster Name local items = {{2160,1},{2148,2}} -- ITEM ID, QUANTIDADE if isMonster(cid) and isInArray(monsters, getCreatureName(cid)) then for _, players in pairs(deathList) do if isPlayer(players) then for i = 1, #items do doPlayerAddItem(players, items[i][1], items[i][2]) end end end return true end return true end  
    Lembrando que tem que registrar o evento no XML do monstro...
  16. Gostei
    ADM Milord deu reputação a Bodak Reborn em (Resolvido)Todos ganham item ao matar boss   
    creaturescripts/script
    nome_arquivo.lua
    local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } function onKill(cid, target) if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end return true end XML:
    <event type="kill" name="killBossReward" event="script" value="nome_arquivo.lua"/> Registre o evento em login.lua:
    registerCreatureEvent(cid, "killBossReward")  
  17. Gostei
    ADM Milord deu reputação a xZonaah em [8.6] AutoLoot   
    Fala ai galera do TK, venho trazer um script de autoloot, sim este autoloot 100% testado e 100% funcional ( Apenas em Tibia 8.6 e TFS 0.4  ).
     
    Bom vamos para os scripts e logo em seguida para os prints.
    Esse script envolve CREATURESCRIPT e TALKACTIONS.
     
     
     
     
    E assim, explicando:
    Dentro do jogo digite !autoloot e irá aparecer a mensagem para as configurações de como utiliza-lo
    !autoloot add, ID ou NOME
    !autoloot remove, ID ou NOME
  18. Gostei
    ADM Milord deu reputação a Renato em [Talk] Cassino System   
    Cassino System por talkaction.



    Créditos no script.

    Explicação: ele fala !apostar X, esse X é em mil, ou seja se eu falar !apostar 50, será 50k. O X não poderá ser maior do que o "max =" e menor do que o "min =" que será estipulado por você. Se o player ganhar, o premio será o valor que ele apostou multiplicado pelo valor do "premio =". As chances de o player ganhar está ali no "rdm = math.random(1,3)" no caso o player terá 1/3 (1 terço, ou, uma chance em três) chances de ganhar, se você mudar para (1,5) ele terá uma chance em 5 para ganhar, e assim sucessivamente. LEMBRANDO QUE VOCê DEVE MANTER O NÚMERO 1 E SÓ ALTERAR O SEGUNDO NÚMERO.

    • Crie um arquivo LUA com o nome cassino.lua em data/talkactions/scripts e ponha:


    function onSay (cid, words, param, channel)
    local prm = tonumber(param)
    local min = 1
    local max = 500
    local rdm = math.radom(1,3)
    local premio = 2 -- o valor que tiver aqui multiplica o valor apostado se o cara ganhar

    if (prm == nil) or prm < min or prm > max then
    doSendMagicEffect(getPlayerPosition(cid), 2)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa apostar no mínimo "..min.."k ou no máximo "..max.."k.")
    return TRUE
    elseif getPlayerMoney(cid) < prm*1000 then
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem "..prm.."k para apostar.")
    doSendMagicEffect(getPlayerPosition(cid), 2)
    return TRUE
    elseif rdm == 1 then -- ele ganhou
    doPlayerRemoveMoney(cid, prm*1000)
    doPlayerAddMoney(cid, (prm*1000)*premio)
    elseif rdm > 1 then -- ele perdeu
    doPlayerRemoveMoney(cid, prm*1000)
    doSendMagicEffect(getPlayerPosition(cid), 2)
    end
    return TRUE
    end
    [/code] [b]• Depois em [color=#006400]data/talkactions/talkactions.xml[/color] ponha a tag em qualquer lugar:[/b] [code]<talkaction log="yes" words="!apostar" access="0" event="script" value="addpremium.lua"/>
    Mude aonde esta "!apostar" para o comando que você deseja.


    Status: Não testado. //quem testar avise.
  19. Gostei
    ADM Milord deu reputação a ViitinG em [creaturescripts] Senha para porta   
    Bom para quem não sabe como funciona o script,é basicamente uma senha para conseguir abrir uma porta e após um tempo a porta se fecha automaticamente,podendo ser configurado o tempo/senha/porta.
     
    • Adicionando o script •
     
    Em "data/creaturescripts/creaturescripts.xml" adicione está tag :
    <event type="textoparaporta" name="Senha" event="script" value="senhaporta.lua"/> Em "data/creaturescripts/scripts/login.lua" adicione está tag no final do script :
    registerCreatureEvent(cid, "Senha") Em "data/creaturescripts/scripts/senhaporta.lua" adicione este script :
    local uniqueids = {8049, 8050} local passwords = { ["TibiaKing"] = {doorpos = {x = 163, y = 36, z = 7}, doorid = 6257, blackboardpos = {x = 162, y = 36, z = 7}, blackboardid = 1811, uniqueid = 8049, doorclosetime = 10}, ["TK"] = {doorpos = {x = 1000, y = 1000, z = 7}, doorid = 1213, blackboardpos = {x = 1000, y = 1000, z = 7}, blackboardid = 1811, uniqueid = 8050, doorclosetime = 10} } function onTextEdit(cid, item, newText) local x = passwords[newText] local function onCloseDoor() if(getTileItemById(x.doorpos,x.doorid+1).uid) > 0 then doTransformItem(getTileItemById(x.doorpos,x.doorid+1).uid, x.doorid) doSendMagicEffect(x.doorpos, CONST_ME_MAGIC_RED) end end for _, check in pairs(uniqueids) do if item.uid == check then if x and item.uid == x.uniqueid then if(getTileItemById(x.doorpos,x.doorid).uid) > 0 then doTransformItem(getTileItemById(x.doorpos,x.doorid).uid, x.doorid + 1) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Sua Senha "'..newText..'" esta correta, voce pode entrar.') addEvent(onCloseDoor,x.doorclosetime*1000) doRemoveItem(item.uid, 1) local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos) doItemSetAttribute(blackboard, "uid", x.uniqueid) else doRemoveItem(item.uid, 1) local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos) doItemSetAttribute(blackboard, "uid", x.uniqueid) doPlayerSendCancel(cid, 'A porta ja esta aberta, feche-a ou espera ela se fechar.') end else doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendCancel(cid, 'Sua senha "'..newText..'" esta incorreta.') end end end return true end • Configurando •
     
     
    Creditos : Limos
     
    Imagens :



Informação Importante

Confirmação de Termo