Líderes
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 02/25/16 em todas áreas
-
Pessoal, as aulas continuam firme e forte, só tenham paciência, pois não tem data fixa ainda... Mas eu prometo, que essas aulas vão conter uma coisa que nenhuma aula em fórum de Tibia (ou qualquer outro fórum, eu acho) tem, e vai ser muito legal poder interagir com isso, vai ser mais fácil de aprender e testar conhecimentos. Repito: a aula-1 já está pronta. Acrescento que já tenho o assunto e início da aula-2. Enquanto eu não libero a escolinha, vou estudar outras coisas, para ajudar na didática das aulas. Obrigado pelo feedback pessoal, significa bastante para mim (quero um dia poder ensinar matemática, depois de fazer BCC, e Licenciatura em mat) É muito bom ver o interesse de muita gente! Aqui vão frases para inspirar: -Insanity: doing the same thing over and over again and expecting different results. -Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. -Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand. Essas frases são de um carinha chamado de A. Einstein, aposto que vocês conhecem, ele foi um cara muito a frente da geração dele. Ele foi mais a frente do que minha geração , e provavelmente da do futuro filho... Essas frases são muuuuito importantes para programar, e para a vida. Duvidar de tudo é uma qualidade que eu tenho, e me orgulho muuuito disso, pois quem duvida não veste a venda do pseudo-conhecimento. A primeira frase tem muito haver com programar, a segunda também e a terceira também... se você não sabe inglês, tente chegar até elas, elas são muito importantes... Dica: Aprender inglês, se você não quer, aprenda pelo menos o que significa os termos, durante a aula. Se você já sabe: Que bom! Vai ser útil para sua vida, e muito mais fácil de entender funções e sintaxes LUA. FRASES ACIMA EM PT-br: Sabe aquele momento que o professor pergunta: - Alguma dúvida? , e ninguém da sua classe tem dúvida? A verdade é que são um bando de babacas, por não terem dúvidas, ou ter vergonha de perguntar. A ciência só progride se existir dúvidas. Certezas são burrices. Curiosidade: Linguagem LUA é brasileira, foi feita por integrantes da PUC. Mas é praticamente toda em inglês ... Estou pelo celular, qualquer erro de gramática, ponho culpa no corretor...4 pontos
-
Dragons Lair simples com opção de quest. Imagens: Download Link: AQUI Scan: AQUI3 pontos
-
Bird Hunt - Atire no pássaro.
Yan Liima e um outro reagiu a Night Wolf por um tópico no fórum
Fala galera, vim compartilhar com vcs um dos sistemas que eu fiz baseado no jogo Bird Hunt e que foi imbutido em alguns servidores famosos, sendo o Korelin um deles. Obs: Testado em TFS 0.3.6 mas deve funcionar em TFS 0.4 sem problema aqui tem uma pequena imagem demonstrando o sistema sendo utilizado: Bom, antes de tudo eu vou ensinar vocês a criar um mapa apropriado pois isso é 90% das dificuldades que os players enfrentam quando tentam adicionar o sistema. Inicialmente vc vai precisar criar uma area no seu mapa editor +- parecida com a que eu fiz na imagem abaixo: Feito isso vc deverá colocar uniqueid 16480 na porta e actionid 14874 em todos os lugares que o player pode percorrer (da placa pra \/ todos os quadrados verdes deverão conter esse actionid) Colocado os ids, vc deverá fazer a sala à prova de bugs, para isso você terá que seguir essas especificações: Note que em verde são os lugares que vc deverá colocar protect zone e em roxo os locais onde vc deve colocar no logout zone. Agora perceba que nas posições onde o player irá andar, você vai colocar tanto no logout zone como protect zone, isso pra evitar ele de matar o bixo com spells e pra evitar que ele deslogue durante o mini game. Essa contagem de sqms eu vou explicar mais tarde na configuração do script, mas tenham ela em mente. Agora vamos aos scripts: Comece criando em data/lib um arquivo chamado 045- Bird Hunt Lib.lua e colocando isso dentro dele: Feito isso vá em data/actions/scripts e adicione um arquivo chamado seagul.lua que deverá conter: e adicione em actions.xml: <action uniqueid="16480" event="script" value="seagul.lua"/> Agora vá em data/movements/scripts e crie um arquivo chamado seagulmove.lua com o seguinte conteúdo: E adicione as tags em movements.xml: <movevent type="StepIn" actionid="14872" event="script" value="seagulmove.lua"/> <movevent type="StepOut" actionid="14872" event="script" value="seagulmove.lua"/> Agora, pra deixar nosso sistema mais real e difícil, altere a velocidade do seagul de 200 pra 300 na pasta data/monsters/Birds/seagull.xml eu alterei tb a quantidade de vida q ele começa a fugir pra vida atual dele e fiz outras alterações pra tornar mais difícil, mas isso é com vcs. A maioria das coisas tá bem compreensível, com exceção das duas primeiras linhas de actions: rangecima = {x = -8, y = -4}, -- distancia em x e y da topos (ate a pos de cima) rangebaixo = {x = 0, y = 4}, -- distancia em x e y da topos (ate a pos de baixo) é aqui que entra aquela imagem, vc vai considerar a porta (o ponto cinza) como sendo nossa origem, ou seja, o ponto (0,0) rangecima é a distancia que eu tenho que percorrer em x e y pra chegar até a ponta de cima < e rangebaixo é a distancia que eu tenho que percorrer em x e y pra chegar até a ponta de baixo. Se vcs mudarem o tamanho da sala, fiquem ligados nisso. Obs: algumas pessoas fazem a sala virada pra direita também, nesse caso vc mantém a actions (pode usar inclusive o mesmo arquivo), só tem que alterar o movements pois lá vc define se é direita ou esquerda. É isso, espero que tenham gostado. O jogo é só por diversão mas vc pode alterar a função de atirar pra ganhar dinheiro por cada acerto ou então criar um npc que vc te dá X premio dependendo do seu recorde.. podendo esse premio inclusive ser uma key pra uma quest. Usem a imaginação e espero que aproveitem esse sistema. Abraços do Lobo.2 pontos -
Novo Inventario
Drenks e um outro reagiu a PokeTournament por um tópico no fórum
Fala pessoal Como todos sabem, a tela de skills não é la muito necessaria para jogos de pokemon e normalmente na base de rpg se tem o inventario e a bag em uma unica janela então resolvi juntar os 3 em 1 unica janela (inventario, backpack principal e skills) pro meu poketibia e ai? o que acharam? ainda vou decidir o que fazer com esse slot da camisa e tb vou tirar essa caixa de insignias dai vou fazer uns icones para parecer no inventario para as insignias2 pontos -
Eae Galera da Ekz Entao fiz um launcher em c# e queria compartilhar com a comunidade, o launcher e simples e serve para otclient porem tem as sources e se vc quiser editar para usar o old client fique a vontade. Link Download Launcher+Source Scan tbm fiz um video explicando como funciona obs: Para o Launcher funcionar vc prescisa por na pasta do client o .exe do launcher, o config.ini e a dll , todos estao no winrar do link de download.1 ponto
-
Hoje eu vim ensinar como aumenta a "tela" de jogo do OTCLIENT (Desculpe o merchant, era a unica imagem que eu tinha salvo) Testado em : 0.3.6pl1, Pode funcionar em 1.0 com alterações pequenas. Em protocolgame.cpp ache: return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) && (y >= myPos.y - 6 + offsetz) && (y <= myPos.gety + 7 + offsetz)); e troque por: return ((x >= myPos.x - Map::maxClientViewportX + offsetz) && (x <= myPos.x + (Map::maxClientViewportX+1) + offsetz) && (y >= myPos.y - Map::maxClientViewportY + offsetz) && (y <= myPos.y + (Map::maxClientViewportY+1) + offsetz)); Agora, continuando em protocolgame.cpp ache: GetMapDescription(pos.x - 8, pos.y - 6, pos.z, 18, 14, msg); E troque por: GetMapDescription(pos.x - Map::maxClientViewportX, pos.y - Map::maxClientViewportY, pos.z, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, msg); Continuando em protocolgame.cpp ache a função: void ProtocolGame::sendMoveCreature(const Creature* creature, const Tile* newTile, const Position& newPos, uint32_t newStackpos, const Tile* oldTile, const Position& oldPos, uint32_t oldStackpos, bool teleport) Dentro da função encontre: A parte que começa em if (oldPos.y > newPos.y) { e Termina em GetMapDescription(newPos.x - 8, newPos.y - 6, newPos.z, 1, 14, msg); } e troque por: if (oldPos.y > newPos.y) { // north, for old x msg->AddByte(0x65); GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg); } else if (oldPos.y < newPos.y) { // south, for old x msg->AddByte(0x67); GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg); } if (oldPos.x < newPos.x) { // east, [with new y] msg->AddByte(0x66); GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg); } else if (oldPos.x > newPos.x) { // west, [with new y] msg->AddByte(0x68); GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg); Agora ache: if(newPos.z == 7) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 5, 18, 14, 3, skip); //(floor 7 and 6 already set) GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 4, 18, 14, 4, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 3, 18, 14, 5, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 2, 18, 14, 6, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 1, 18, 14, 7, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 0, 18, 14, 8, skip); Depedendo da Source, a parte será assim: Por: if(newPos.z == 7) //going to surface { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 5, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 3, skip); //(floor 7 and 6 already set) GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 4, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 4, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 3, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 5, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 6, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 1, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 7, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 0, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 8, skip); Agora ache: else if(newPos.z > 7) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, oldPos.getZ() - 3, 18, 14, 3, skip); Depedendo da source será assim: Por: else if(newPos.z > 7) //underground, going one floor up (still underground) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, oldPos.z - 3, (Map::maxClientViewportX+1), (Map::maxClientViewportY+1)*2, 3, skip); Agora ache: //moving up a floor up makes us out of sync //west msg->AddByte(0x68); GetMapDescription(oldPos.x - 8, oldPos.y - 5, newPos.z, 1, 14, msg); //north msg->AddByte(0x65); GetMapDescription(oldPos.x - 8, oldPos.y - 6, newPos.z, 18, 1, msg); E troque por: //moving up a floor up makes us out of sync //west msg->AddByte(0x68); GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y - (Map::maxClientViewportY-1), newPos.z, 1, (Map::maxClientViewportY+1)*2, msg); //north msg->AddByte(0x65); GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg); Agora ache: if(newPos.z == 8) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z, 18, 14, -1, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 1, 18, 14, -2, skip); GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip); Dependendo da source poderá ser: e troque por: if(newPos.z == 8) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -1, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 1, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -2, skip); GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -3, skip); Agora ache: else if(newPos.z > oldPos.z && newPos.z > 8 && newPos.z < 14) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip); Depedendo da source pode ser assim: E troque por: else if(newPos.z > oldPos.z && newPos.z > 8 && newPos.z < 14) { int32_t skip = -1; GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -3, skip); Agora em map.h edite essa parte como quiser: static const int32_t maxViewportX = 11; //min: maxClientViewportX + 1 static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1 static const int32_t maxClientViewportX = 8; static const int32_t maxClientViewportY = 6; O modo de Edição é assim: Agora em map.cpp do OTCLIENT Ache: void Map::resetAwareRange() { AwareRange range; range.left = 8; range.top = 6; range.bottom = 7; range.right = 9; setAwareRange(range); } Troque por: { AwareRange range; range.left = 8; //Valor que colocou em maxClientViewportX range.top = 6; //Valor que colocou em maxClientViewportY range.bottom = range.top+1; range.right = range.left+1; setAwareRange(range); } Créditos: Flatlander - OTLAND - Criação Ceetros - Tradução Agora vamos deixar o OTCLIENT lindão. Troque tudo de modules/game_interface/interface.lua (na pasta do OTCLIENT) por: http://pastebin.com/tH7qyreW (para o tutorial não ficar muito grande botei no pastebin, já que o spoiler tá bugando) Creditos dessa parte: Edubart (Criador do OTCLIENT) Ceetros Caso tenha ajudado, dê um rep+1 ponto
-
[Poketibia] Pfield CdBar Open Source
joaoibi reagiu a JairKevick por um tópico no fórum
Eai PokeTibianos :cool: ! Trago aqui o pfield com cd bar um servidor com sources! bom adicionei a cdbar no pfield! a alguns sistemas nada mais! Systems do PFIELD! Bike System: 100% Caught System: 100% Evolution System: 100% Go-Back System: 100% Gerações 1: 100% Gerações 2: 100% Limite de 6 Pokemons na Bag: 100% Moves System: 100% Portrait System: 100% Pokedex System: 100% Ride System: 100% Sem Level System! fly System: 100% Surf System: 100% Teleport System: 100% e etc... Observações Os systems acima apenas afirma que os sistema em si esta em 100%, quero deixa bem claro que nem todos os pokemos então adicionados ao sistemas. Lembrando tambem que possa aparece bugs porque todos os OtServs de Poketibia á Bugs... Mais Caso Ocorra algum por favor me relate que sera rapidamente corrigido. PRINTS: DOWNLOAD: http://bit.ly/1OdS1Ii Sources GitHub: https://github.com/Kevick/pfield-cdbar-source/ SCAN: https://www.virustotal.com/pt/url/ca440fdaf52124c425edadca296a82cef81b9306ecc1fba515dd2bfbcd8c7562/analysis/1452466545/ CREDITOS: Kevick (CDBAR-FUNCIONAL) Aberos (Otclient) Avronex CipSoft - Sem ela isso tudo nao existiria1 ponto -
Templo subterrâneo
RigBy reagiu a Administrador por um tópico no fórum
Templo Subterrâneo 8.6 Templo Subterrâneo - www.xtibia.com.rar1 ponto -
Eae galeerrra xtibiana. 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); static int32_t luaDoRemovePlayerTv(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);} Procure denovo em player.h: typedef std::list<Party*> PartyList; E adicione embaixo: typedef std::list<uint32_t> Tvlist; Continuando em player.h procure: AttackedSet attackedSet; Coloque embaixo: Tvlist 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: std::string str; 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: 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"/> Video do sistema em execução: E recomendavel NUNCA modificar as storages porques estão ligados aos codigos. Para mudar o id da camera e so mudar a variavel ID_ITEM_TV Para deletar uma tv diga o comand /delete1 ponto
-
Nova seção: Escola de Scripting LUA
AngellGreen reagiu a Caronte por um tópico no fórum
Olá EkzTibianos, tenho o prazer de informar que estarei criando conteúdos para uma nova seção! Aulas de Scripting, e conto muito com a sua presença. Se VOCÊ quer aprender LUA de um jeito fácil e descomplicado, junte-se a nós, e venha ver as aulas que vão lhe ensinar a fazer scripts do nível de quest à sistemas bem desenvolvidos. Com a minha ajuda, e talvez a ajuda de membros e equipe, vamos nos prontificar à criar um espaço de suporte na própria seção de aprendizado, para que suas dúvidas em relação à scripting sejam tiradas rápidamente. As aulas irão explicar conteúdos em etapas, cada aula antecessora será uma base para a sucessora, já tenho rascunho de conteúdos da Aula-[0], que irá trabalhar com a velha e chata lógica de programação (extremamente necessária - porém de um jeito diferente) e alguns termos que serão utilizados posteriormente. Também contaremos com Deveres de casa, para que possam por em prática o que aprenderam na aula atual, esses deveres irão render pontos para quem cumprir com sagacidade, que servirão para outra novidade que ainda virá. Estou esperando o feedback de vocês ansiosamente neste tópico, eu vou gostar muito caso tenha uma repercussão boa e que possa ajudar o máximo de pessoas possíveis...1 ponto -
Olá pessoal, venho trazer para vocês uma spell de auto-destruição! Ela cria 3 áreas de combate, e sacrifica o usuário em troca de grande quantidade de dano em todo mundo que estiver ao redor. Essa spell é inspirada em memes da internet. nenhuma referencia é considerada sátira a qualquer religião. Screenshots: Script: TAG spells.xml: <instant name="auto-destruicao" words="ALAH AKBAR!" event="script" value="alahakbar.lua"/> Créditos: @Caronte @Night Wolf1 ponto
-
[Encerrado]Biohazard Corporation
chateadoagr reagiu a Yan Liima por um tópico no fórum
Achei bacana está sua ideia de criar um servidor de Resident Evil, gostaria de ouvir mais sobre isso, quem sabe eu te ajudo rsrs1 ponto -
Zueira total! 10.90 Global
Marco Oliveira reagiu a Administrador por um tópico no fórum
Esse tópico que é uma zueira.1 ponto -
Vai no seu config.lua do servidor, tente achar o que irei te mandar... accountManager = true Achou? agora bastar configurar corretamente. EXPLICAÇÃO: accountManager = true -- Ativar ou Desativar o ACC Manager namelockManager = false -- É possível algum player criar um char com o nome Account Manager? newPlayerChooseVoc = true -- True para o player escolher a vocação que ele quer ser no ACC Manager, e false para não escolher. newPlayerSpawnPosX = 302 -- Onde o novo player criado irá aparecer pos X newPlayerSpawnPosY = 48 -- Onde o novo player criado irá aparecer pos Y newPlayerSpawnPosZ = 5 -- Onde o novo player criado irá aparecer pos Z newPlayerTownId = 1 -- Cidade em que o personagem criado irá nascer newPlayerLevel = 1 -- Level inicial quando criar o personagem newPlayerMagicLevel = 0 -- MagicLevel inicial quando criar o personagem No newPlayerChooseVoc deixa true assim o jogador podera escolher o seu personagem Knight... etc Se caso está aparecendo até personagem que não deve aparecer, ou os personagens não está aparecendo para escolher vá na pasta \data\XML e abre a vocations.xml Agora no final de todas vocações coloque uma tag. que você quer que apareça no menu do accnout manager ou não... Para aparecer coloque: manager="1" Para não aparecer coloque: manager="0" Exemplo: <vocation id="1" name="Knight" description="a knight" needpremium="0" gaincap="100" gainhp="270" gainmana="230" manager="1"> Observe que tem o manager="1" no final. E para mudar a posição do Account Manager ou a outfit dele é na database/players.1 ponto
-
[TFS 1.x] save automatico ao sair
icaro201094 reagiu a kaleudd por um tópico no fórum
em game.cpp,procure por: oid Game::shutdown() { std::cout << "Shutting down..." << std::flush; g_scheduler.shutdown(); g_databaseTasks.shutdown(); g_dispatcher.shutdown(); map.spawns.clear(); raids.clear(); cleanup(); if (serviceManager) { serviceManager->stop(); } ConnectionManager::getInstance().closeAll(); std::cout << " done!" << std::endl; } e substitua por este: void Game::shutdown() { std::cout << ">> Shutting down...\n> " << std::flush; saveGameState(); g_scheduler.shutdown(); g_databaseTasks.shutdown(); g_dispatcher.shutdown(); map.spawns.clear(); raids.clear(); cleanup(); if (serviceManager) { serviceManager->stop(); } ConnectionManager::getInstance().closeAll(); std::cout << "> Done!" << std::endl; } créditos: Fir3element1 ponto -
Object BUilder 10.9
chateadoagr reagiu a felzan por uma questão
Cara, tua sorte é que to mt ocupado ('-') https://www.bountysource.com/issues/11478897-possibility-to-port-it-to-10-76 um cara lançou uma versão fazem 4 dias. Ainda não testei, mas ele diz funcionar na 10.90 Edit: Ele havia publicado, mas retirou até que receba o prêmio, aguardemos...1 ponto -
Quando as sprites tiveram uma drástica mudança (10.77 acho) o Object builder "não acompanhou". Ainda não há suporte para versões superiores à 10.77 Tem um prêmio para quem conseguir fazer funcionar e disponibilizar o código 270 dólares no momento.1 ponto
-
PokeHunter
LocAnderson reagiu a Danihcv por um tópico no fórum
@@LocAnderson, tranquilo. Quando vc perceber que bugou e criou sozinho um topico duplo, basta usar o botão de Denunciar (que se encontra no rodapé de cada post) e informar o ocorrido.1 ponto -
Poke tournament (pokemon)
kaleudd reagiu a PokeTournament por um tópico no fórum
novo inventario juntei skills inventario e bag em uma unica janela1 ponto -
PokeHunter
LocAnderson reagiu a Danihcv por um tópico no fórum
@@LocAnderson, amigo, pf tome cuidado na hora de criar um tópico novo. Atente-se para o seguinte: é proibido criar um tópico duplicado, ou seja, se vc já tiver criado um tópico e gostaria que ele voltasse ao topo da lista de "posts recentes", basta dar um UP no topico existente (basta entrar no topico e postar: UP). @@kaleudd, aprecio sua vontade de qrer ver o fórum em ordem. Porém, quando vc ver alguma situação que não se enquadre nas regras, basta apenas reportar (como vc fez). O que qro dizer é que vc ñ precisa postar no topico dizendo que o membro está fora das regras, pois isto é considerado sub-moderação. Agradeço a compreensão de todos. Abraços.1 ponto -
Skills stages
mcjefi reagiu a narutomaniacos por um tópico no fórum
Vi umas pessoas querendo esse script então como não achei no forum resolvi postar.. serve para regular os rates do seu server, exemplo: do level 30 até o 49 o Rate ml(dificuldade para UPAR) é 1 primeiro vá em config.lua procure por Rates em rateSkill deixe 1 Em creaturescript/scripts/skills (caso não tenha pasta skills crie) copie e cole qualquer script, então o renomeie para "stagesconfig" e cole isso dentro: Depois, copie e cole qualquer script, então o renomeie para "skillstageslogin" e cole isso dentro: Depois, copie e cole qualquer script, então o renomeie para "skillstagesadvance" e cole isso dentro: Depois vá em login.lua e registre as tags: registerCreatureEvent(cid, "SkillStagesLogin") registerCreatureEvent(cid, "SkillStagesAdvance") e então em creaturescripts.xml: <event type="login" name="SkillStagesLogin" event="script" value="skills/skillstageslogin.lua" /> <event type="advance" name="SkillStagesAdvance" event="script" value="skills/skillstagesadvance.lua" /> Para configurar é simples, basta ir em stagesconfig: por exemplo no fist fight {0,3},{30,2} = no level 0 o rate skill sera 3, isso só ira mudar no level 30 que o rate sera 2, configure todas as skills ao seu gosto! OBS: Testado em tfs 0.3.6(8.60) Creditos: Autor desconhecido(caso você seja o criador do escript informe e colocarei os creditos), eu pelo tópico. Espero ter ajudado.1 ponto -
erro em login.lua
Silveira Crtba reagiu a clebao666 por uma questão
local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) local accountManager = getPlayerAccountManager(cid) if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 80 then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 90) doCreatureSetDropLoot(cid, false) end if getPlayerLevel(cid) >= 81 and getPlayerLevel(cid) <= 149 then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 80) doCreatureSetDropLoot(cid, false) end if getPlayerLevel(cid) >= 150 then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 75) doCreatureSetDropLoot(cid, false) end if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if getCreatureName(cid) == "Account Manager" then local outfit = {} if accountManagerRandomPokemonOutfit then outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])} else outfit = accountManagerOutfit end doSetCreatureOutfit(cid, outfit, -1) return true end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end local outfit = {} if getPlayerVocation(cid) == 0 then doPlayerSetMaxCapacity(cid, 0) doPlayerSetVocation(cid, 1) setCreatureMaxMana(cid, 6) doPlayerAddSoul(cid, -getPlayerSoul(cid)) setPlayerStorageValue(cid, 19898, 0) if getCreatureOutfit(cid).lookType == 128 then outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)} elseif getCreatureOutfit(cid).lookType == 136 then outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)} end doCreatureChangeOutfit(cid, outfit) end registerCreatureEvent(cid, "dropStone") registerCreatureEvent(cid, "ShowPokedex") --alterado v1.6 registerCreatureEvent(cid, "ClosePokedex") --alterado v1.6 registerCreatureEvent(cid, "WatchTv") registerCreatureEvent(cid, "StopWatchingTv") registerCreatureEvent(cid, "WalkTv") registerCreatureEvent(cid, "RecordTv") registerCreatureEvent(cid, "PlayerLogout") registerCreatureEvent(cid, "WildAttack") registerCreatureEvent(cid, "Idle") registerCreatureEvent(cid, "PokemonIdle") registerCreatureEvent(cid, "EffectOnAdvance") registerCreatureEvent(cid, "GeneralConfiguration") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "LookSystem") registerCreatureEvent(cid, "T1") registerCreatureEvent(cid, "T2") registerCreatureEvent(cid, "task_count") registerCreatureEvent(cid, "pokemons") addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "Bem Vindo!!", COLOR_BURN) if getPlayerStorageValue(cid, 99284) == 1 then setPlayerStorageValue(cid, 99284, -1) end if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then setPlayerStorageValue(cid, 6598754, -1) setPlayerStorageValue(cid, 6598755, -1) doRemoveCondition(cid, CONDITION_OUTFIT) --alterado v1.9 \/ doTeleportThing(cid, posBackPVP, false) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) end doChangeSpeed(cid, -(getCreatureSpeed(cid))) --///////////////////////////////////////////////////////////////////////////-- local storages = {17000, 63215, 17001, 13008, 5700} for s = 1, #storages do if not tonumber(getPlayerStorageValue(cid, storages)) then if s == 3 then setPlayerStorageValue(cid, storages, 1) elseif s == 4 then setPlayerStorageValue(cid, storages, -1) else if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then setPlayerStorageValue(cid, storages, 1) else setPlayerStorageValue(cid, storages, -1) end end doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright") end end --/////////////////////////////////////////////////////////////////////////-- if getPlayerStorageValue(cid, 17000) >= 1 then -- fly local item = getPlayerSlotItem(cid, 8) local poke = getItemAttribute(item.uid, "poke") doChangeSpeed(cid, getPlayerStorageValue(cid, 54844)) doRemoveCondition(cid, CONDITION_OUTFIT) doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) local apos = getFlyingMarkedPos(cid) apos.stackpos = 0 if getTileThingByPos(apos).itemid <= 2 then doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE) doCreateItem(460, 1, getFlyingMarkedPos(cid)) end doTeleportThing(cid, apos, false) if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8 end local posicao = getTownTemplePosition(getPlayerTown(cid)) markFlyingPos(cid, posicao) elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf local item = getPlayerSlotItem(cid, 8) local poke = getItemAttribute(item.uid, "poke") doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1) --alterado v1.6 doChangeSpeed(cid, getPlayerStorageValue(cid, 54844)) if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8 end elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride local item = getPlayerSlotItem(cid, 8) local poke = getItemAttribute(item.uid, "poke") if rides[poke] then doChangeSpeed(cid, getPlayerStorageValue(cid, 54844)) doRemoveCondition(cid, CONDITION_OUTFIT) doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8 end else setPlayerStorageValue(cid, 17001, -1) doRegainSpeed(cid) end local posicao2 = getTownTemplePosition(getPlayerTown(cid)) markFlyingPos(cid, posicao2) elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then setPlayerStorageValue(cid, 13008, 0) doRegainSpeed(cid) doRemoveCondition(cid, CONDITION_OUTFIT) return true end if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) else doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1) end doChangeSpeed(cid, 800) elseif getPlayerStorageValue(cid, 5700) > 0 then --bike doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, getPlayerStorageValue(cid, 5700)) --alterado v1.8 if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 1394}, -1) else doSetCreatureOutfit(cid, {lookType = 1393}, -1) end elseif getPlayerStorageValue(cid, 75846) >= 1 then --alterado v1.9 \/ doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 75846, -1) sendMsgToPlayer(cid, 20, "You have been moved to your town!") else doRegainSpeed(cid) end if getPlayerStorageValue(cid, 22545) >= 1 then setPlayerStorageValue(cid, 22545, -1) doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false) setPlayerRecordWaves(cid) end if useKpdoDlls then doUpdateMoves(cid) doUpdatePokemonsBar(cid) onPokeHealthChange(cid) end return true end tirei o login.lua da pasta \data\creaturescripts\scripts e coloquei esse que um amigo me passo fico certinho agora.1 ponto -
Obrigado , fico feliz com sua opinião1 ponto