
Solutions
-
Rusherzin's post in Compactar script! was marked as the answerNa verdade o teu script original pega uma posição randômica entre as 3 da lista, por isso perguntei. Mas tu pode fazer assim:
local positions = { [999] = { {x = 1000, y = 1000, z = 7} }, [1000] = { {x = 1000, y = 999, z = 7} }, [1001] = { {x = 1001, y = 1001, z = 7} } } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) local pos = positions[item.actionid] if not pos then return true end doTeleportThing(cid, pos[math.random(1, #pos)]) return true end
-
Rusherzin's post in (Resolvido)[Modern ACC] PHP Verificar mais de uma value was marked as the answer@Brunds A ideia é a seguinte, pega o valor da storage do jogador uma vez só, fora do foreach. Para cada valor na lista, tu só checa se a storage é maior ou igual. Tenta assim:
if(count($characterPageQuests) != 0) { echo "<table class=\"bar\" width='100%'>"; echo "<tr><td width='90%'><b>Nome Das Graduações</b></td><td><b>Status</b></td></tr>"; $SQL = POT::getInstance()->getDBHandle(); $quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` =89745")->fetch(); foreach($characterPageQuests as $value) { $status = ($quest['value']) >= $value['value'] ? "true" : "false"; echo "<tr><td width='90%'>".$value['name']."</td><td><center><img src='../../../public/images/$status.gif'></center></td></tr>"; } echo "</table>"; } ?>
-
Rusherzin's post in (Resolvido)COMANDOS NAO FUNCIONAM was marked as the answerA tua conta tem que ter acesso para tu poder usar os comandos. Procura na tua database na tabela de accounts, bota o type 3 ou 5.
-
Rusherzin's post in (Resolvido)[Actions] Porta que só passa com Storage was marked as the answerSe estiver usando uma Quest Door, é só botar no uniqueid dela a storage que tu quiser.
-
Rusherzin's post in (Resolvido)[Dúvida]Npc Termina o Dialogo was marked as the answerÉ só usar o método unGreet do NpcHandler.
npcHandler:unGreet(cid)
-
Rusherzin's post in (Resolvido)getWorldTime() was marked as the answerAaaah, pensei que tu tivesse o tempo já em 4 dígitos. Faz o seguinte, cria uma função assim na lib:
function readableTime() local config = { tibianTime = true, twentyFour = true -- only if tibianTime = false } local str = "" if(config.tibianTime) then local var = (os.date('%M') * 60 + os.date('%S')) / 150 local hour = math.floor(var) local minute = math.floor(60 * (var - hour)) if(hour < 10) then hour = '0' .. hour end if(minute < 10) then minute = '0' .. minute end str = hour .. ':' .. minute elseif(config.twentyFour) then str = os.date('%H:%M') else str = os.date('%I:%M %p') end return str end No NPC tu bota:
selfSay('Agora são: ' ..readableTime()..'.',cid)
-
Rusherzin's post in (Resolvido)[AJUDA] Erro em samples no Gesior 0.3.8 was marked as the answer@exchange Então, olha no accountmanagement.php, na linha 936+.
$player->setLevel(8); $player->setMagLevel(4); $player->setHealth(150); $player->setHealthMax(150); $player->setMana(150); $player->setManaMax(150); Ele está colocando manualmente, se quiser tentar pegar do Sample, bota o seguinte:
Troca isso:
$player->setLevel(8); Por isso:
$player->setLevel($char_to_copy->getLevel()); Faça isso para todos os atributos que tu queira pegar do sample, só mudar o getLevel pela função equivalente.
-
Rusherzin's post in (Resolvido)Duvida Sobre Lua was marked as the answerHmmm, tenta mudar essa linha:
addEvent(regenerationOverTime, delay, cid, skill, magic) Por isso:
addEvent(regenerationOverTime, delay, cid.uid, skill, magic)
-
Rusherzin's post in (Resolvido)Hotkeys em portugues.. was marked as the answerYup, é na source. Game.cpp.
if(count == 1) sprintf(buffer, "Using the last %s...", it.name.c_str()); else sprintf(buffer, "Using one of %d %s...", count, it.pluralName.c_str());
-
Rusherzin's post in (Resolvido)Alterar os comando "Hi", "Trade"... was marked as the answerFica em data\npc\lib\npcsystem\. Só não tenho certeza se é no main.lua ou no npcsystem.lua, procura por FOCUS_GREETWORDS.
-
Rusherzin's post in (Resolvido)[SUPORTE] Most Powerful não funciona com GUILD was marked as the answerNão, ele procura por kills entre os jogadores que fazem parte da guild, se não tiver nenhum frag, vai retornar um conjunto vazio. Tenta pegar algum kill e depois checar o site de novo.
-
Rusherzin's post in (Resolvido)SPELL TARGET - IMPOSSIVEL? was marked as the answerAaaah, okay. Usa assim então:
local healed = var.number if(healed == cid) then doPlayerSendTextMessage(cid, 27, "Não pode usar em si mesmo.") return false end
-
Rusherzin's post in (Resolvido)Npc que teleporta diferente was marked as the answerOkay, fiz um script aqui, só lembra de colocar ali na tabela posToGo o nome da ilha com todas letras minúsculas, os jogadores podem falar com letras maiusculas ou minúsculas, mas ali no código tem que estar com letras minúsculas.
local posToBe = {x=893, y=830, z=7} local posToGo = {["konoha"] = {x=894, y=831, z=7}, ["ilha"] = {x=895, y=895, z=7}} function onSay(cid, words, param) local playerpos = getCreaturePosition(cid) if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then return end if(posToGo[string.lower(words)]) then doTeleportThing(cid, posToGo[string.lower(words)], true) end end No talkactions.xml tu bota uma tag assim:
<talkaction words="konoha;ilha" event="script" value="teleport.lua"/> Separa o nome das ilhas por ; .
-
Rusherzin's post in (Resolvido)addEvent em CastSpell was marked as the answerNão tenho certeza se entendi exatamente o que tu querias que eu fizesse, mas... tenta dessa forma:
local config = { mana = 0, seconds = 0, storage = 111313, semMana = "Você não tem mana suficiente.", msg = "Você precisa aguardar %d segundos para usar essa magia novamente.", } local area = createCombatArea(AREA_CIRCLE2X2) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(isCreature(target) == 0) then return true end if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()-config.seconds) end if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)))) return true end if getPlayerMana(cid) >= config.mana then doPlayerAddMana(cid, -config.mana) setPlayerStorageValue(cid, config.storage, os.time()) for x = 1, 40 do addEvent(furyAttackTarget,250*x+500,cid,target,{x = getCreaturePosition(target).x + math.random(-1,1), y = getCreaturePosition(target).y + math.random(-1,1), z = getCreaturePosition(target).z}) end else doPlayerSendCancel(cid, config.semMana) doSendMagicEffect(getPlayerPosition(cid),2) end return true end function furyAttackTarget(cid,target,pos) if isCreature(cid) == TRUE and isCreature(target) == TRUE then doSendDistanceShoot({x = getCreaturePosition(target).x - math.random(4,6), y = getCreaturePosition(target).y - 5, z = getCreaturePosition(target).z},pos,3) doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,-1,-200,36) doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,-1,-500,36) end end
-
Rusherzin's post in (Resolvido)Erro Movements was marked as the answerlocal pos = {x = 32581, y = 31487, z = 9} local stor = 23901 function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, stor) <=0 then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "You need access to pass on this teleport.") else doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) end return true end
-
Rusherzin's post in (Resolvido)Excluir bau addEvent 0.4 was marked as the answerAcho que entendi, seria assim:
function removeEmptyChest(pos, itemid) local item = getTileItemById(pos, itemid).uid if getItemWeightById(itemid) - getItemWeight(item) == 0 then return item ~= 0 and doRemoveItem(item, 1) end end function onUse(cid, item, frompos, item2, topos) local bau = item.uid local pos = getThingPos(bau) addEvent(removeEmptyChest, 10000, pos, item.itemid) end Se o cara abrir o baú e tirar o item antes desses 10s, o baú vai ser removido.
-
Rusherzin's post in (Resolvido)como verificar uma pos was marked as the answerTenta mudar aquela função isWalkable por essa aqui:
function isWalkable(pos) local tile = getThingfromPos(pos) if hasProperty(tile.uid, 0) == true or hasProperty(tile.uid, 3) == true then return false end return true end E depois troca essa parte:
if isWalkable(pos, true, false, true) then Por:
if isWalkable(pos) then
-
Rusherzin's post in (Resolvido)comando Change World was marked as the answerOkay, vou fazer aqui.
Edit:
talkactions/scripts/changeworld.lua
function onSay(cid, words, param) if param == "" then return true end local nparam = string.explode(param, ",") if (not nparam[1] or not nparam[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Param required.") return true end local ponline = false local worldid = tonumber(nparam[1]) local pname = tostring(nparam[2]) for _, k in ipairs(getPlayersOnline()) do if getCreatureName(k) == pname then playeronline = true end end local pid = getCreatureByName(pname) if playeronline then doRemoveCreature(pid) end addEvent(db.executeQuery, 500, "UPDATE `players` SET `world_id` = "..worldid.." WHERE `name` = '"..pname.."';") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O personagem ["..pname.."] foi transferido para o mundo "..worldid..".") end talkactions.xml
<talkaction words="/mundo" access="5" event="script" value="changeworld.lua"/> Exeplicação do comando:
/mundo x, y [Onde x é o número do mundo e y é o nome do jogador.
Exemplos:
-> /mundo 1, Rusherzin
-> /mundo 0, Hietffer
-
Rusherzin's post in (Resolvido)[NPC] Erro ao criar NPC was marked as the answerFaltava um end.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'castle') or msgcontains(msg, 'castelo')) then if os.date("%A") == "Saturday" then if (os.date("%X") >= "17:00:00") and (os.date("%X") <= "18:00:00") then pos = {x=849, y=995, z=7} doTeleportThing(cid,pos) talkState[cid] = 0 else selfSay('Desculpe, mas eu só posso teleporta-lo para o Castle aos Sabados entre as 17:00 e 18:00 horas.', cid) end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Rusherzin's post in (Resolvido)2 modificações em script was marked as the answerNão testei nenhum deles, mas..
function onUse(cid, item, frompos, item2, topos) local needPos = {x=1011, y=1025, z=7} -- pos que precisa está para usar o item local myPos = getPlayerPosition(cid) if myPos.x == needPos.x and myPos.y == needPos.y and myPos.z == needPos.z then if getHouseByPlayerGUID(getPlayerGUID(cid)) then doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid,22,"Voce foi teleportado até sua house!") else doPlayerSendTextMessage(cid,22,"Você ainda não tem uma house, compre uma falando '!buyhouse' em frente a porta dela.") end doPlayerSendTextMessage(cid,22,"Você precisa estár em cima do trono para usar a alavanca.") end return true end --[[Script By Vodkart]]-- function onSay(cid, words, param) local config = { pz = true, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = true, -- se os teleport irão custa (true or false) need_level = true, -- se os teleport irão precisar de level (true or false) premium = true -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["depot"] = { -- nome do lugar pos = {x=937, y=1002, z=7},level = 8,price = 10000}, ["templo"] = { -- nome do lugar pos = {x=969, y=1003, z=7},level = 8, price = 10000}, ["arena"] = { -- nome do lugar pos = {x=932, y=983, z=9},level = 8,price = 10000}, ["bau"] = { -- nome do lugar pos = {x=965, y=929, z=7},level = 8,price = 10000}, ["trainers"] = { -- nome do lugar pos = {x=977, y=1003, z=9},level = 8,price = 10000}, ["equip"] = { -- nome do lugar pos = {x=977, y=1003, z=8},level = 8,price = 10000}, ["hunts"] = { -- nome do lugar pos = {x=1000, y=929, z=7},level = 8,price = 10000}, ["cassino"] = { -- nome do lugar pos = {x=986, y=1003, z=7},level = 8,price = 10000}, ["exclusiva"] = { -- nome do lugar pos = {x=1226, y=926, z=7},level = 8,price = 10000}, ["marvel"] = { -- nome do lugar pos = {x=1120, y=921, z=7},level = 8,price = 10000}, ["donate"] = { -- nome do lugar pos = {x=1410, y=914, z=7},level = 8,price = 10000}, ["quests"] = { -- nome do lugar pos = {x=849, y=922, z=7},level = 8,price = 10000} } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] if not(a) then local txt = "" for v,k in pairs(lugar) do txt = (txt == "") and "Os lugares são: "..v..", " or txt..v..", " end doPlayerPopupFYI(cid, txt) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem se teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler para poder se teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 22, "Desculpe, você não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 22, "Desculpe, você nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE end
-
Rusherzin's post in (Resolvido)Background Bugado ! was marked as the answerTentei arrumar, testa com esse arquivo. (botei em anexo porque ele tem 900+ linhas e fica difícil de copiar)
layout.php
-
Rusherzin's post in (Resolvido)[HELP-ME] Criar conta nos sites gera senha errada was marked as the answerIsso é criptografia, serve para proteger as senhas. Se agora tu não usa mais Account Manager, aconselho que vá até o config.lua e coloque encryptionType de "plain" pra "sha1".
-
Rusherzin's post in (Resolvido)!Monster Info was marked as the answerÉ só usar o item no monstro que o código vai pegar todas as informações usando o nome do monstro.
-
Rusherzin's post in (Resolvido)Anel que não perde exp's was marked as the answerTenta assim. Dá para usar o math.random numa boa sim.
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true then if (getPlayerSlotItem(cid, 9).itemid == 11387) then if (math.random(1, 100) >= 51) then pos = getCreaturePos(cid) doCreatureSetDropLoot(cid, false) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) doSendMagicEffect(pos, 49) end end end return true end
-
Rusherzin's post in (Resolvido)Query/Tabela para sqlite z_ots_guildcomunication was marked as the answerCREATE TABLE "z_ots_guildcomunication" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" VARCHAR(255) NOT NULL, "type" VARCHAR(255) NOT NULL, "action" VARCHAR(255) NOT NULL, "param1" VARCHAR(255) NOT NULL, "param2" VARCHAR(255) NOT NULL, "param3" VARCHAR(255) NOT NULL, "param4" VARCHAR(255) NOT NULL, "param5" VARCHAR(255) NOT NULL, "param6" VARCHAR(255) NOT NULL, "param7" VARCHAR(255) NOT NULL, "delete_it" INTEGER(2) NOT NULL DEFAULT '1' )