-
Total de itens
1347 -
Registro em
-
Última visita
-
Dias Ganhos
36
Tudo que Oneshot postou
-
Copia denovo, e veja se foi consertado.
-
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
-
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.
-
pedido Item Que Troca Por Outros Items Randoms
pergunta respondeu ao GodalonexD de Oneshot em Scripts
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 -
Tem certeza que você colocou as vocations novas no weapons.xml? É ele que controla o funcionamento das wands.
-
pedido Item Que Troca Por Outros Items Randoms
pergunta respondeu ao GodalonexD de Oneshot em Scripts
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. -
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
-
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
-
Também não, proteção, reflexão, skills, magic level, não podem ser editados por scripts.
-
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.
-
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.
-
SISTEMA E TÓPICO ATUALIZADO Abraços
-
npc Npc Que Edita Skills Um De Cada Vez
tópico respondeu ao notle2012 de Oneshot em NPCs, monsters e raids
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. -
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.
-
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
-
Olá, JustinnoTibianno Tente trocar KewwordHandler por KeywordHandler. Abraços.
-
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?
-
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.
-
npc Npc Que Usa Outro Item Como Dinheiro
tópico respondeu ao MatheusGlad de Oneshot em NPCs, monsters e raids
Boa, garoto! Gostei bastante, sistema bem completo e com modificações no código-fonte que o deixam único. Parabéns. \o/ REP+ -
Pois é, você teria que trocar seu executável por um compilado com esse parâmetro ou então compilar você mesmo. Abraço.
-
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.
-
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.
-
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__
-
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
-
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.