-
Total de itens
250 -
Registro em
-
Última visita
-
Dias Ganhos
14
Tudo que Kydrai postou
-
Existe uma função parecida, isInRange ou isInArea. function isInRange(pos, fromPos, toPos) return (pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z) end Acho que seria bom se criassem uma área para funções e sistemas.
-
Eu disse pra mudar: deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), por: deathListEnabled = TRUE,
-
Tenta colocar deathListEnabled = TRUE,.
-
Ao Acabar Premium Account, Voltar Á Townid = 2
tópico respondeu ao MUTAN0 de Kydrai em Lixeira Pública
http://www.xtibia.com/forum/topic/114671-creaturescript-premmy-check/ -
O primeiro: Pode não estar 100% e talvez tenha algumas coisas desnecessárias. actions/actions.xml <action actionid="1011" script="peso.lua"/> <action actionid="1010" script="peso.lua"/> actions/scripts/peso.lua lib/peso.lua globalevents/scripts/start.lua Caso exista, coloque: setPesoDescriptions() Se não: Anexei uma imagem pra ajudar. Configurando posições: PESO_POS = { ["Levantamento 01"] = { pos1 = {x=122, y=122, z=7}, -- player 1 pos2 = {x=122, y=120, z=7}, -- player 2 pos3 = {x=120, y=121, z=7, stackpos=1}, -- alavanca pos4 = {x=121, y=122, z=7, stackpos=1}, -- peso 1 pos5 = {x=121, y=120, z=7, stackpos=1} -- peso 2 }, ["Levantamento 02"] = { pos1 = {x=122, y=122, z=7}, -- player 1 pos2 = {x=122, y=120, z=7}, -- player 2 pos3 = {x=120, y=121, z=7, stackpos=1}, -- alavanca pos4 = {x=121, y=122, z=7, stackpos=1}, -- peso 1 pos5 = {x=121, y=120, z=7, stackpos=1} -- peso 2 }, } Prêmios: peso:reward(7369, 7371, 7370) -- recompensa(winner, looser, draw)
-
Da uma olhada neste tópico: http://www.xtibia.com/forum/topic/128042-resolvido/
-
Tenta assim: -- By Kydrai function onTimer() local wl = {x=1042, y=1020, z=7} local wall = getTileItemById(wl, 9780) local wltime = 1 * 60 doRemoveItem(wall.uid, 1) addEvent(doCreateItem, wltime * 1000, 9780, 1, wl) return TRUE end getTileItemById(wl, 9780) -> Pega o item na posição wl com id 9780.
-
Acho que não da pra mudar o uid, pelo menos eu n sei como. Não pode ser action id não? Ai seria algo como: doSetItemActionId(doCreateItem(9789, 1, wl), 1009)
-
No TFS 0.3.6 sei pode ser assim: doItemSetAttribute(doCreateItem(9789, 1, wl), "uid", 9780)
-
No TFS 0.3.6 funcionou. ------Roller Coaster System by Colex------- -- Lib RollerCoaster = {} function RollerCoaster:onChangeLevel(cid, fromZ, toZ) return TRUE end function RollerCoaster:onMove(cid, rail, railInfo, pos) return TRUE end function RollerCoaster:onChangeSpeed(cid, power) if power == 2 then doSendAnimatedText(getCreaturePosition(cid),"TROC TROC",210) else doSendAnimatedText(getCreaturePosition(cid),"TSSSIIIIII",210) end return TRUE end function RollerCoaster:onTypeChange(cid, fromType, toType) return TRUE end function RollerCoaster:onExitQuery(cid) return TRUE end function RollerCoaster:onExit(cid) return TRUE end function RollerCoaster:onEnterQuery(cid, cart) return TRUE end function RollerCoaster:onEnter(cid, cartID) return TRUE end -- End Lib local TRAINS = {7131, 7132} local all = {7121, 7122, 7123, 7124, 7125, 7126, 7133, 7134, 7135, 7136} local ACTION_TRAIN = {1001, 1002} local RAILS = { {id = all[1], dirs = {{dir = SOUTH, out = 2},{dir = NORTH, out = 2}}}, {id = all[2], dirs = {{dir = EAST, out = 1},{dir = WEST, out = 1}}}, {id = all[3], dirs = {{dir = EAST, out = 1},{dir = SOUTH, out = 2}}}, {id = all[4], dirs = {{dir = WEST, out = 1},{dir = SOUTH, out = 2}}}, {id = all[5], dirs = {{dir = EAST, out = 1},{dir = NORTH, out = 2}}}, {id = all[6], dirs = {{dir = WEST, out = 1},{dir = NORTH, out = 2}}}, {id = all[7], stop = 1}, {id = all[8], stop = 1}, {id = all[9], stop = 1}, {id = all[10], stop = 1}, } local SLOW = 500 local FAST = 200 local INCREASE = 50 local DECREASE = 50 local DOWN_INCREASE = 450 local UP_DECREASE = 155 local INFOS = {} TRUE = 1 FALSE = 0 function getRail(pos) local stack = 1 local found = 0 local rail repeat pos.stackpos = stack rail = getThingfromPos(pos) if rail.itemid == 0 then break end for i, r in ipairs(RAILS) do if (rail.itemid == r.id) then found = 1 break end end stack = stack + 1 until (found == 1) return rail end function moveTrain(cid) local params = INFOS[cid] local pos = getCreaturePosition(cid) local rail = getRail(pos) local dir = -1 local newid for i,r in ipairs(RAILS) do if rail.itemid == r.id then if RollerCoaster:onMove(cid, rail, r, pos) == FALSE then table.remove(INFOS, cid) return 1 end if r.stop ~= nil then if r.stop == 1 then RollerCoaster:onExitQuery(cid) addEvent(exitTrain, 2000, cid) return 1 end end local change = rail.actionid - 1000 local power = 0 local power = change doChangeType(cid, r.id, INFOS[cid].beforeid) info = r.dirs[iNFOS[cid].type] dir = info.dir if power == 1 or power == 2 then if RollerCoaster:onChangeSpeed(cid, power) then if power == 2 then INFOS[cid].speed = INFOS[cid].speed - INCREASE elseif power == 1 then INFOS[cid].speed = INFOS[cid].speed + DECREASE end end end if INFOS[cid].currZ ~= pos.z then if RollerCoaster:onChangeLevel(cid, INFOS[cid].currZ, pos.z) then if INFOS[cid].currZ > pos.z then INFOS[cid].speed = INFOS[cid].speed + UP_DECREASE elseif params.currZ < pos.z then params.speed = params.speed - DOWN_INCREASE end end end if params.speed < 1 then params.speed = 1 end params.currZ = pos.z newid = TRAINS[info.out] INFOS[cid].beforeid = r.id break end end if dir ~= -1 then doSetItemOutfit(cid, newid, -1) doMoveCreature(cid, dir) addEvent(moveTrain, params.speed, cid) else RollerCoaster:onExitQuery(cid) addEvent(exitTrain, 2000, cid) end end function exitTrain(cid) table.remove(INFOS, cid) RollerCoaster:onExit(cid) doSetItemOutfit(cid, TRAINS[1], 0) local pos = getCreaturePosition(cid) pos.y = pos.y - 1 doTeleportThing(cid, pos, 1) doCreatureSetNoMove(cid, 0) end function enterTrain(cid, item, type) if RollerCoaster:onEnter(cid, item) then doSetItemOutfit(cid, item, -1) local pos = getCreaturePosition(cid) table.insert(INFOS, cid, {type = type, speed = SLOW, currZ = pos.z}) addEvent(moveTrain, 1000, cid) end end function getSpeed(cid) if INFOS[cid].speed ~= nil then return INFOS[cid].speed end return FALSE end function setSpeed(cid, speed) if INFOS[cid].speed ~= nil then INFOS[cid].speed = speed return TRUE end return FALSE end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(ACTION_TRAIN, item.actionid) then if RollerCoaster:onEnterQuery(cid, item) then doTeleportThing(cid, toPosition, 1) doCreatureSetNoMove(cid, 1) addEvent(enterTrain, 500, cid, item.itemid, item.actionid-1000) end end return TRUE end ----"No Scripting Needed" System----- local change = {} change[all[1]] = {all[3], all[4]} change[all[2]] = {all[4], all[6]} change[all[3]] = {all[1], all[4], all[6]} change[all[4]] = {all[1], all[2], all[3], all[5], all[6]} change[all[5]] = {all[4]} change[all[6]] = {all[2], all[3], all[4]} change[all[7]] = {} change[all[8]] = {} change[all[9]] = {} change[all[10]] = {} function doChangeType(cid, id, beforeID) if table.getn(change[id]) > 0 then if isInArray(change[id],beforeID) then if INFOS[cid].type == 1 then INFOS[cid].type = 2 else INFOS[cid].type = 1 end end end end
-
Tem o jeito do apocarai que é por movements, aí vc precisa colocar para aprender a magia no spells.xml (needlearn="1"). movements.xml <movevent type="Equip" itemid="xxxx" slot="ring" event="script" value="script.lua"/> <movevent type="DeEquip" itemid="xxxx" slot="ring" event="script" value="script.lua"/> script.lua local magia = "Light Healing" -- nome da magia function onEquip(cid, item, slot) return doPlayerLearnInstantSpell(cid, magia) end function onDeEquip(cid, item, slot) if getPlayerLearnedInstantSpell(cid, magia) then doPlayerUnlearnInstantSpell(cid, magia) end return TRUE end
-
Olha um exemplo do exura, não sei se tem outra forma: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0.15, 0, 0.43, 0) function onCastSpell(cid, var) if getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == xxxx then return doCombat(cid, combat, var) end doPlayerSendCancel(cid, "Você precisa estar equipando o item ##### para usar esta magia.") return FALSE end Onde ta CONST_SLOT_RING pode ser: CONST_SLOT_FIRST = 1 CONST_SLOT_HEAD = CONST_SLOT_FIRST CONST_SLOT_NECKLACE = 2 CONST_SLOT_BACKPACK = 3 CONST_SLOT_ARMOR = 4 CONST_SLOT_RIGHT = 5 CONST_SLOT_LEFT = 6 CONST_SLOT_LEGS = 7 CONST_SLOT_FEET = 8 CONST_SLOT_RING = 9 CONST_SLOT_AMMO = 10 CONST_SLOT_LAST = CONST_SLOT_AMMO O xxxx deve ser trocado pelo id do item.
-
[Resolvido] Duvida No Storage Value/broadcast
tópico respondeu ao Ultra Lord de Kydrai em Lixeira Pública
O certo é doBroadcastMessage, minúsculo e maiúsculo fazem diferença. -
Da algum erro? Senão acho que tem que mudar a linha: <action itemid="8905;8906;8907;8908;8909" event="script" value="shield.lua"/> Para: <action fromid="8905" toid="8909" event="script" value="shield.lua"/> ou: <action itemid="8905-8909" event="script" value="shield.lua"/> ou ainda: <action itemid="8905" event="script" value="shield.lua"/> <action itemid="8906" event="script" value="shield.lua"/> <action itemid="8907" event="script" value="shield.lua"/> <action itemid="8908" event="script" value="shield.lua"/> <action itemid="8909" event="script" value="shield.lua"/> Ve tbm se os ids são esses msm.
-
actions.xml <action itemid="8905;8906;8907;8908;8909" event="script" value="shield.lua"/> actions/scripts/shield.lua -- By Kydrai function onUse(cid, item, fromPosition, itemEx, toPosition) local id = item.itemid < 8909 and item.itemid + 1 or item.itemid - 4 doTransformItem(item.uid, id) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você transformou o "..getItemNameById(item.itemid).." em "..getItemNameById(id)..".") return TRUE end 15:48 Você transformou o rainbow shield em fiery rainbow shield. 15:48 Você transformou o fiery rainbow shield em icy rainbow shield. 15:48 Você transformou o icy rainbow shield em sparking rainbow shield. 15:48 Você transformou o sparking rainbow shield em terran rainbow shield. 15:49 Você transformou o terran rainbow shield em rainbow shield. Ele vai mudando o shield, é isso mesmo?
-
actions.xml <action itemid="7529" event="script" value="tp.lua"/> actions/scripts/tp.lua -- By Kydrai function onUse(cid, item, fromPosition, itemEx, toPosition) local tp = { -- "from" é a posição inicial onde o player deve estar e "to" para onde o player será teleportado. {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, {from = {x=89, y=130, z=7}, to = {x=96, y=130, z=7}}, } local playerPos = getCreaturePosition(cid) for i, pos in pairs(tp) do if pos.from.x == playerPos.x and pos.from.y == playerPos.y and pos.from.z == playerPos.z then doTeleportThing(cid, pos.to) doSendMagicEffect(playerPos, CONST_ME_POFF) doSendMagicEffect(pos.to, CONST_ME_TELEPORT) return TRUE end end doSendMagicEffect(playerPos, CONST_ME_POFF) doPlayerSendCancel(cid, "Você não pode ser teleportado deste local.") return TRUE end Pra configurar faz assim: local tp = { -- "from" é a posição inicial onde o player deve estar e "to" para onde o player será teleportado. {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, {from = {x=89, y=130, z=7}, to = {x=96, y=130, z=7}}, {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, {from = {x=89, y=129, z=7}, to = {x=96, y=129, z=7}}, }
-
<?xml version="1.0" encoding="ISO-8859-1"?> <npc name="Nome" floorchange="0" walkinterval="4000"> <health now="150" max="150"/> <look type="133" head="20" body="120" legs="75" feet="13"/> <interaction range="3" idletime="30"> <interact keywords="hi" focus="1"> <keywords>hello</keywords> <response> <action name="script"> <![CDATA[ selfSay("Olá " .. getCreatureName(cid) .. ", eu vendo {stamina}.", cid) ]]> </action> </response> </interact> <interact keywords="bye" focus="0"> <keywords>farewell</keywords> <response text="Good bye."/> </interact> <interact keywords="stamina"> <response> <action name="script"> <![CDATA[ selfSay("Você quer comprar 60 minutos de stamina por 10000 gp's?", cid) ]]> </action> <interact keywords="yes"> <response> <action name="script"> <![CDATA[ local minutes = 60 local price = 10000 if doPlayerRemoveMoney(cid, price) then doPlayerAddStamina(cid, minutes) selfSay("Thanks.", cid) else selfSay("Você não possui "..price.." gp's.", cid) end ]]> </action> </response> </interact> <interact keywords="no"> <response> <action name="script"> <![CDATA[ selfSay("Ok.", cid) ]]> </action> </response> </interact> </response> </interact> </interaction> </npc>
-
Vc pode fazer que nem a mana rune. Só mudar o doPlayerAddMana(cid, quantidade) para doPlayerAddStamina(cid, minutes) Link da mana rune: http://www.xtibia.com/forum/topic/120239-fazendo-manarune/
-
Oq da pra fazer é usar essas funções: setItemAttack(uid, attack) setItemExtraAttack(uid, extraattack) setItemDefense(uid, defense) setItemArmor(uid, armor) setItemExtraDefense(uid, extradefense) setItemAttackSpeed(uid, attackspeed) setItemHitChance(uid, hitChance) setItemShootRange(uid, shootRange) Ficaria assim por exemplo: local functions = { ["attack"] = {s = setItemAttack, g = getItemAttack}, ["extraattack"] = {s = setItemExtraAttack, g = getItemExtraAttack}, ["defense"] = {s = setItemDefense, g = getItemDefense}, ["extradefense"] = {s = setItemExtraDefense, g = getItemDefense}, ["armor"] = {s = setItemArmor, g = getItemArmor}, ["attackspeed"] = {s = setItemAttackSpeed, g = getItemAttackSpeed}, ["hitchance"] = {s = setItemHitChance, g = getItemHitChance}, ["shootrange"] = {s = setItemShootRange, g = getItemShootRange}, } function onSay(cid, words, param) local opt = string.explode(param, ",") local item = getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid local f = opt[1] and opt[2] and functions[opt[1]:lower()] or FALSE if f then f.s(item, f.g(item) + opt[2]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, getItemName(item).." has been upgrated.") else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "A função "..opt[1].." não existe ou o parâmetro está incorreto.") end return TRUE end Skill só por movements.
-
No cliente do tibia só da pra modificar o nome das skills e não criar, ai vc precisaria de um editor hex. Se vc entende bem de programação poderia editar o YATC e o servidor para que tenha as novas skills. Haja vocação.
-
Acho que é getCreatureByName("name")
-
Não, nada vê cara. Como eu disse no outro tópico a função mudou. Se quiser continuar com a anterior vai data/lib/050-function.lua e coloca: function getItemAttack(uid) return getItemAttribute(uid, "attack") end
-
Eles foram modificados. No 0.3.5 era: getItemAttack(uid) Agora no 0.3.6 se não me engano é: getItemAttribute(uid, "attack") A mesma coisa acontece com todos os outros atributos dos items ("armor", "defense", ...).
-
Baseado no seu script fica algo +- assim: local porta = 9090 -- uid da porta local item2 = 5901 -- lixo local lvl = 90 -- level necessário para passar local dentro = {x=, y=, z=} local fora = {x=, y=, z=} function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == porta then doPlayerSendTextMessage(cid, 21, "Você terá que arrombar a porta!") else if getPlayerLevel(cid) >= lvl then doPlayerSendTextMessage(cid, 21, "Você conseguil arrombar a porta!") local pos = getCreaturePosition(cid) if pos.x == dentro.x and pos.y == dentro.y and pos.z == dentro.z then doTeleportThing(cid, fora) else doTeleportThing(cid, dentro) end doSendMagicEffect(toPosition, 2) else doPlayerSendCancel(cid, "Você nao tinha level suficiente, por isso quebrou sua Crownbar!") doTransformItem(item.uid, item2) doSendMagicEffect(toPosition, 3) end end return TRUE end <action uniqueid="9090" event="script" value="arrombamento.lua"/> <action itemid="2416" event="script" value="arrombamento.lua"/>
-
Não testei: creaturescripts/scripts/tp.lua function removeTp(tpId, tpPos) local tp = getThingfromPos(tpPos) if tp.itemid == tpId then doRemoveItem(tp.uid, 1) doSendMagicEffect(tpPos, CONST_ME_POFF) end end function onDeath(cid) local tpId = 1387 local tpPos = getCreaturePosition(cid) -- onde aparece o tp local tpToPos = {x=, y=, z=} -- destino local tpTime = 5 local tp = doCreateTeleport(tpId, tpToPos, tpPos) doCreatureSay(cid, "O teleport irá sumir em "..tpTime.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tpTime*1000, tpId, getThingPos(tp)) return TRUE end creaturescripts/creaturescripts.xml <event type="death" name="tp" event="script" value="tp.lua"/> Ai no arquivo xml do monster desejado coloca: <script> <event name="tp"/> </script>
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.