Ir para conteúdo

L3K0T

Membro
  • Registro em

  • Última visita

Tudo que L3K0T postou

  1. ALTER TABLE killers ADD war INT NOT NULL DEFAULT 0 importa pro mysql
  2. Bom galera hoje eu resolvi numerar uma tabela de cores para otserv, basta digitar o comando no seu jogo /y numero da cor Isso é bom pra trocar cor de roupas, letras e até edições na source de otc e tfs, use a criatividade.
  3. eu ri pq vi um bingu*** tão perfeito... parabéns pela sprite e o ensinamento.
  4. o que pude fazer pra vc foi isso fiz pra kinight então teste em knight, usa a mesma bases pra outras vocações, deixei tudo explicadinho. function onAdvance(player, skill, oldlevel, newlevel) --função inicial. --corpo funções local knight1 = player:getVocation():getId() == 4 --id da vocação 4 = knight. local level1 = player:getLevel() == 10 --level que vai receber a recompensa. local storage1 = 232323 --storage só mexa se vc usa essa storage pra outra coisa. local storageqt = 1 --quantidade de storage vai receber local msgreward = "Voce recebeu uma recompenca!!!" -- msg ao receber a recompença. local cormsg = 22 --cor da msg ao receber a recompença --fim --recompença em dinheiro. local dinheirolekot = 2160 --id do dinheiro. local dinheiroqtlekot = 1 --quantidade do dinheiro. --fim --recompença item. local itemrewardlekot = 7382 --id do item tipo, espada, wands, armor etc.. local itemqtlekot = 1 --quantidade do item recompença. --fim if player:getStorageValue(storage1) == storageqt then --verificar pra não receber novamente ao morrer end if level1 then --verificação if knight1 then --vocação knight player:addItem(ITEM_BAG, 1):addItem(dinheirolekot, dinheiroqtlekot) --reawrd player:addItem(ITEM_BAG, 1):addItem(itemrewardlekot, itemqtlekot) --reward player:sendTextMessage(cormsg, msgreward) --msg reward end --fim player:setStorageValue(storage1, storageqt) --verificação level para dar storage end return true end tag creturescript.xml <event type="advance" name="teste" script="reward_level_up.lua" />
  5. o item não pode ser movido pra lugar algum
  6. if moveItem.itemid == IDDOITEM then doPlayerSendTextMessage(cid,25,'você bloqueou um item para não move no jogo!') return false if moveItem.itemid == IDDOITEM then doPlayerSendTextMessage(cid,25,'você bloqueou um item para não move no jogo!') return false faça assim com linhas duplicadas se ele estiver invitado!!! eu testei já não posto nada que n seja testado. rsrs muito obrigado gatin adicione corretamente foi testado!!!
  7. adiciona certinho que da certo eu mesmo uso. isso é otclient não faz parte desse script esse script é apenas para quem não está invitado na casa, e o outro é apenas piso, slot e lock. meu script está no tutorial está completo, leia com atenção. comente sua dúvida ou erro e evite o UP.
  8. abra seu config.lua e ache monsterLootMessage mude para monsterLootMessage = 3 ache monsterLootMessageType mude para monsterLootMessageType = 25
  9. function onUse(cid, item, fromPosition, itemEx, toPosition) --Script by L3K0T local leko = { itemqt = 1, --quantidade de item que vai ser usado vipganhos = 7, -- Quantidade de vip ganhos na conta. verificarvip = 0, -- verificação no banco de dados. msg = "Você ganhou 2 dias de vip.", --menssagem que o player recebe dentro do jogo. msgfail = "Falhou", --apenas pra testar o sistema, para desativar é só por -- do lado aonde marquei com A. ver = 1, --database position = getCreaturePosition(cid), --verificar player na posisao def = 1, --numero do efeito que vai começar atef = 41, --numero do efeito até aonde pode chegar } if getPlayerVipLeko(cid) == leko.verificarvip then doPlayerAddPremiumDays(cid, leko.vipganhos) doPlayerAddVipLeko(cid, leko.ver) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msg) doRemoveItem(item.uid, leko.itemqt) for i = 1, 175 do if (fromPosition.x ~= CONTAINER_POSITION) then doSendDistanceShoot(fromPosition, {x = leko.position.x + math.random(-7,7), y = leko.position.y + math.random(-5,5), z = leko.position.z}, math.random(leko.def,leko.atef)) end end end end if getPlayerVipLeko(cid) == leko.ver then --A doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msgfail) --A return true end --Funções banco de dados by L3K0T function getPlayerVipLeko(cid) local Verh = db.getResult("SELECT `verificar` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "") if Verh:getID() ~= LUA_ERROR then local VerP= Verh:getDataInt("verificar") Verh:free() return VerP end return LUA_ERROR end function doPlayerAddVipLeko(cid, ver) local verih = getPlayerVipLeko(cid) + ver if verih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` + " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end function doPlayerRemoveVipLeko(cid, ver) local veriih = getPlayerVipLeko(cid) - ver if veriih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` - " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end fiz um outro tbm, deixa o item no chão e usa o item kkk *sua pergunta, vc só vai por dnv se vc mudar o banco o de dados ou resetar UPDATE accounts SET verificar=0; --<<< esse era so reset ? SIMMM
  10. é que vc mandou o script em radom então vc quer só 1 efeito??? qual o efeito do papel???
  11. @Mutilok importa isso primeiro pro banco de dados, não apaga a que ja importou só pra dar um update nela. UPDATE accounts SET verificar=0; function onUse(cid, item, fromPosition, itemEx, toPosition, position) --Script by L3K0T local leko = { itemqt = 1, --quantidade de item que vai ser usado vipganhos = 7, -- Quantidade de vip ganhos na conta. verificarvip = 0, -- verificação no banco de dados. msg = "Você ganhou 2 dias de vip.", --menssagem que o player recebe dentro do jogo. msgfail = "Falhou", --apenas pra testar o sistema, para desativar é só por -- do lado aonde marquei com A. ver = 1, position = getCreaturePosition(cid), def = 1, atef = 41, } if getPlayerVipLeko(cid) == leko.verificarvip then doPlayerAddPremiumDays(cid, leko.vipganhos) doPlayerAddVipLeko(cid, leko.ver) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msg) doRemoveItem(item.uid, leko.itemqt) for i = 1, 175 do doSendDistanceShoot(leko.position, {x = leko.position.x + math.random(-7,7), y = leko.position.y + math.random(-5,5), z = leko.position.z}, math.random(leko.def,leko.atef)) end end if getPlayerVipLeko(cid) == leko.ver then --A doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msgfail) --A end --A return true end --Funções banco de dados by L3K0T function getPlayerVipLeko(cid) local Verh = db.getResult("SELECT `verificar` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "") if Verh:getID() ~= LUA_ERROR then local VerP= Verh:getDataInt("verificar") Verh:free() return VerP end return LUA_ERROR end function doPlayerAddVipLeko(cid, ver) local verih = getPlayerVipLeko(cid) + ver if verih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` + " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end function doPlayerRemoveVipLeko(cid, ver) local veriih = getPlayerVipLeko(cid) - ver if veriih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` - " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end para a msg ficar certinha vc deve converter o arquivo para como está na imagem abaixo e salvar.
  12. Falta de memoria, algum código na source comendo a memoria do servidor, se ele estiver em 32bits pode acontecer esses erros, também pode ser VPS LERDA, isso pode ser vários motivos, mais esse é o mais comuns, como @luanluciano93 disse.
  13. importa isso pro mysql vê se para o erro CREATE TABLE `death_list` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player_id` int(11) NOT NULL, `date` bigint(20) unsigned NOT NULL, `level` int(11) NOT NULL, `killer_name` varchar(255) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB;
  14. ALTER TABLE `accounts` ADD `verificar` INT NOT NULL DEFAULT 0 importa pro banco de dados
  15. function onUse(cid, item, fromPosition, itemEx, toPosition, position) --Script by L3K0T local leko = { itemqt = 1, --quantidade de item que vai ser usado vipganhos = 7, -- Quantidade de vip ganhos na conta. verificarvip = 0, -- verificação no banco de dados. msg = "Você ganhou 2 dias de vip.", --menssagem que o player recebe dentro do jogo. msgfail = "Falhou", --apenas pra testar o sistema, para desativar é só por -- do lado aonde marquei com A. ver = 1, position = getCreaturePosition(cid), def = 1, atef = 41, } if getPlayerVipLeko(cid) == leko.verificarvip then doPlayerAddPremiumDays(cid, leko.vipganhos) doPlayerAddVipLeko(cid, leko.ver) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msg) doRemoveItem(item.uid, leko.itemqt) doSendDistanceShoot(leko.position, {x = leko.position.x + math.random(-7, 7), y = leko.position.y + math.random(-5, 5), z = leko.position.z}, math.random(leko.def,leko.atef)) end if getPlayerVipLeko(cid) == leko.ver then --A doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msgfail) --A --doSendDistanceShoot(leko.position, {x = leko.position.x + math.random(-7, 7), y = leko.position.y + math.random(-5, 5), z = leko.position.z}, math.random(leko.def,leko.atef)) test end --A return true end --Funções banco de dados by L3K0T function getPlayerVipLeko(cid) local Verh = db.getResult("SELECT `verificar` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "") if Verh:getID() ~= LUA_ERROR then local VerP= Verh:getDataInt("verificar") Verh:free() return VerP end return LUA_ERROR end function doPlayerAddVipLeko(cid, ver) local verih = getPlayerVipLeko(cid) + ver if verih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` + " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end function doPlayerRemoveVipLeko(cid, ver) local veriih = getPlayerVipLeko(cid) - ver if veriih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` - " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end
  16. vipganhos = 7, -- Quantidade de vip ganhos na conta. function onUse(cid, item, fromPosition, itemEx, toPosition) --Script by L3K0T local leko = { itemqt = 1, --quantidade de item que vai ser usado vipganhos = 7, -- Quantidade de vip ganhos na conta. verificarvip = 0, -- verificação no banco de dados. msg = "Você ganhou 2 dias de vip.", --menssagem que o player recebe dentro do jogo. msgfail = "Falhou", --apenas pra testar o sistema, para desativar é só por -- do lado aonde marquei com A. ver = 1 } if getPlayerVipLeko(cid) == leko.verificarvip then doPlayerAddPremiumDays(cid, leko.vipganhos) doPlayerAddVipLeko(cid, leko.ver) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msg) doRemoveItem(item.uid, leko.itemqt) end if getPlayerVipLeko(cid) == leko.ver then --A doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msgfail) --A end --A return true end --Funções banco de dados by L3K0T function getPlayerVipLeko(cid) local Verh = db.getResult("SELECT `verificar` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "") if Verh:getID() ~= LUA_ERROR then local VerP= Verh:getDataInt("verificar") Verh:free() return VerP end return LUA_ERROR end function doPlayerAddVipLeko(cid, ver) local verih = getPlayerVipLeko(cid) + ver if verih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` + " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end function doPlayerRemoveVipLeko(cid, ver) local veriih = getPlayerVipLeko(cid) - ver if veriih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` - " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end
  17. o que vc quer fazer nele???
  18. @Mutilok ai está function onUse(cid, item, fromPosition, itemEx, toPosition) --Script by L3K0T local leko = { itemqt = 1, --quantidade de item que vai ser usado vipganhos = 2, -- Quantidade de vip ganhos na conta. verificarvip = 0, -- verificação no banco de dados. msg = "Você ganhou 2 dias de vip.", --menssagem que o player recebe dentro do jogo. msgfail = "Falhou", --apenas pra testar o sistema, para desativar é só por -- do lado aonde marquei com A. ver = 1 } if getPlayerVipLeko(cid) == leko.verificarvip then doPlayerAddPremiumDays(cid, leko.vipganhos) doPlayerAddVipLeko(cid, leko.ver) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msg) doRemoveItem(item.uid, leko.itemqt) end if getPlayerVipLeko(cid) == leko.ver then --A doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, leko.msgfail) --A end --A return true end --Funções banco de dados by L3K0T function getPlayerVipLeko(cid) local Verh = db.getResult("SELECT `verificar` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. "") if Verh:getID() ~= LUA_ERROR then local VerP= Verh:getDataInt("verificar") Verh:free() return VerP end return LUA_ERROR end function doPlayerAddVipLeko(cid, ver) local verih = getPlayerVipLeko(cid) + ver if verih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` + " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end function doPlayerRemoveVipLeko(cid, ver) local veriih = getPlayerVipLeko(cid) - ver if veriih >= 0 then db.query("UPDATE `accounts` SET `verificar` = `verificar` - " .. ver .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") return TRUE end return FALSE end tag com id do item de sua preferencia. <action itemid="ID DO ITEM" event="script" value="NOME DO LUA.lua"/>
  19. L3K0T postou uma resposta no tópico em Códigos C++
    sabia disso n, legal agradecemos pela contribuição
  20. isso
  21. L3K0Ttfs 0.4 Bom galera hoje vim trazer para aqueles que não tem em seu tfs a função DoSetCreatureLight, é uma função de LUZ, alguns tfs tem e outros não tem então resolvi compartilhar. abra seu luascript.cpp e procure por: lua_register(m_luaState, "getCreatureHealth", LuaInterface::luaGetCreatureHealth); em baixo add //doSetCreatureLight(cid, lightLevel, lightColor, time) lua_register(m_luaState, "doSetCreatureLight", LuaInterface::luaDoSetCreatureLight); Procure;; int32_t LuaInterface::luaGetThingFromPos(lua_State* L) { //getThingFromPos(pos[, displayError = true]) //Note: // stackpos = 255- top thing (movable item or creature) // stackpos = 254- magic field // stackpos = 253- top creature bool displayError = true; if(lua_gettop(L) > 1) displayError = popNumber(L); PositionEx pos; popPosition(L, pos); ScriptEnviroment* env = getEnv(); Thing* thing = NULL; if(Tile* tile = g_game.getMap()->getTile(pos)) { if(pos.stackpos == 255) { if(!(thing = tile->getTopCreature())) { Item* item = tile->getTopDownItem(); if(item && item->isMovable()) thing = item; } } else if(pos.stackpos == 254) thing = tile->getFieldItem(); else if(pos.stackpos == 253) thing = tile->getTopCreature(); else thing = tile->__getThing(pos.stackpos); if(thing) pushThing(L, thing, env->addThing(thing)); else pushThing(L, NULL, 0); return 1; } if(displayError) errorEx(getError(LUA_ERROR_TILE_NOT_FOUND)); pushThing(L, NULL, 0); return 1; } em baixo add;; int32_t LuaInterface::luaDoSetCreatureLight(lua_State* L) { //doSetCreatureLight(cid, lightLevel, lightColor, time) uint32_t time = popNumber(L); uint8_t color = (uint8_t)popNumber(L); uint8_t level = (uint8_t)popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); Creature* creature = env->getCreatureByUID(cid); if(creature) { Condition* condition = Condition::createCondition(CONDITIONID_COMBAT, CONDITION_LIGHT, time, level | (color << 8)); creature->addCondition(condition); lua_pushboolean(L, true); } else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } return 1; } Agora em Luascript.h procure por:;; static int32_t luaCanPlayerWearOutfit(lua_State* L); em baixo add;; static int32_t luaDoSetCreatureLight(lua_State *L); salva tudo em compila no modo rebuild. Usando em Summons;; doSetCreatureLight(getCreatureSummons(cid)[1], 10, 215, 60*1000) Usando em players;; doSetCreatureLight(cid, 9, 65, 10*60*1000) usando em Equipe;; function onEquip(cid, item, slot) doSetCreatureLight(cid, 9, 65, 10*60*1000) end function onDeEquip(cid, item, slot) doSetCreatureLight(cid, 7, 215, 1*1000) end Espero que gostem
  22. local function suck(cid, target) if isCreature(cid) then if isCreature(target) then local formula = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 10) doCreatureAddHealth(cid, formula) doCreatureAddHealth(target, -formula) doSendAnimatedText(getThingPos(cid), "+"..formula, COLOR_GREEN) doSendAnimatedText(getThingPos(target), "-"..formula, COLOR_RED) doSendMagicEffect(getThingPos(cid), 12) doSendMagicEffect(getThingPos(target), 45) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x+2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x-2,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y-2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) doSendDistanceShoot({x=getCreaturePosition(target).x,y=getCreaturePosition(target).y+2,z=getCreaturePosition(target).z}, getCreaturePosition(target), 10) return true end end return true end function onCastSpell(cid) local config = { arrounds = 3, -- Vezes que a magia vai atacar exaust = 5, -- tempo de exaust -> 1 = 1s level = 50, mana = 4500, -- Mana que vai gastar time = 1000, -- tempo para executar a magia novamente (arrounds) -> 1 = 1s t = getCreatureTarget(cid), --- Não mexa. } if config.t <= 0 then doPlayerSendCancel(cid, "You need a target.") return false end if getCreatureMana(cid) < config.mana then doPlayerSendCancel(cid, "You need "..config.mana.." of mana to cast this spell.") return false end if getPlayerLevel(cid) < config.level then doPlayerSendCancel(cid, "You need level "..config.level.." to cast this spell.") return false end if exhaustion.get(cid, 21511) then doPlayerSendCancel(cid, "You need wait "..exhaustion.get(cid, 21511).." seconds.") return false end exhaustion.set(cid, 21511, config.exaust) doCreatureAddMana(cid, - config.mana) doCreatureSay(cid, "BLOOD SUCK", TALKTYPE_MONSTER) for a = 1, config.arrounds do addEvent(suck, config.time * a, cid, config.t) end return false end ve se vc curte
  23. usa o comando a cada certa hora, n precisa esperar o server cair e nem abrir é tudo configurado.

Informação Importante

Confirmação de Termo