Ir para conteúdo

Oneshot

Marquês
  • Total de itens

    1347
  • Registro em

  • Última visita

  • Dias Ganhos

    36

Tudo que Oneshot postou

  1. Copia denovo, e veja se foi consertado.
  2. local config = { affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for? killStorageValue = 3943, deathStorageValue = 3944, -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME killMessage = { use = true, text = "You owned |TARGETNAME|!", messageClass = MESSAGE_STATUS_CONSOLE_RED }, broadcastMessage = { use = true, minLevel = false, -- false if you don't want any level req minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed). text = "|KILLERNAME| [|KILLERLEVEL|] matou |TARGETNAME| [|TARGETLEVEL|]", messageClass = MESSAGE_STATUS_CONSOLE_BLUE }, killerAnimation = { use = true, text = "Frag!", -- Only 9 letters! No "commands" here. color = 144 }, targetAnimation = { use = true, text = "Owned!", -- Only 9 letters! No "commands" here. color = 180 } } function onDeath(cid, corpse, deathList) for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do local killer = deathList[i] if(isPlayer(killer) == TRUE) then local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1 local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1 local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1 local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1 setPlayerStorageValue(killer, config.killStorageValue, targetKills) setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths) local killerLevel = getPlayerLevel(killer) local targetLevel = getPlayerLevel(cid) local levelDiff = targetLevel - killerLevel local values = { ["KILLERKILLS"] = killerKills, ["KILLERDEATHS"] = killerDeaths, ["KILLERNAME"] = getCreatureName(killer), ["KILLERLEVEL"] = killerLevel, ["TARGETKILLS"] = targetKills, ["TARGETDEATHS"] = targetDeaths, ["TARGETNAME"] = getCreatureName(cid), ["TARGETLEVEL"] = targetLevel } function formateString(str) return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end))) end doPlayerAddMoney(killer, 500000) if(config.killMessage.use) then doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text)) end if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass) end if(config.killerAnimation.use) then doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color) end if(config.targetAnimation.use) then doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color) end end end return true end
  3. Que pena, amigo, estranho que tenho testado os scripts que posto nos tópicos da seção e todos funcionam. Bom, espero que alguém mais capacitado, possa te ajudar. Abraços.
  4. Sim, claro. local rewards = {{2160, 10}, {2157, 3}, 2470} local experience = 10000 function onUse(cid, item, fromPosition, itemEx, toPosition) local tmp, reward = rewards[math.random(1, #rewards)] reward = doCreateItemEx((type(tmp) == "number" and tmp or tmp[1]), (type(tmp) == "number" and 1 or tmp[2])) doPlayerAddItemEx(cid, reward) doPlayerAddExperience(cid, experience) doRemoveItem(item.uid, 1) doCreatureSay(cid, "Ganhei ".. ((type(tmp) == "number" and 1 or tmp[2])) .." ".. getItemNameById((type(tmp) == "number" and tmp or tmp[1])) .."!", TALKTYPE_ORANGE_1) return true end Sinta-se livre também para usar seu próprio script consertado: function onUse(cid, item) local random = math.random(1, 3) local position = {x=100, y=40, z=7} -- Pos local items = { [1] = {id=2160,quant=10,word="ganhei 100k "}, [2] = {id=2379,quant=1,word="ganhei uma dagier nb"}, [3] = {id=2392,quant=1,word="espada fogaréu créu"} } doPlayerAddItem(cid, items[random].id, items[random].quant) doPlayerAddExp(cid, 15000)-- Exp qe ira ganhar doTeleportThing(cid, position) doCreatureSay(cid, items[random].word, TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) end
  5. Oneshot

    Vocation

    Tem certeza que você colocou as vocations novas no weapons.xml? É ele que controla o funcionamento das wands.
  6. Tente desse jeito: local rewards = {{2160, 10}, {2157, 3}, 2470} local experience = 10000 function onUse(cid, item, fromPosition, itemEx, toPosition) local tmp, reward = rewards[math.random(1, #rewards)] reward = doCreateItemEx((type(tmp) == "number" and tmp or tmp[1]), (type(tmp) == "number" and 1 or tmp[2])) doPlayerAddItemEx(cid, reward) doPlayerAddExperience(cid, experience) doRemoveItem(item.uid, 1) return true end Aí você configura os itens e a quantidade que você quer nessa linha: local rewards = {{2160, 10}, {2157, 3}, 2470} Por exemplo, aí dá aleatoriamente 10 crystal coin, 3 gold nuggets ou 1 golden legs. Só seguir o modelo.
  7. Não, não está incompleto. Existem funções nativas compiladas em servidores que permitem que você edite o outfits.xml com atributos a seu gosto, sem precisar de creaturescripts, dentre outros. Para mais informações, recomendo a leitura deste tutorial: Outfits
  8. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(cid, var) local position = variantToPosition(var) if getTilePzInfo(position) then return false end return doCombat(cid, combat, var) end
  9. Também não, proteção, reflexão, skills, magic level, não podem ser editados por scripts.
  10. local stones = { [8299] = 1, [8302] = 4, [8301] = 7, [8303] = 8, [8310] = 12, } function onUse(cid, item, fromPosition, itemEx, toPosition) if not stones[item.itemid] then return false end if getItemInfo(itemEx.itemid).wieldPosition ~= stones[item.itemid] then doPlayerSendCancel(cid, "You cannot use this stone in this item.") doSendMagicEffect(toPosition, CONST_ME_POFF) return true end if stones[item.itemid] == 12 then doItemSetAttribute(itemEx.uid, "defense", (getItemAttribute(itemEx.uid, "defense") or getItemInfo(itemEx.itemid).defense) + 50) else doItemSetAttribute(itemEx.uid, "armor", (getItemAttribute(itemEx.uid, "armor") or getItemInfo(itemEx.itemid).armor) + 50) end doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) doRemoveItem(item.uid, 1) return true end <action itemid="8299;8301-8303;8310" event="script" value="nome_do_arquivo.lua"/> Cinco scripts em um. E, infelizmente, seu sexto script é inviável, pois não há como editar magic level e skills em itens por funções. Abraços.
  11. Oneshot

    Bug Char

    Isso ocorre devido a um sistema de reputação nativo de Baiaks que foi mal programado, você pode optar por remover ele do creaturescripts.xml e login.lua, ou então postar os creaturescripts dele aqui no tópico para que eu possa dar uma olhada.
  12. SISTEMA E TÓPICO ATUALIZADO Abraços
  13. Além de ser um NPC restrito aos servidores high-rate, acho que o script pode ser melhorado, trocando os vários if depois do primeiro por elseif, ou, melhor ainda, chamar uma tabela no script com a AI do NPC conforme a palavra-chave dita pelo jogador. Enfim, obrigado pela colaboração.
  14. function onDeath(cid, corpse, deathlist) if(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 10218 and getCreatureSkullType(cid) > 3) then doCreatureSetStorage(cid, 111011, getCreatureStorage(cid, 111011) - 1) if getCreatureStorage(cid, 111011) == 0 then doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, 1) elseif getCreatureStorage(cid, 111011) < 0 then doCreatureSetStorage(cid, 111011, 999) end doCreatureSetDropLoot(cid, false) end return true end Abraços.
  15. Oneshot

    Adaptar Spell

    local conditions = { [CONDITION_ATTRIBUTES] = { [CONDITION_PARAM_TICKS] = -1, [CONDITION_PARAM_STAT_MAGICLEVEL] = 6, [CONDITION_PARAM_SKILL_MELEE] = 6, [CONDITION_PARAM_SKILL_DISTANCE] = 0, [CONDITION_PARAM_SKILL_SHIELD] = 6, [CONDITION_PARAM_BUFF] = true, [CONDITION_PARAM_SUBID] = 500 }, [CONDITION_HASTE] = { [CONDITION_PARAM_TICKS] = -1, [CONDITION_PARAM_SPEED] = 250, [CONDITION_PARAM_SUBID] = 500 }, [CONDITION_REGENERATION] = { [CONDITION_PARAM_TICKS] = -1, [CONDITION_PARAM_HEALTHGAIN] = 50, [CONDITION_PARAM_HEALTHTICKS] = 50, [CONDITION_PARAM_SUBID] = 500 }, [CONDITION_OUTFIT] = { [CONDITION_PARAM_TICKS] = -1, [addOutfitCondition] = {lookType = 8}, [CONDITION_PARAM_SUBID] = 500 } } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_YELLOW_RINGS) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) for condition, parameters in pairs(conditions) do local condition = createConditionObject(condition) for parameter, value in pairs(parameters) do if parameter == addOutfitCondition then addOutfitCondition(condition, value) else setConditionParam(condition, parameter, value) end end setCombatCondition(combat, condition) end local function transform(cid) if getCreatureMana(cid) < 101 then for condition, _ in pairs(conditions) do doRemoveCondition(cid, condition, 500) end doSendMagicEffect(getThingPosition(cid), CONST_ME_YELLOW_RINGS) else doCreatureAddMana(cid, -5) addEvent(transform, 1 * 1000, cid) end end function onCastSpell(cid, var) doCombat(cid, combat, var) addEvent(transform, 1 * 1000, cid) return true end
  16. Olá, JustinnoTibianno Tente trocar KewwordHandler por KeywordHandler. Abraços.
  17. Oneshot

    Pedido Action

    Rapaz, estou vendo que você faz isso em todos os tópicos, inclusive os quais tem os pedidos muito bem explicados. Se você não pode ajudar o dono do tópico de alguma forma, então peço que pare com esses posts. Reportado. Vejamos... Você quer uma área que a cada vez que a alavanca é puxada os spawns lá dentro são trocados por novos? Por exemplo, uma área quadrada com Demons, puxo a alavanca e os Demons somem e aparecem Dragons?
  18. Sim, é possível. Vou pegar como exemplo a magia Berserk, veja abaixo: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, element, factor) local levelTotal, formula = level / 5, 0.0496 local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal)) return normal/2, normal, -math.random(elemental/2, elemental) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Basta fazer mais ou menos isso: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, element, factor) local levelTotal, formula = level / 5, 0.0496 local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal)) return normal/2, normal, -math.random(elemental/2, elemental) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) if getPlayerLevel(cid) < 100 then return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "You cannot use this spell anymore.") return false end end Um grande abraço.
  19. Boa, garoto! Gostei bastante, sistema bem completo e com modificações no código-fonte que o deixam único. Parabéns. \o/ REP+
  20. Pois é, você teria que trocar seu executável por um compilado com esse parâmetro ou então compilar você mesmo. Abraço.
  21. O break é uma palavra-chave que para um loop, no caso, o loop causado pelo for ali no script. Eu usei o for junto com ipairs para percorrer a tabela deathlist retornada pelo creaturescript e quando ele achar um jogador na tabela, eu comando a interrupção da procura por jogadores através do break. Simples assim. Abraço.
  22. Simulação de IPs? Nunca ouvi falar desse método e acho que ele não vai funcionar não, porque você tem que liberar as portas de login e game server (7171 e 7172) no seu roteador.
  23. Essas são funções que só são compiladas com o servidor, quando você declara o uso do War System no código-fonte (sources) com o parâmetro -D__WAR_SYSTEM__
  24. Por exemplo, function onPrepareDeath(cid, deathList) for _, killer in ipairs(deathList) do if isMonster(killer) then doCreatureSetDropLoot(cid, false) break end end return true end
  25. Sim, claro que dará. Ele checa todos os tipos de moeda.
  • Quem Está Navegando   0 membros estão online

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