Líderes
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 01/16/20 em todas áreas
-
Alterações no Otclient
BrunooMaciell reagiu a Developer Berg por um tópico no fórum
Olá gente, vim através desse post mostrar algumas alterações básicas no Otclient que fiz. aceito criticas e sugestões Intro do Otclient: Game_Console: se ele apertar (Enter) desativa o console e ele pode andar com as letras do teclado ( W, A, S, D ), Adicionei um Fade System pra aliviar a volta do console. Cursor do mouse: Alterei o cursor padrão do game, e alterei o cursor de mover coisas, ainda falta alterar alguns.1 ponto -
Porta que só atravessa se matar todos os monstros (pokes) dentro da area
mcjefi reagiu a Marshmello por um tópico no fórum
Fala pessoal , tava sem nada pra fazer ai me decidir fazer um script que sô pegaria o premio da quest se derrota-se todos os pokes que estivesse em uma área então vou compartilhar com vocês Em data/actions/script crie um arquivo .lua e cole isso dentro Depois vá em data actions/actions.xml e cole isso dentro em XXX Você coloca um numero para a porta E isso Flw1 ponto -
Adiciona no interface modules\game_interface/interface.otmod - game_heldmachine1 ponto
-
Coloca pra dar autoload no arquivo do otmod autoload: true1 ponto
-
[TUTORIAL] Criando site com Znote AAC para TFS 1.2
GeanPro reagiu a GamerGoiano por um tópico no fórum
Mds mano vc fez uma bagunça do krl, apaga esse banco de dados e importa esse do ntospace e segue o tutorial passo a passo ai quando acessar 127.0.0.1 Vai aparecer aquele quadrado pra colar no sql @GeanPro1 ponto -
Cave hunt - Medusa Sanctuary. Download: Here Scan: Here Imagens: OBS: O mapa pode conter pequenos erros que são imperceptíveis no map editor mas visíveis in-game.1 ponto
-
Eae galera, estava passando aqui por essa seção e vi que só havia a função onSpawn para TFS 0.4, então resolvi trazer para 0.3.6 Primeiramente, va em Creatureevent.h e procure por: uint32_t executePrepareDeath(Creature* creature, DeathList deathList); E cole embaixo: uint32_t executeOnSpawn(Creature* creature); Procure por: CREATURE_EVENT_DEATH, E cole isso por cima da linha de baixo: CREATURE_EVENT_PREPAREDEATH, CREATURE_EVENT_SPAWN Agora va em creatureevent.cpp e procure por: else if(tmpStr == "preparedeath") m_type = CREATURE_EVENT_PREPAREDEATH; E cole embaixo: else if(tmpStr == "spawn") m_type = CREATURE_EVENT_SPAWN; Procure por: case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath"; E cole embaixo: case CREATURE_EVENT_SPAWN: return "onSpawn"; Procure por: case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList"; E cole embaixo: case CREATURE_EVENT_SPAWN: return "cid"; Va ao fim do arquivo e cole isso: uint32_t CreatureEvent::executeOnSpawn(Creature* creature) { //onSpawn(cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << 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__ std::stringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); bool result = m_interface->callFunction(1); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeCast] Call stack overflow." << std::endl; return 0; } } Va em monster.cpp e procure por: void Monster::onCreatureAppear(const Creature* creature) { Creature::onCreatureAppear(creature); if(creature == this) { //We just spawned lets look around to see who is there. if(isSummon()) isMasterInRange = canSee(master->getPosition()); Embaixo pressione enter 2x e cole: CreatureEventList spawn = getCreatureEvents(CREATURE_EVENT_SPAWN); for(CreatureEventList::iterator it = spawn.begin(); it != spawn.end(); ++it) (*it)->executeOnSpawn(this); E pronto, basta compilar agora Exemplos de como usar essa função: -- EDIT -- Para fazer com que o evento seja iniciado junto com o servidor ao invés de somente quando o monstro der RESPAWN, va em spawn.cpp e procure por: bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup /*= false*/) { Monster* monster = Monster::createMonster(mType); if(!monster) return false; if(startup) { //No need to send out events to the surrounding since there is no one out there to listen! if(!g_game.internalPlaceCreature(monster, pos, false, true)) { delete monster; return false; } } else { if(!g_game.placeCreature(monster, pos, false, true)) { delete monster; return false; } } monster->setSpawn(this); monster->addRef(); monster->setMasterPosition(pos, radius); monster->setDirection(dir); spawnedMap.insert(SpawnedPair(spawnId, monster)); spawnMap[spawnId].lastSpawn = OTSYS_TIME(); return true; } e apague essa parte: { //No need to send out events to the surrounding since there is no one out there to listen! if(!g_game.internalPlaceCreature(monster, pos, false, true)) { delete monster; return false; } } else Pronto, agora a função é executada assim que o servidor inicia Se os monstros pararem de dar respawn, ao invés de apagarem a parte que citei acima, troquem isso: bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup /*= false*/) { Monster* monster = Monster::createMonster(mType); if(!monster) return false; if(startup) { //No need to send out events to the surrounding since there is no one out there to listen! if(!g_game.internalPlaceCreature(monster, pos, false, true)) { delete monster; return false; } } else { if(!g_game.placeCreature(monster, pos, false, true)) { delete monster; return false; } } monster->setSpawn(this); monster->addRef(); monster->setMasterPosition(pos, radius); monster->setDirection(dir); spawnedMap.insert(SpawnedPair(spawnId, monster)); spawnMap[spawnId].lastSpawn = OTSYS_TIME(); return true; } Por isso: bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup /*= false*/) { Monster* monster = Monster::createMonster(mType); if(!monster) return false; if(startup) { //No need to send out events to the surrounding since there is no one out there to listen! if(!g_game.internalPlaceCreature(monster, pos, false, true)) { delete monster; return false; } else { monster->onCreatureAppear(monster); } } else { if(!g_game.placeCreature(monster, pos, false, true)) { delete monster; return false; } } monster->setSpawn(this); monster->addRef(); monster->setMasterPosition(pos, radius); monster->setDirection(dir); spawnedMap.insert(SpawnedPair(spawnId, monster)); spawnMap[spawnId].lastSpawn = OTSYS_TIME(); return true; } Créditos: Doggynub por fazer a função (OTIlha) ArkSeyonet por adaptar para 0.3.6 (OTIlha) Eu por pequenas edições :3 Slicer1 ponto
-
Não se esqueçam de registrar o evento no arquivo .XML dos monstros que poderão spawnar um boss. local config = { chance = 1, --Coloquem apenas números inteiros (1 - 0.0001%). bosses = { --["monster_name"] = "boss", ["Dragon Lord"] = "Demodras", }, } function onSpawn(cid) if isMonster(cid) then addEvent(function() if isCreature(cid) then local boss = config.bosses[getCreatureName(cid)] if boss and math.random(1, 1000000) <= config.chance then local pos = getThingPos(cid) doRemoveCreature(cid) doCreateMonster(boss, pos) end end end, 5) end return true end1 ponto
-
Claro, seria quase o mesmo processo. Porém, neste caso, você teria que configurar uma tabela indicando os monstros e seus respectivos "shinies". Já adianto a ambos: será necessário instalar nas sources o creatureevent onSpawn. Link para a versão 0.3.6 Link para a versão 0.41 ponto
Líderes está configurado para São Paulo/GMT-03:00