Ir para conteúdo

lucasjockey

Artesão
  • Total de itens

    101
  • Registro em

  • Última visita

Tudo que lucasjockey postou

  1. function onUse(cid, item,pos) if getPlayerStorageValue(cid,5600) == -1 then local sex = getPlayerSex(cid) if sex == 0 then doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) doPlayerAddOutfit(cid, 288, 3) setPlayerStorageValue(cid,5600,1) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a full Demonhunter outfit.") elseif sex == 1 then doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) doPlayerAddOutfit(cid, 289, 3) setPlayerStorageValue(cid,5600,1) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a full Demonhunter outfit.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.") end return TRUE end Edit~~ Arrumei um pequeno erro, o male outfit é 289 e não 288.
  2. Mas você quer o script ou a mensagem em laranja? doBroadcastMessage(cid, ""..hitKillerName.." Matou "..getPlayerName(cid)..".", TALKTYPE_ORANGE_1) Coloca o script na pasta Creaturescripts\scripts com o nome morteplayer.lua: local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } config.sqlType = config.sqlType == " mysql" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) if(config.deathListEnabled ~= TRUE) then return end local hitKillerName = "field item" local damageKillerName = "" if(lastHitKiller ~= FALSE) then if(isPlayer(lastHitKiller) == TRUE) then hitKillerName = getCreatureName(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end doBroadcastMessage(cid, ""..hitKillerName.." Matou "..getPlayerName(cid)..".", TALKTYPE_ORANGE_1) if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then if(isPlayer(mostDamageKiller) == TRUE) then damageKillerName = getPlayerGUID(mostDamageKiller) else damageKillerName = getCreatureName(mostDamageKiller) end end end db.executeQuery(" INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");") local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";") if(rows:getID() ~= -1) then local amount = rows:getRows(true) - config.maxDeathRecords if(amount > 0) then if(config.sqlType == DATABASE_ENGINE_SQLITE) then for i = 1, amount do db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);") end else db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";") end end end end No Creaturescripts.xml, coloca essa linha: <event type="death" name="PlayerDeath" script="morteplayer.lua"/>
  3. Na verdade acho que esse é para não deixar um jogador logar em dois personagens na mesma acc. @topic Esse script anti-mc bloqueia gente que joga em lan house ou quem tem roteador em casa e esta compartilhando o mesmo modem.
  4. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local attack = 15 local skill = getPlayerMagLevel(cid) local maxWeaponDamage = (skill * attack) / 20 + attack local damage = -((math.random(20, maxWeaponDamage) * attackStrength) / 100) * 0.8 return damage, damage end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onCastSpell(cid, var) local allowedobjects = {1614, 1615, 1616, 1619, 1650, 1651, 1652, 1653, 1658, 1659, 1660, 1661, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1714, 1715, 1716, 1717, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1770, 1774, 1775, 2034, 2080, 2081, 2082, 2083, 2084, 2085, 2094, 2095, 2098, 2101, 2105, 2106, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 6368, 6369, 6370, 6371} local spot = getPlayerPosition(cid) local nxp = spot.x - 2 local pxp = spot.x + 2 local nyp = spot.y - 2 local pyp = spot.y + 2 local target = getCreatureTarget(cid) for absice = nxp, pxp do for coordinate = nyp, pyp do local pos = {x = absice, y = coordinate, z = spot.z, stackpos = 255} local thing = getThingfromPos(pos) end end if thing.itemid > 0 then if isInArray(allowedobjects, thing.itemid) == TRUE then doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) doSendMagicEffect(spot, CONST_ME_FIREWORK_BLUE) doRemoveItem(thing.uid, 1) tgtpos = getCreaturePosition(target) doSendDistanceShoot(pos, tgtpos, CONST_ANI_SUDDENDEATH) doSendMagicEffect(tgtpos, CONST_ME_POFF) doCreateItem(2250, 1, tgtpos) return doCombat(cid, combat, var) else return 0 end else return 0 end return 0 end
  5. local sortepercent = math.percent(hpnow+(sorte*10), hpmax, "", TRUE) Você esqueceu de definir a variável sorte. doPlayerSendTextMessage(cid, 22, hppercent.. 'OMG') Esqueceu de definir a hppercent também.
  6. Não entendi muito bem, mas acho que está errado, OnUse são actions para executar funções quando o player da USE nelas, no seu caso a cadeira. Para arrumar coloca as funções no StepIn do movements.
  7. O problema é que você vai atualiza somente o executavel, e não os arquivos xml como o items.xml. Além disso, comparação binária pode trazer vários erros como caso um programador já tenha modificado o seu TFS com modificação binária antes do atualizador existir, assim o patcher vai reescrever as partes que foram gravadas nele por outro programador e poderá corromper o software. No tibia existe o patch porque ele não tem código fonte aberto e os únicos que modificam ele em modo binário são os bot's (pessoas que usam softwares para facilitar a jogabilidade) ou crackers.
  8. Pode ser problema nos movements, uma solução: Entre no jogo e veja o ID da Stone dando Look nela, sempre com o GM e/ou GOD. Se não mostrar a ID, veja o nome, vá na pasta Data\items, procure pelo nome e veja a ID. Com a ID, vá na pasta Data\movements e abra o arquivo movements.xml, localize o ID e pegue a linha de comando, ex.: Caso você não queira mais o problema, apenas retire essa linha e salve, mas isso vai retirar uma das funções dessa pedra. Caso não queira perder essa função pegue o valor da variavel VALUE, no meu caso "xxxx.lua". Esse valor é um script (arquivo .lua), vá na pasta scripts, abra o arquivo e poste ele aqui.
  9. Bom, isso só seria a lógica das condições, falta o "FOR", "CASE" (outro tipo de condição), "SWITCH" (outro tipo de condição)... Além disso, todas as linguagens são praticamente iguais em termos de lógica.
  10. lol, um noob, opa, um script kiddie já conseguiria hackear uma coisa dessas, pois é só olhar o código fonte. Porem funciona, se for pra fazer uma coisa bem simples isso já basta.
  11. doPlayerAddItem(uid, itemid, <optional> count/subtype) -- Da item. doPlayerSetVocation(cid,voc) -- Da vocação. doPlayerAddOutfit(cid,looktype,addons) -- Da outfit.
  12. function onSay(cid,words,param) local player = getCreaturePosition(cid) if getPlayerGuildName(getPlayerName(cid)) == "Nome da Guild" then if getTilePzInfo(player) == TRUE then doTeleportThing(cid,{x=528, y=917, z=7}) doPlayerSendTextMessage(cid,25,"Go COH") else doPlayerSendCancel(cid, "Voce precisa estar na protection zone.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "voce precisa estar na guild vencedora do COH") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end
  13. 1ª dúvida: Falto o começo da função: function onUse(cid, item, frompos, item2, topos) if item.uid == 9999 then queststatus = getPlayerStorageValue(cid,9999) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a Medalha VIP.") doPlayerAddItem(cid,5785,1) setPlayerStorageValue(cid,9999,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end else return 0 end return 1 end // 2ª dúvida: No mapa não existem as casas com as seguintes ID's: 1371, 1374 e 1375. Abra os arquivos X-house.xml e X-housestore.xml e retire as entradas que fazem referencia aos ID's. Ex.: <house name="vip35" houseid="1371" entryx="450" entryy="125" entryz="6" rent="0" townid="0" size="64"/> (X-house.xml) <house houseid="1371" owner="" paid="0" warnings="0"/> (X-housestore.xml)
  14. local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local tempo = 2 local musica = {"LALALA";"LULULU";} start = os.clock() step = 1 onThink = function () if step > 0 and os.clock() - start >= tempo then start = os.clock() if musica[step] == nil then step = 0 return 1 elseif musica[step] ~= 0 then selfSay(musica[step]) end if (step == table.getn(musica)) then step = 1 else step = step + 1 end end end Se não funcionar tente: local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local tempo = 2 local musica = {"LALALA";"LULULU";} start = os.clock() step = 1 onThink = function () if step > 0 and os.clock() - start >= tempo then start = os.clock() if musica[step] == nil then step = 0 return 1 elseif musica[step] ~= 0 then selfSay(musica[step]) end if (step == 2) then step = 1 else step = step + 1 end end end
  15. Caso queira um loop: local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local tempo = 2 local musica = {"LALALA";"LULULU";} start = os.clock() step = 1 onThink = function () if step > 0 and os.clock() - start >= tempo then start = os.clock() if musica[step] == nil then step = 0 return 1 elseif musica[step] ~= 0 then selfSay(musica[step]) end if step == table.getn(musica) + 1 then step = 1 else step = step + 1 end end end
  16. Faça o que o kydrai fez e delete a sintaxe que tem no final: broadcastMessage("" .. assassino .. " Matou " .. vitima .."!", MESSAGE_STATUS_CONSOLE_ORANGE)
  17. if isCreature(cid) = TRUE then return 0; end
  18. Preço da magia em vermelho.
  19. lucasjockey

    [resolvido]

    Só coloca um "return TRUE" que eu esqueci ali. ;D function onLogin(cid) local pvoc = getPlayerVocation(cid) if (getPlayerPremiumDays(cid) == 0) and (pvoc >= 5) and (pvoc <= 8) then doPlayerSetVocation(cid,pvoc - 4) end return TRUE end
  20. local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) function onGetFormulaValues1(cid, level, maglevel) min = (level * 2 + maglevel * 3) * 0.5 - 30 max = (level * 2 + maglevel * 3) * 0.6 if min < 25 then min = 25 end return min, max end setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues1") local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) function onGetFormulaValues2(cid, level, maglevel) min = (level * 2 + maglevel * 3) * 0.5 - 30 max = (level * 2 + maglevel * 3) * 0.6 if min < 25 then min = 25 end return min, max end setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2") arr1 = { {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) arr2 = { {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, } local area2 = createCombatArea(arr2) setCombatArea(combat1, area1) setCombatArea(combat2, area2) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 } addEvent(onCastSpell1, 100, parameters) addEvent(onCastSpell2, 200, parameters) end
  21. lucasjockey

    [resolvido]

    Tenta isso: Em Data\creaturescripts, adicione essa linha em creaturescripts.xml: <event type="login" name="PLAPV" script="plapv.lua"/> Crie um arquivo chamado plapv.lua na pasta scripts com o seguinte: function onLogin(cid) local pvoc = getPlayerVocation(cid) if (getPlayerPremiumDays(cid) == 0) and (pvoc >= 5) and (pvoc <= 8) then doPlayerSetVocation(cid,pvoc - 4) end end
  22. function onThink(interval, lastExecution) local cor = 22 local mensagens = {"Mensagem 1", "Mensagem 2", "Mensagem 3", "Mensagem 4"} doBroadcastMessage(mensagens[math.random(1,table.maxn(mensagens))], cor) return TRUE end Faltou tirar uma vírgula e um end (no seu tinha 2) ;D
  23. Só se existir uma maneira de pegar IP Local da outra pessoa, creio que não seja possível.
  24. lucasjockey

    [resolvido]

    Adicione isso em talkactions.xml: <talkaction words="!help" script="help.lua"/> Agora na pasta scripts, crie um arquivo chamado help.lua com o seguinte: Coloque os comandos e o que você quiser.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...