Histórico de Curtidas
-
lucasromero recebeu reputação de Well ownaz em Comando !bug bugadofunction onSay(cid, words, param) local pos = {x=1030, y=910, z=7} if(getCreatureCondition(cid, CONDITION_INFIGHT)) == FALSE then doTeleportThing(cid, pos, true) doSendMagicEffect(getPlayerPosition(cid),3) doPlayerSendTextMessage(cid, 19, "Teleportado!") else return doPlayerSendTextMessage(cid, 19, "Somente sem battle.") end return true end
-
lucasromero deu reputação a Wise em onMoveItem(cid, item, count, toContainer, fromContainer, ...)Notei que alguns membros precisavam desse creature event pra desenvolver alguns sistemas, então eu resolvi compartilhá-lo com vocês.
Na source, em creatureevent.cpp
Abaixo de:
else if(tmpStr == "preparedeath") m_type = CREATURE_EVENT_PREPAREDEATH;
Adicione:
else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM;
Abaixo de:
case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";
Adicione:
case CREATURE_EVENT_MOVEITEM: return "onMoveItem";
Abaixo de:
case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
Adicione:
case CREATURE_EVENT_MOVEITEM: return "cid, item, count, toContainer, fromContainer, fromPos, toPos";
Antes de:
bool CreatureEvents::playerLogout(Player* player, bool forceLogout)
Adicione:
uint32_t CreatureEvent::executeMoveItem(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } }
Agora, em creatureevent.h
Abaixo de:
uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
Adicione:
uint32_t executeMoveItem(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);
Procure por:
CREATURE_EVENT_PREPAREDEATH
Substitua por:
CREATURE_EVENT_PREPAREDEATH, CREATURE_EVENT_MOVEITEM
E em game.cpp
Depois de:
if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; }
Adicione:
bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM); for(CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if(!(*it)->executeMoveItem(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if(!success) return false;
Um exemplo BEM simples do uso desse creature event:
Tag:
<event type="moveitem" name="MoveItem" event="script" value="moveitem.lua"/>
moveitem.lua
function onMoveItem(cid, item, count, toContainer, fromContainer, fromPos, toPos) local item = 12345 if item.itemid == item and getPlayerAccess(cid) < 4 then return doPlayerSendCancel(cid, 'You are not allowed to move this item.') and false end return true end Nessa estrutura de controle, se o item for o de ID 12345 e o cid tiver acesso menor do que 4, retornará false e ele não poderá mover o item.
Se não for o caso, a checagem feita será false e retornará true, então o cid poderá mover o item.
Esse callback registra creature event?
Sim:
registerCreatureEvent(cid, "MoveItem")
Créditos: Summ.
-
lucasromero deu reputação a luanluciano93 em TFS 0.4 CASTOlá pessoal, tive a iniciativa de criar esse tópico para atualizar e otimizar as sources do TFS 0.4 DEV que é uma das mais usadas no mundo do otserv. Conteúdo totalmente gratuito e pretendemos melhora-lo cada vez mais.
Qualquer um pode colaborar, postando bugs, erros, otimizando códigos, comentar aqui no tópico, toda ajuda é bem vinda, vamos tornar essa a melhor source disponível. Conto com vocês.
Versão do Tibia: 8.60
Alguns sistema já implementados na source:
• TFS 0.4 DEV rev 3777 (by TFS Team)
• Anti-Divulgação (.servegame, .no-ip, .net, .com, .org, .pl, .biz, .br, .sytes, .info)
• War System
• Cast System (by Summ)
• Retirado bugs de anti-push ..
• Retirado bugs de elfbot ...
• Retirado erro de não aceitar outros items ...
• Retirado erro de Malformed File ...
• Add creatureevent onMoveItem() ...
• Add função getCreaturePathTo () ...
• E vários outros!
Complementos:
• Add cast System (passo a passo): [AQUI]
• Pode add o comando na config.lua:
healthHealingColor = COLOR_GREEN -- [podendo alterar a cor]. manaHealingColor = COLOR_DARKPURPLE -- [podendo alterar a cor]. Downloads:
• Distro Compilada 32x
• Distro Compilada 64x
• Sources 7
TESTADO EM WINDOWS, DEBIAN 7.8, UBUNTU 12.04 E 14.05!
• Compilar em Linux:
• Erros para arrumar:
Obrigado ao runeraserver pelo incentivo em fixa-la para linux
E é isso pessoal, espero ter ajudado, abraços
-
lucasromero deu reputação a Huziwara em [Resolvido] Exp quando morreVocê quer isso para todos os levels, ou apartir de 1 level ?
Se for para todos os levels, é só você diminuir no config.lua :
deathLostPercent = 10
Quando o player morre, ele perde 10% de toda exp que ele tem...
Dai é só você diminuir, espero ter ajudado !
Att. Huziwara no Mokou
-
lucasromero deu reputação a Chiitus em Evento Double Exp com dia e hora específicoEste script dá double exp à todos os player que estiverem online ou entrarem durante o tempo especificado no dia X.
Pra quem não sabe, apenas crie um arquivo "QUALQUER-NOME.xml" na pasta "mods" (mesmo lugar do executável do servidor), cole isso dentro e salve:
É isso aí galera, caso tenha dúvidas poste aqui.
Créditos:
Script: Tomek
Xevis
Tópico: Eu '-'
-
lucasromero deu reputação a r0bert0lol em Criando char com nick monster [HELP]Bom, para quem tiver com o mesmo problema eu resolvi colocando os monstros na tag da config.lua do site.
$config['invalidNameTags'] = array("ares", "gm", "cm", "gamemaster", "hoster", "admin", "Naruto Shinobi", "Sasuke Shinobi", "Venom Snake", "Anbu", "Anbu Nucleo", "Akatsuki Zetsu", "admin"); Ai coloquei todos os monstros e funcionou -
lucasromero recebeu reputação de apf0st em Comando !bug bugadofunction onSay(cid, words, param) local pos = {x=1030, y=910, z=7} if(getCreatureCondition(cid, CONDITION_INFIGHT)) == FALSE then doTeleportThing(cid, pos, true) doSendMagicEffect(getPlayerPosition(cid),3) doPlayerSendTextMessage(cid, 19, "Teleportado!") else return doPlayerSendTextMessage(cid, 19, "Somente sem battle.") end return true end
-
lucasromero deu reputação a EdsonJunior em Dice Gambling V.2.0.3TESTADO 29/01/2014 - FUNCIONANDO 100%
Informações Básicas
Exp/h: nada
Lucro: Depende da sua sorte
Vocação: Qualquer
Level recomendado: 9+
Dificuldade: Nenhuma
Quest requerida: Nenhuma
Descrição
Dice Script: Dados / High Low é um sistema de apostas, a pessoa aposta no LOW que significa (1,2,3) ou HIGH (4,5,6). Se o jogador adivinhar algum numero entre H/L, ele vai ganhar uma porcentagem que você define (padrão 80%). Possibilidade(s) de uma vitória é de 1 a 2 (50%), de modo que se baseia na sorte.
VEJA COMO FUNCIONA COM A GRAVAÇÃO NO TIBIACAST
Nota:
Certifique-se sempre têm pelo menos um Dice. Usar apenas os depot de Norte e Sul Esse aceita somente platinum e crystal coins como aposta. Atenção:
Não use as Brown Backpack, o script não aceita. Este script exige um computador rápido! Verifique se você tem espaço suficiente para abrir todas as Backpack (5), se você não tiver, veja esse tutorial Saiba que esse script (iBot) não é tão rápido como Skynet Dicer.
TUTORIAL
ATENÇÃO: Vá em Tibia > Options > Console > Show Levels in Console > Desmarque... depois em Tibia > Options > General > Marque a opção Tibia Classic Control
1. Fique enfrente ao depot (Use somente o DEPOT do lado DIREITO (Norte ou Sul)
2. Configure suas backpacks conforme explica a BP Setup
2.1
3. Coloque o Dice na MainBP
4. Vá em Actions > List > Start > Enabled > Yes (Ative somente 1 vez, se desativar e ativar denovo, irá bugar, então CONFIGURE tudo antes de ativar essa action)
Download
Script: Dice Gambling HighLow BlakW v2.0.3.xml
Tutorial .jpeg: http://www.4shared.com/photo/vBFDJFQ3ba/READ_ME_-_User_Manual_-_IBSetu.html?
TESTADO FUNCIONANDO 100%
TOPICO ANTIGO, FECHADO!
EdsonJunior
Agradecimento ao @ViniciusHenrique
-
lucasromero deu reputação a Leite em [CRACK] IBOT 10.76 e outras versoesEstou trazendo algumas versoes do ibot com crack
#Ibot 10.53: iBot v2.5.0 (10.53).rar
#Ibot 10.58: iBot.rar
#Ibot 10.75: iBot.rar
#Ibot 10.76: iBot.rar
Se foi util da um rep+
-
lucasromero deu reputação a Bluetooth em (Resolvido)Mudar URL do PHPMYADMINmuda o nome da pasta phpmyadmin ficando
http://site.net/novonome
-
lucasromero deu reputação a Fir3element em (Resolvido)Mudar URL do PHPMYADMINhttp://www.thetechrepo.com/main-articles/488-change-default-access-url-of-phpmyadmin.html
-
lucasromero deu reputação a Emersonssss em [SOURCE C++] Bunshin no JutsuTestado em 0.3.7 8.60
Creditos?
50% = Emerson Henrique ( EU )
50% = MeNi (OtLand)
Porq 50% para mim?
R:Quando ele Posto o Sistema não posto todas as funções para Adc e como eu fiz isso 50%.
Vamos A Magica ou Jutsu
em LuaScript.cpp
Procure Por :
//getPlayerBlessing(cid, blessing) Adicione Abaixo :
//doCreateCustomMonster(name, pos, outfit, health, spells, corpse, distance, experience ) lua_register(m_luaState, "doCreateCustomMonster", LuaInterface::luaDoCreateCustomMonster); Procure Por :
int32_t LuaInterface::luaGetPlayerBlessing(lua_State* L) Adicione Abaixo do Final dessa Função:
int32_t LuaInterface::luaDoCreateCustomMonster(lua_State* L) { //doCreateCustomMonster(name, pos, outfit, health, spells, corpse, distance, experience ) // created By MeNi for otland.net // uint64_t health,corpse,distance,experience; Outfit_t outfit; PositionEx pos; MonsterType* pobranyTyp = NULL; pobranyTyp = new MonsterType(); experience = popNumber(L); distance = popNumber(L); corpse = popNumber(L); std::string spells = popString(L); health = popNumber(L); outfit = popOutfit(L); popPosition(L, pos); std::string name = popString(L); Monster* monster; pobranyTyp->spellAttackList.clear(); pobranyTyp->health = health; pobranyTyp->healthMax = health; pobranyTyp->outfit = outfit; pobranyTyp->name = name; pobranyTyp->nameDescription = name; pobranyTyp->lookCorpse = corpse; pobranyTyp->targetDistance = distance; pobranyTyp->experience = experience; pobranyTyp->isSummonable = pobranyTyp->isIllusionable = pobranyTyp->isConvinceable = pobranyTyp->isWalkable = pobranyTyp->pushable = false; pobranyTyp->isAttackable = pobranyTyp->isHostile = pobranyTyp->canPushItems = pobranyTyp->canPushCreatures = true; pobranyTyp->defense = 50; pobranyTyp->armor = 80; pobranyTyp->baseSpeed = 200; pobranyTyp->changeTargetSpeed = pobranyTyp->changeTargetChance = 0; xmlDocPtr doc = xmlParseMemory(spells.c_str(), spells.length()); xmlNodePtr root = xmlDocGetRootElement(doc); xmlNodePtr tmpNode = root->children; while(tmpNode) { if(!xmlStrcmp(tmpNode->name, (const xmlChar*)"attack")) { spellBlock_t sb; if(g_monsters.deserializeSpell(tmpNode, sb, "doCreateCustomMonster")) pobranyTyp->spellAttackList.push_back(sb); } tmpNode = tmpNode->next; } monster = Monster::createMonster(pobranyTyp); if(!g_game.placeCreature(monster, pos, false, false)) { delete monster; lua_pushboolean(L, true); return 1; } ScriptEnviroment* env = getEnv(); lua_pushnumber(L, env->addThing((Thing*)monster)); return 1; } Em LuaScript.h
Procure Por :
static int32_t luaDoRemoveItem(lua_State* L); Adicione Abaixo :
static int32_t luaDoCreateCustomMonster(lua_State* L); Em monsters.h
Mude de Private para Public;
bool deserializeSpell(xmlNodePtr node, spellBlock_t& sb, const std::string& description = ""); Uma coisa que meu amigo e quase professor (Arthur Luna) me disse é
Arthur says : Source é source, a diferença é as modificações.
Então quase todos os sistemas são instalaveis o problema é saber oque adaptar!
Segue um Script Basico em TalkActions:
local text = '<attack name="melee" interval="2000" chance="100" range="5" radius="1" target="0"><attribute key="areaEffect" value="fire"/></attack>' function onSay(cid, words) local MaximoSummon = 10 --- Maximo de Monstros Sumonados!! No Caso So Posso Sumonar 5 Clones local summons = getCreatureSummons(cid) if(table.maxn(summons) < MaximoSummon) then -- no summons local clone = doCreateCustomMonster(getCreatureName(cid), getCreaturePosition(cid), getCreatureOutfit(cid), getCreatureMaxHealth(cid), text, 6324, 1, 100) doConvinceCreature(cid, clone) return true end return true end Criação do Script : Emerson Henrique
-
lucasromero deu reputação a poko360 em (Resolvido)Barra de VIDA/MANA por % (Porcento) ajudaeu achei um topico em outro forum, que bota a barra de mana/vida por % só que nao sei onde coloca esse script
alguem ajuda?
segue abaixo o script:
--Remove health/mana by percentages: Evil Hero(Zeriikler:Changed few things) function doPlayerAddManaPercent(cid, percent) local mana = getPlayerMaxMana(cid) doPlayerAddMana(cid, (mana / 100) * percent) return TRUE end function doPlayerAddHealthPercent(cid, percent) local health = getCreatureMaxHealth(cid) doCreatureAddHealth(cid, (health / 100) * percent) return TRUE end function doPlayerRemoveManaPercent(cid, percent) local mana = getPlayerMaxMana(cid) doPlayerRemoveMana(cid, (mana / 100) * percent) return TRUE end function doPlayerRemoveHealthPercent(cid, percent) local health = getCreatureMaxHealth(cid) doPlayerRemoveHealth(cid, (health / 100) * percent) return TRUE end --Remove HP/MANA function doPlayerRemoveHealth(cid, hp) doCreatureAddHealth(cid, -hp) return TRUE end function doPlayerRemoveMana(cid, mana) doPlayerAddMana(cid, -mana) return TRUE end onde coloca isso?
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) { msg->AddByte(0xA0); msg->AddU16((uint16_t)std::ceil(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->AddU16((uint16_t)100); msg->AddU32(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp msg->AddU32(0x7FFFFFFF); else msg->AddU32(experience); msg->AddU16(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->AddByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); msg->AddU16((uint16_t)std::ceil(player->getMana() * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA))); msg->AddU16((uint16_t)100); msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->AddByte(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->AddU16(player->getStaminaMinutes()); } -
lucasromero deu reputação a GabrielSapient em Launcher AutoUpdate C#Galera sempre procurei um Launcher AutoUpdate para meu servidor, depois de muita pesquisa e pouco conhecimento consegui fazer um em C#, está ai:
1. Download:
• Download | • Scan
2. Oque ele faz:
• Verifica a existência da versão local na pasta do cliente; • Se a versão do arquivo não existir, ele assume que a versão é "1.0" e cria um arquivo de versão; • Verifica arquivo .xml no servidor de atualização; • Baixar atualizações para todas as versões maiores do que a versão atual do cliente (atualiza tudo em apenas formato de arquivo .zip); • Extrai os arquivos .zip; • Exclui os arquivos .zip após a extração; • Arquiva a versão atualizada na pasta do cliente; • E, finalmente, desbloqueia o botão "Start Game". 3. Como editar: • Abra o arquivo .sln na pasta "VS Project" com o Visual Studio: Procure por: string Server = "http://127.0.0.1/Updates/"; • Altere o http://127.0.0.1/Updates/ para qualquer URL que você estará hospedando suas atualizações.
• Agora vamos procurar por: Process.Start("OTClient PkR DX9.exe", "\\Pokémon Rusty"); • Modifique o OTClient PkR DX9.exe pelo nome do .exe do seu Client.
• \\Pokémon Rusty e a pasta que está seu .exe e vai ficar seu Launcher. (troque sem tirar os "\\")
• No Visual Studio, selecione o controle WebBrowser(Neste caso, o nome "patchNotes") e alterar a url do "http://127.0.0.1/"para o caminho do arquivo index.html, na pasta do host: OBS: Isto á opcional, é apenas um template em .html. Você pode remove-lo e editar da maneira deseja. • Agora apenas jogue o .exe, .dll e o arquivo version da pasta "Launcher\VS Project\Launcher v2\bin\Debug ou Release" para a pasta de seu Client: Pronto! Agora e com o Site. • No host do site, apos colarmos a pasta Updates, editamos o arquivo Updates.xml, para cada atualização adicionamos um <update> fechamos com </update> como no exemplo do arquivo. Colocamos o arquivo atualização em .zip nessa mesma pasta, editando a versão e o nome no arquivo: • No arquivo version.txt colocamos a versão da nova atualização: • Uma dica para o .zip de atualização é colocar em pastas o caminho no client desejado a fazer update. Exemplo: data/things/854 nesta pasta colocaremos os arquivos que será substituído, no exemplo foi Tibia.spr e .dat. Depois compactamos e deixamos na pasta Updates, sem esquecer de colocar o nome no arquivo Updates.xml. 4. Dica • Pronto! Agora e só criar um instalador com o launcher, com atalho na área de trabalho (o launcher é o .exe que você colocou no client). Você pode modificar o launcher do jeito que quiser, o arquivo index.html e etc. Quando abrir o arquivo ele irá atualizar, liberar o botão "Start Game", e quando você clicar vai fechar o Launcher e abrir o Client. 5. Créditos Eu - Pelo launcher e pelo tutorial. -
lucasromero deu reputação a QuebradaZN em Double Exp Potion CompletaEu Uso Essa, Ela Mostra o Tempo que falta pra acabar, Achei ela super Completona! Gostei!
Em Mods Coloque esse Arquivo!
<?xml version="1.0" encoding="UTF-8"?> <mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com"> <!-- Configs and Functions --> <config name="PotionExpConfigs"><![CDATA[ ------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE configs = { time = 30, ---- TIME IN MINUTES needpa = TRUE, needlvl = {TRUE, level = 50}, costmana = {TRUE, mana = 300}, addrate = 50, -- Exp que vai adicionar em % removeonuse = TRUE } function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end function getPlayerExtraExpRate(cid) -- By MatheusMkalo return (getPlayerRates(cid)[8]-1)*100 end ]]></config> <!-- exppotion.lua --> <action itemid="7440" event="script"><![CDATA[ domodlib('PotionExpConfigs') if getPlayerStorageValue(cid, 62164) >= 1 then return doPlayerSendCancel(cid, "Voce ja ta Sob o Efeito da Potion.") end if configs.needpa and not isPremium(cid) then return doPlayerSendCancel(cid, "Voce Precisar ser Premium Para Usar") end if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then return doPlayerSendCancel(cid, "Voce Precisa ser " .. configs.needlvl.level .. " Para usar a Potion.") end if configs.costmana[1] then if getCreatureMana(cid) < configs.costmana.mana then return doPlayerSendCancel(cid, "Voce Precisar ter " .. configs.costmana.mana .. " de Mana Para usar a Potion") else doCreatureAddMana(cid, -configs.costmana.mana) end end if configs.removeonuse then doRemoveItem(item.uid, 1) end for i = configs.time*60, 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == configs.time*60 then creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "Efeito Final da Pocao de EXP.") end creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "O Efeito da Pocao vai acabar em "..a..".") end doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) doPlayerSendTextMessage(cid, 22, "Agora Voce Esta Recebendo mais EXP por Matar Monstros.") setPlayerStorageValue(cid, 62164, os.time()) creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0) return TRUE ]]></action> <creaturescript type="login" name="ExpPotion" event="script"><![CDATA[ domodlib('PotionExpConfigs') local time = configs.time if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0) for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "O Efeito da Potion Termina em.") end creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "O Efeito da Potion Termina em "..a..".") end end return TRUE ]]></creaturescript> </mod> e nessa Parte Configure ela como desejado:
configs = { time = 30, ---- TEMPO EM MINUTOS needpa = TRUE, --- NECESSITA DE PREMIUM ACCOUNT ? FALSE OU TRUE needlvl = {TRUE, level = 50}, --- LEVEL QUE MINIMO PARA USA-LÁ! costmana = {TRUE, mana = 300}, --- CUSTO DE MANA PARA USA-LÁ! addrate = 50, -- Exp que vai adicionar em % --- EXP QUE VAI DAR, 50 ESTA METADE! removeonuse = TRUE --- REMOVE A POTION APOS USAR! Vá na Script e Cace a Linha: <action itemid="7440" event="script"> e Troque o ID Pelo item ou Potion Desejado! é Isso ae! Se Ajudei Não Custa nada dar um REP né? -
lucasromero deu reputação a Summ em Arena PVPArena PvP 1x1
em data/lib/ crie arenapvp.lua :
-- CONFIGURAÇÕES AQUI arena = { --INICIO DAS CONFIGS DA POSIÇÃO-- time = 10, -- Minutos se não houver vencedor ambos são kikados player1pos = {x= 652, y= 1024, z= 7}, -- Posição 1 player2pos = {x= 652, y= 1026, z= 7}, -- Posição 2 nplayer1pos = {x= 605, y= 1008, z= 7}, -- Posição para aonde o player 1 vai ser teleportado.. nplayer2pos = {x= 612, y= 1008, z= 7}, -- Posição para aonde o player 2 vai ser teleportado.. toPos = {x= 602, y=1004, z= 7}, fromPos = {x= 610, y=1013, z= 7}, exitPos = {x= 654, y=1025, z= 7}, -- FIM DAS CONFIGS DA POSIÇÃO-- -- NÃO EDITAR SE NÃO POSSUIR CONHECIMENTO -- gstorage = 14784, -- //GLOBAL STORAGE pstorage = 14785, -- //PLAYER STORAGES } function getQuantidadeCreature(toPos, fromPos) arenaPlayers = 0 for x = toPos.x, fromPos.x do for y = toPos.y, fromPos.y do player = getTopCreature({x= x, y= y, z= fromPos.z}).uid if isPlayer(player) then arenaPlayers = arenaPlayers + 1 end end end return arenaPlayers end function doRemoveCreature(toPos, fromPos, teleportTo, storage) for x = toPos.x, fromPos.x do for y = toPos.y, fromPos.y do player = getTopCreature({x= x, y= y, z= fromPos.z}).uid if isPlayer(player) then doTeleportThing(player, teleportTo) setPlayerStorageValue(player, storage, -1) end end end return true end em data/actions/scripts crie arenapvp.lua :
dofile('data/lib/arenapvp.lua') function onUse(cid, item, toPosition, itemEx, fromPosition) local player1 = getTopCreature(arena.player1pos).uid local player2 = getTopCreature(arena.player2pos).uid if item.itemid == 1945 then doTransformItem(item.uid, item.itemid+1) if getGlobalStorageValue(arena.gstorage) < 1 then if isPlayer(player1) and isPlayer(player2) then doPlayerSendTextMessage(player1, MESSAGE_STATUS_WARNING, "Fight!") doPlayerSendTextMessage(player2, MESSAGE_STATUS_WARNING, "Fight!") doSendMagicEffect(getThingPos(player1), CONST_ME_POFF) doSendMagicEffect(getThingPos(player2), CONST_ME_POFF) setPlayerStorageValue(player1, arena.pstorage, 1) setPlayerStorageValue(player2, arena.pstorage, 1) doTeleportThing(player1, arena.nplayer1pos) doTeleportThing(player2, arena.nplayer2pos) setGlobalStorageValue(arena.gstorage, 1) addEvent(function () if getQuantidadeCreature(arena.toPos, arena.fromPos) > 0 then doRemoveCreature(arena.toPos, arena.fromPos, arena.exitPos, arena.pstorage) setGlobalStorageValue(arena.gstorage, -1) end end, 1000*60*arena.time) else doCreatureSay(cid, "need two players to start", TALKTYPE_ORANGE_1) end else doCreatureSay(cid, "has two players in arena", TALKTYPE_ORANGE_1) end elseif item.itemid == 1946 then doTransformItem(item.uid, item.itemid-1) end return true end actions.XML :
<!-- Arena Pvp --> <action actionid="2170" event="script" value="arenapvp.lua"/> em data/creaturescripts/scripts crie arenapvp.lua :
dofile('data/lib/arenapvp.lua') function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and getPlayerStorageValue(cid, arena.pstorage) == 1 and type == STATSCHANGE_HEALTHLOSS then if value >= getCreatureHealth(cid) then local killer = attacker doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doCreatureAddHealth(killer, getCreatureMaxHealth(killer)) doCreatureAddMana(killer, getCreatureMaxMana(killer)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Arena]: you lost the duel!") doPlayerSendTextMessage(killer, MESSAGE_STATUS_WARNING, "[Arena]: you win the duel!") doTeleportThing(cid, arena.exitPos) doTeleportThing(killer, arena.exitPos) doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doSendMagicEffect(getThingPos(killer), CONST_ME_POFF) setPlayerStorageValue(cid, arena.pstorage, -1) setPlayerStorageValue(killer, arena.pstorage, -1) setGlobalStorageValue(arena.gstorage, -1) return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "ArenaPVP") return true end creaturescripts.XML
<!-- ARENA PVP --> <event type="statschange" name="ArenaPVP" event="script" value="arenapvp.lua"/> <event type="login" name="verf_PVP" event="script" value="arenapvp.lua"/> Testado em tfs 0.4.
abrçs
Agradeço ao zipter e ao whitewolf, por terem me ajudado em alguns empecilhos e créditos a imagem do zibusu(otland).
-
lucasromero deu reputação a Emersonssss em [Rush Event] Revisado! 100% Funcional by EmersonBoa noite Galera Passei a noite passando esse sistema de MOD para Arquivos Separados, Achei alguem erros de cid,pid, varieveis e os concertei. Vamos la:
Testado 59x TFS : 0.4 rev 3777
Refazendo o Tutorial *.*
Na Pasta LIB
Caminha: /data/lib/
Crie um arquivo.lua chamado RushLib.lua e Adicione :
Nesse Arquivo Estão as Configurações Apenas Leia os Comentarios inseridos nele.
--data/lib function doPlayerRemoveLethalConditions(cid) local tmp = {1, 2, 4, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536} for i = 1, #tmp do if(hasCondition(cid, tmp)) then doRemoveCondition(cid, tmp) end end return true end t = { a = 32145, -- nao modifique se nao souber oq esta fazendo g = 32146, -- nao modifique se nao souber oq esta fazendo l = 32147, -- nao modifique se nao souber oq esta fazendo u = 32148, -- nao modifique se nao souber oq esta fazendo h = 32149, -- nao modifique se nao souber oq esta fazendo wv = 32150, -- nao modifique se nao souber oq esta fazendo c = 0, -- nao modifique se nao souber oq esta fazendo q = "Rush Event has been started! Enjoy and have fun!", --mensagem que vai ser exibida quando o evento começar f = 5447, -- nao modifique se nao souber oq esta fazendo f_1 = 5448, -- nao modifique se nao souber oq esta fazendo f_2 = 5449, -- nao modifique se nao souber oq esta fazendo d_1 = {x = 986, y = 1116, z = 6}, -- posição do tempo vermelho ao começar evento d_2 = {x = 986, y = 1116, z = 6}, -- posição do tempo azul ao começar evento x = "Event won't start bacause too few people were willing to participate", --mensagem que vai ser exibida quando o evento não começar w = {x = 986, y = 1114, z = 7}, --posição da sala de espera, onde os players vão ficar antes de começar lvl = 100, --level minimo para participar do evento v = 25, --a quantidade de frags que será necessária para o time ganhar mn = 4, --quantidade minima de players para começar o evento m = 40, --maximo de players dentro do evento o = "Event was completed, RED TEAM has won Rush Event!", --mensagem exibida quando o time vermelho ganhar y = "Event was completed, BLUE TEAM has won Rush Event!", --mensagem exibida quando o time azul ganhar i_1 = 2160, --id do premio (agora é crystal coin = 2160) i_2 = 10, --quantidade do premio (agora esta 10 crystal coins) t = 5, --tempo para começar o evento (agora esta is 5 minutos) r = 1 --tempo em que os resultados da batalha serão mostrados aos players (agora esta 1 minutos) } Em Creaturescripts/
No Arquivo CreatureScripts.xml Adicione as Tags
<event type="combat" name="RushCombat" event="script" value="RushCreature.lua"/> <event type="attack" name="RushAttack" event="script" value="RushCreature.lua"/> <event type="preparedeath" name="RushDead" event="script" value="RushCreature.lua"/> <event type="outfit" name="RushOutfit" event="script" value="RushCreature.lua"/> Em CreatureScripts/Scripts
Crie um Arquivo.lua e renomeie para RushCreature.lua e Adicione:
--creature/scripts/login.lua --registerCreatureEvent(cid, "RushCombat") --registerCreatureEvent(cid, "RushAttack") --registerCreatureEvent(cid, "RushDead") --registerCreatureEvent(cid, "RushOutfit") --creaturescripts/creature.xml --<event type="combat" name="RushCombat" event="script" value="RushCreature.lua"/> --<event type="attack" name="RushAttack" event="script" value="RushCreature.lua"/> --<event type="preparedeath" name="RushDead" event="script" value="RushCreature.lua"/> --<event type="outfit" name="RushOutfit" event="script" value="RushCreature.lua"/> function onCombat(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end function onOutfit(cid, old, current) if(getGlobalStorageValue(t.a) == 1) then if getPlayerGroupId(cid) > 3 then return true end if getPlayerStorageValue(cid, t.h) == 0 then if getPlayerStorageValue(cid, t.f) > -1 then doPlayerSendCancel(cid, "You cannot change your outfit during the event.") return false end end end return true end function onAttack(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end function onPrepareDeath(cid, deathList) if(not isPlayer(cid)) then return true end if getGlobalStorageValue(t.a) == 1 then local strings = {""} local j, position, corpse = 1, 1, 0 for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" j = j + 1 else strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" j = j + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end desc = "You recognize " desc = desc .. "" .. getCreatureName(cid) .. ". He was killed by " .. str end if(getPlayerSex(cid) == 1) then corpse = doCreateItem(3058, getCreaturePosition(cid)) else corpse = doCreateItem(3065, getCreaturePosition(cid)) end doItemSetAttribute(corpse, "description", desc) if((getPlayerStorageValue(cid, t.g) % 2) == 1) then setGlobalStorageValue(t.u, getGlobalStorageValue(t.u)+1) else setGlobalStorageValue(t.l, getGlobalStorageValue(t.l)+1) end local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) if blue < t.v or red < t.v then if(isPlayer(cid) == false) then return true end if((getPlayerStorageValue(cid, t.g) % 2) == 1) then doTeleportThing(cid, t.d_1) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end else doTeleportThing(cid, t.d_2) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end end end if blue >= t.v then doBroadcastMessage(t.y, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1) then doPlayerAddItem(pid, i_1, i_2) end end elseif red >= t.v then doBroadcastMessage(t.o, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_2) == 1) then doPlayerAddItem(pid, i_1, i_2) end end end if getGlobalStorageValue(t.h) == 1 then setGlobalStorageValue(t.a, 0) setGlobalStorageValue(t.h, 0) setGlobalStorageValue(t.wv, -1) setPlayerStorageValue(cid, t.f, -1) setPlayerStorageValue(cid, t.g, 0) setPlayerStorageValue(cid, t.l, 0) setPlayerStorageValue(cid, t.u, 0) setPlayerStorageValue(cid, t.f_1, -1) setPlayerStorageValue(cid, t.f_2, -1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1 or getPlayerStorageValue(pid, t.f_2) == 1) then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) setPlayerStorageValue(pid, t.g, 0) setPlayerStorageValue(pid, t.l, 0) setPlayerStorageValue(pid, t.u, 0) setPlayerStorageValue(pid, t.f_1, -1) setPlayerStorageValue(pid, t.f_2, -1) setPlayerStorageValue(pid, t.h, -1) doCreatureAddHealth(pid, getCreatureMaxHealth(pid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(pid, getCreatureMaxMana(pid)) doPlayerRemoveLethalConditions(pid) end end return false end return false end return true end Em CreatureScripts/Scripts/
Localize o Arquivo Chamado Login.lua abra-o e Adiciona antes do RETURN TRUE o seguinte :
registerCreatureEvent(cid, "RushCombat") registerCreatureEvent(cid, "RushAttack") registerCreatureEvent(cid, "RushDead") registerCreatureEvent(cid, "RushOutfit") Em GlobalEvents/
Abra o Arquivo chamado GlobalEvents.xml e Adicione s Seguinte Tag :
<globalevent name="Recognition" interval="1500" event="script" value="RushGlobalRecognition.lua"/> Em CreatureScripts/Scripts/
Crie um arquivo.lua chamado RushGlobalRecognition.lua e Adicione :
--globalevents/globalevents.xml --<globalevent name="Recognition" interval="150000" event="script" value="RushGlobalRecognition.lua"/> function onThink(interval, lastExecution, thinkInterval) if(getGlobalStorageValue(t.a) == 1) then for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then if(getPlayerStorageValue(pid, t.f_1) == 0) then doSendAnimatedText(getCreaturePosition(pid), "RED TEAM", TEXTCOLOR_RED) elseif(getPlayerStorageValue(pid, t.f_1) == 1) then doSendAnimatedText(getCreaturePosition(pid), "BLUE TEAM", TEXTCOLOR_LIGHTBLUE) end end end return true end return true end Em TalkActions/
Abra o TalkActions.xml e Adicione as Seguintes Tags:
<talkaction words="!start" event="script" access="5" value="RushTalkOpen.lua"/> <talkaction words="!rush" event="script" value="RushTalkJoin.lua"/> Em TalkActions/Scripts/
Crie um arquivo.lua chamado RushTalkOpen e Adicione :
--globalevents/globalevents.xml --<globalevent name="RushStart" time="15:53" event="script" value="RushGlobalOpen.lua"/> function onTime(interval, lastExecution) setGlobalStorageValue(t.g, 1) setGlobalStorageValue(t.u, 0) setGlobalStorageValue(t.l, 0) setGlobalStorageValue(t.a, 1) setGlobalStorageValue(t.c, 0) setGlobalStorageValue(t.wv, 0) doBroadcastMessage("Attention! Immediately register to Rush Event, event will start for ".. t.t .." minutes. All players can join to event typing this command: !rush", MESSAGE_STATUS_WARNING) addEvent(function() doBroadcastMessage("Rush event, started in 2 minutes. If you want to join, type this command: !rush", MESSAGE_STATUS_WARNING) end, (t.t - 2) * 1000 * 60) addEvent(function() doBroadcastMessage("Rush event, started in a minute. If you want to join, type this command: !rush", MESSAGE_STATUS_WARNING) end, (t.t - 1) * 1000 * 60) addEvent(start, t.t * 1000 * 60, cid) end function results() if(getGlobalStorageValue(t.a) == 1) then local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) doBroadcastMessage("Rush Events, results:\nRed Team scored: ".. red .." frags.\nBlue Team scored: ".. blue .." frags.\nMatch is under way to ".. t.v .." frags.", MESSAGE_STATUS_WARNING) addEvent(results, t.r * 1000 * 60) end end function start(cid) if(getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.c) >= t.mn) then doBroadcastMessage(t.q, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.wv, 1) addEvent(results, t.r * 1000 * 60) for _, pid in ipairs(getPlayersOnline()) do local myOutfit = getCreatureOutfit(pid) local red = {lookType = myOutfit.lookType, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = myOutfit.lookAddons} local blue = {lookType = myOutfit.lookType, lookHead = 86, lookBody = 86, lookLegs = 86, lookFeet = 86, lookTypeEx = 0, lookAddons = myOutfit.lookAddons} if getPlayerStorageValue(pid, t.f) == 1 then doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) if((getPlayerStorageValue(pid, t.g) % 2) == 1) then doCreatureChangeOutfit(pid, red) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_1) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 0) setPlayerStorageValue(pid, t.f_2, 1) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in RED TEAM!\nThis battle will continue up to ".. t.v .." frags!") else doCreatureChangeOutfit(pid, blue) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_2) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 1) setPlayerStorageValue(pid, t.f_2, 0) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in BLUE TEAM!\nThis battle will continue up to ".. t.v .." frags!") end end end elseif(getGlobalStorageValue(t.c) < t.mn) then doBroadcastMessage(t.x, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.a, 0) for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) end end end end Em TalkActions/Scripts/
Crie um arquivo.lua chamado RushTalkJoin.lua e adicione :
--talkactions/talkactions.xml --<talkaction words="!rush" event="script" value="RushTalkJoin.lua"/> function onSay(cid, words, param, channel) if getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.wv) ~= 1 then if getPlayerLevel(cid) >= t.lvl then if getPlayerStorageValue(cid, t.f) == -1 then if getTilePzInfo(getPlayerPosition(cid)) == true then if getGlobalStorageValue(t.c) < t.m then setGlobalStorageValue(t.c, getGlobalStorageValue(t.c)+1) if getGlobalStorageValue(t.c) == t.m then doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") else doBroadcastMessage("" .. getPlayerName(cid) .. " has joined to Rush Event! Actually we have: " .. getGlobalStorageValue(t.c) .. " players!", 19) end setPlayerStorageValue(cid, t.f, 1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, t.w) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, t.g, getGlobalStorageValue(t.g)) setGlobalStorageValue(t.g, tonumber(getGlobalStorageValue(t.g))+1) else doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") return true end else doPlayerSendCancel(cid, "You must be in protection zone.") return true end else doPlayerSendCancel(cid, "You are already registered in this event.") return true end else doPlayerSendCancel(cid, "Your level is too low to participate in this event.") return true end else doPlayerSendCancel(cid, "At the moment there are no records for this event.") return true end return true end Prontinho sistema Instalado ! Apenas Configure as Variaveis no Arquivo Rushlib.lua, o primeiro do Tutorial.
Comando para Abrir o Evento
!start
Comando para Participar do Evento
!rush
OBSERVAÇÃO:
NUNCA FECHAR O SERVIDOR COM O EVENTO ABERTO, SEMPRE ESPERE O EVENTO FINALIZAR CASO FAZER ISSO BUGARÁ AS STORAGES.
Creditos ?
Eu Achei em outro Forum e o Mod estava falando que era do ChaitoSoft não tenho Certeza mais Segue.
ChaitoSoft ( Provavelmente Roksas)
Emerson = 40% - Pois eu Achei Alguns Bugs e Removi e Por Ter Feitos em Varios Arquivos.
MAP:
https://www.mediafire.com/?cxoqqth3s9heqzx
SCAN:
https://www.virustotal.com/en/file/279eee03261c0d329177ee5ad54e3a746da366fd5a3da491daeaf3204f6e3315/analysis/1405238306/
Map.rar
-
lucasromero deu reputação a SniX em [Auto Stacking] Tio SniXOlá pessoal, estive reparando que varias pessoas estão a procura de como adicionar Auto Stacking no TFS 0.3.6pl1, então estarei postando o método!
1 - No Arquivo Container.cpp procure por:
Cylinder* Container::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t&)
Troque toda a Function por essa:
2 - novamente em Container.cpp procure por:
ReturnValue Container::__queryMaxCount(int32_t index, const Thing* thing, uint32_t count,
Troque toda a Function por essa:
3 - novamente em Container.cpp procure por:
ReturnValue Container::__queryRemove(const Thing* thing, uint32_t count, uint32_t flags) const
Troque toda a Function por essa:
Prontinho Auto Stack Adicionado
Perguntas
1- A Snix onde fica esse container.cpp?
R: nas sources do seu servidor.
2- A Snix qual versão do tibia funciona isso?
R: bom eu testei no tfs 0.3.6pl1 protocol 8.54 - 8.60 100% funcional.
3- A Snix o que esse system faz exatamente?
R: quando você puxa 1 item agrupável para sua bag se tiver o mesmo item na bag eles se agrupam automaticamente.
-
lucasromero deu reputação a Duda Lima em [MOD] Rush War Event!Ta ai mais um evento que é vendido pela ChaitoSoft!
#Descrição do evento: Neste evento 2 times (Azul e Vermelho) vão batalhar para conseguir a "quantidade" de frags para ganhar o evento, totalmente configuravel
#O que possui?
- Abertura automática ou via comando.
- Quantidade minima de players para o evento (configuravel)
- Level minimo para entrar no evento (configuravel)
- Quantidade de frags que terão que conquistar para ganhar (configuravel)
- Separação automática dos times (configuravel)
- Mapa incluso
- Tutorial explicativo
- Premio o time vencedor do evento (configuravel)
- Entre outras coisas….
*OBS: Este evento só funciona em TFS 0.4.
Instalação:
Em Data/Mods
Rush_Event.xml
Download do mapa.
Scan
Mais tarde posto o servidor que é vendido pela ChaitoSoft e quem sabe o cast com as source já para compilar!
Te ajudei +REP
-
lucasromero deu reputação a Danihcv em Distro - Error Lost Connection MYSQLMas o propósito de mudar a distro nesta situação é apenas para descobrir onde está o problema: se é o seu pc q ñ está conseguindo manter a conexão com a db, ou se é a distro que está falha.
Então após testar a nova distro, veremos qual o resultado e aí saberemos a raiz do problema. E aí você poderá ficar com a distro do luan (e a gnt buscar saber mais sobre como resolver o erro) ou optar por outra. Sacas?
-
lucasromero deu reputação a Danihcv em Distro - Error Lost Connection MYSQLHm...
Tentou trocar a distro?
-
lucasromero deu reputação a Cat em (Resolvido)HOUSE COM ERRO NA PORTA.no rme, em house PALETTE -> Brushes -> Select exit
esse select exit é um splash de água no mapa, deve ser colocado na frente da porta selecionada no mapa, mas na frente onde o player vai ficar pra comprar.
Fiz uma ilustração pra você:
Note que o 'splash' está onde o player deve ficar para comprar a casa.
-
lucasromero deu reputação a MaXwEllDeN em Private Shop V. 2Não chei uma área adequada para postar, então vai aqui mesmo....
-
lucasromero deu reputação a KekezitoLHP em Email System v1.3.9-- Name: E-mail System
-- Version: 1.3.9
-- Credits: Conde2
-- Tested: TFS 0.3.4(5) Crying Damson
_________________________
Sobre:
Este é um simples sistema de e-mails, que te possibilita mandar mensagens para todos os players, ate os offiline.
Necessário criar uma pasta chama "email" dentro da pasta DATA
OBS: NECESSITA DA LIB EXHAUSTION DO TFS !!
Comandos:
Código:
Agora vamos ao que interessa...
Abra a pasta data/talkactions/script e adicione isso em um arquivo lua chamado email.lua.
Dentro desse arquivo adicione esse Script:
EMAIL_BLOCK = 6364 EMAIL_ANTI_SPAWN = 15 EMAIL_MIN_MENSSAGE = 10 EMAIL_MAX_MENSSAGE = 100 EMAIL_STORAGE_ANTI_SPAWN = 6365 function onSay(cid, words, param) if words == "!sendemail" then if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param. Please use: !sendemail name, menssage") return TRUE end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No menssage specified.") return TRUE end if (getPlayerGUIDByName(t[1]) == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not exist.") return TRUE end if (string.len(t[2]) <= EMAIL_MIN_MENSSAGE) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't send this menssage, because so short.") return TRUE end if (string.len(t[2]) > EMAIL_MAX_MENSSAGE) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't send this menssage, because so long.") return TRUE end local id = getPlayerIdByName(""..t[1].."") if (getDataBaseStorage(id,EMAIL_BLOCK) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, the player: " .. t[1] .. " has been blocked yours menssages.") return TRUE end if exhaustion.check(cid, EMAIL_STORAGE_ANTI_SPAWN) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please wait a ".. exhaustion.get(cid, EMAIL_STORAGE_ANTI_SPAWN) .." secondes to send other email.") return TRUE end local directory = "data//email//".. t[1] ..".txt" if onFile("exist", directory) == FALSE then onFile("create", directory, "BY: ".. getCreatureName(cid) .." [" .. os.date("%d/%m/%Y %H:%M:%S") .. "] ".. t[2] .."\n") doPlayerSendTextMessage(cid, 22, "You have send to ".. t[1] .." this menssage: " .. t[2] .. ".") exhaustion.make(cid, EMAIL_STORAGE_ANTI_SPAWN, EMAIL_ANTI_SPAWN) else onFile("update", directory, "BY: ".. getCreatureName(cid) .." [" .. os.date("%d/%m/%Y %H:%M:%S") .. "] ".. t[2] .."") doPlayerSendTextMessage(cid, 22, "You have send to ".. t[1] .." this menssage: " .. t[2] .. "") exhaustion.make(cid, EMAIL_STORAGE_ANTI_SPAWN, EMAIL_ANTI_SPAWN) end local target = getPlayerByNameWildcard(""..t[1].."") if(target == 0) then target = getCreatureByName(""..t[1].."") if(target == 0) then return TRUE end end local tmp = getCreaturePosition(target) if (isOnline(""..t[1].."") == TRUE) then addEvent(doSendAnimatedText, 1, tmp, "Menssage!", TEXTCOLOR_PURPLE) addEvent(doSendAnimatedText, 1000, tmp, "Menssage!", TEXTCOLOR_PURPLE) addEvent(doSendAnimatedText, 2000, tmp, "Menssage!", TEXTCOLOR_PURPLE) doPlayerSendTextMessage(target, 19, " A new menssage arrived, look your email box. (!checkemail)!!") end elseif words == "!checkemail" then local name = getCreatureName(cid) local directory = "data//email//".. name ..".txt" if onFile("exist", directory) == FALSE or onFile("load", directory) == nil then doPlayerSendTextMessage(cid, 22, "Sorry you don't have any menssage.") else for line in io.lines(directory) do doShowTextDialog(cid,7528, "You have menssages: \n \n ".. line .." \n \n \n For look the next menssage click in the button: OK") end end elseif words == "!deleteemail" then local name = getCreatureName(cid) local directory = "data//email//".. name ..".txt" if onFile("exist", directory) == TRUE and onFile("load", directory) ~= nil then onFile("delete", directory) onFile("erase", directory) doPlayerSendTextMessage(cid, 22, "Sucessful!! You have deleted all yours menssages !!") else doPlayerSendTextMessage(cid, 22, "Sorry you don't have any menssage to delete.") end elseif words == "!blockemail" then setPlayerStorageValue(cid, EMAIL_BLOCK, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has been bloked your e-mail. Please relog to make effect.") elseif words == "!unblockemail" then setPlayerStorageValue(cid, EMAIL_BLOCK, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has been unbloked your e-mail. Please relog to make effect.") end end Agora vá em data/global.lua
Ou em data/lib/data.lua e adicione isso na última linha:
function isOnline(name) -- by mock local players = getOnlinePlayers() name = string.lower(name) for i, player in ipairs(players) do player = string.lower(player) if name == player then return TRUE end end return FALSE end function getDataBaseStorage(pid,value_id) -- by Conde2 local coisa = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. pid .." AND `key` ="..value_id..";") if coisa:getID() == -1 then return -1 else return coisa:getDataInt("value") end end function onFile(type, directory, content) -- by Conde2 local master = 0 if type == "create" then local file = io.open(directory, "w") master = file:write(content) file:close() elseif type == "erase" then local file = io.open(directory, "w+") master = file:write("") file:close() elseif type == "load" then local file = io.open(directory,"r") master = file:read() file:close() elseif type == "update" then local file = io.open(directory, "a+") master = file:write(content.."\n") file:close() elseif type == "return" then local file = io.open(directory, "a+") master = file:write(" "..content) file:close() elseif type == "delete" then os.remove(directory) elseif type == "exist" then file = io.open(directory) if file == nil then master = FALSE else master = TRUE end end return master end Tags:
E finalmente vá para data/talkactions/talkactions.xml
Abra ele com um bloco de notas e adicione isso:
<talkaction words="!sendemail" event="script" value="email.lua"/> <talkaction words="!deleteemail" event="script" value="email.lua"/> <talkaction words="!checkemail" event="script" value="email.lua"/> <talkaction words="!blockemail" event="script" value="email.lua"/> <talkaction words="!unblockemail" event="script" value="email.lua"/> Configurando:
Para configurar basta ir em data/talkactions/email.lua e editar isso:
EMAIL_BLOCK = 6364
EMAIL_ANTI_SPAWN = 15
EMAIL_MIN_MENSSAGE = 10
EMAIL_MAX_MENSSAGE = 100
EMAIL_STORAGE_ANTI_SPAWN = 6365
# Storage value para bloquear / desbloquear o email.
# O tempo que o player terá que esperar para mandar outra mensagem (Em segundos)
# Quantas letras no mínimo a mensagem tem que ter para poder ser enviada.
# Quantas letras no máximo deverá ter a menssagem.
# Storage para definir o exausted !!
-
lucasromero recebeu reputação de Chriistian em (Resolvido)(Pedido) TeleportMovements.xml
<movevent type="StepIn" actionid="7094" event="script" value="teleport24.lua"/> Movements/scripts/teleport24.lua
function getTime(s) local h = math.floor(s/3600) local m = math.floor((s - h * 3600) / 60) return h, m, (s - h * 3600) - m * 60 end function onStepIn(cid, item, position, fromPosition) local config = { pos = {x=1000,y=1000,z=7}, --Posição que vai ser teleportado stor = getPlayerStorageValue(cid,7094) - os.time(), } local hora, minuto, segundo = getTime(config.stor) if getPlayerStorageValue(cid,7094) < os.time() then doTeleportThing(cid,config.pos,true) setPlayerStorageValue(cid,7094,os.time()+60*60*24) else doPlayerSendTextMessage(cid, 19, "Você só poderá entrar daqui a: ".. hora .." hora(s), ".. minuto .." minuto(s) e ".. segundo .." segundo(s)") doTeleportThing(cid,fromPosition) return false end return true end