-
Total de itens
101 -
Registro em
-
Última visita
Tudo que lucasjockey postou
-
getPlayerLookDir(cid) NORTH = 0 EAST = 1 SOUTH = 2 WEST = 3 Norte = 0 Leste = 1 Sul = 2 Oeste = 4 Eu acho =X, não sei inglês... function onStepIn(cid, item, position, fromPosition) playerdir = getPlayerLookDir(cid) fromPosition.z = fromPosition.z + 1 if playerdir = 2 then fromPosition.y = fromPosition.y + 1 elseif playerdir = 4 then fromPosition.x = fromPosition.x + 1 elseif playerdir = 0 then fromPosition.y = fromPosition.y - 1 elseif playerdir = 1 then fromPosition.x = fromPosition.x - 1 end parameters = {cid = cid, fromPosition = fromPosition} addEvent(talk, 2000, parameters) end function talk(parameters) doTeleportThing(parameters.fromPosition) end Ve se funfa... ;D
-
Primeiro veja se a posição da escada abaixo está na mesma posição X e Y do buraco. Caso esteja, olhe o que você tem: fromPosition.z = fromPosition.z + 1 Mas não tem outra função de mudar o X ou Y. Então, tente isso: fromPosition.x = fromPosition.x + 1 fromPosition.y = fromPosition.y + 1 Não sei se vai funcionar =/
-
Também não sei, mas para tirar 8% da vida de alguém é só fazer isso: life = getPlayerHealth(uid) doPlayerAddHealth(cid,0 - (life * 0.08)) simples ;D
-
Faça um script para o NPC na pasta data\npc\, mas se quiser fazer na action (data\actions\) tente essa função: doSendAnimatedText(position,text,color) -- Show animated text at a position (any text or color) No color você coloca TALKTYPE_ORANGE_1, position a posição do NPC e no text o texto. ;D
-
[Arquivado]Game Design, Porque é Ignorado?
tópico respondeu ao Necrus de lucasjockey em Noticias - Arquivo
Gostei, nunca tinha ouvido falar de Game Design. Como você, também não gosto de quests com as falas de internalta, não da pra entender nada... O pior é que muitos OT's tem isso e ainda tem bug no meio... Essa seria uma idéia sua, eu já não gostaria, pois o player tem que saber fugir as vezes e isso faz parte do RPG, a não ser que caia uma chave de algum mostro, dai faria sentido. Concordo, o Servfull devia fazer um pouco disso, eles tem várias falhas nos OT's e nunca arrumam, já vi pedassos de caverna no meio do deserto, lago, entre outras coisas. Mas é claro que não é só o deles, tem muitos outros que tem problemas, eu vo sempre arrumando esses erros, dai chega a versão 8.31... 8.4 e o meu começa a ficar melhor do que os deles. -
Esta muito bom a explicação, da para ver que você entende bastante. Vo postar minhas opiniões: A grande maioria blefa. Caso só falemos com textos (palavras, sem emoticons ou transferencia de arquivos) não teremos nossos IP's descobertos, pois o MSN manda as informações para uma central nos EUA e remanda para o remetente. Agora se você mandar algum arquivo ou emoticom personalizado, que os dados são grandes, a transferencia é direta, pois se ele enviasse pro EUA e reenviase para o remetente demoraria mais do dobro do tempo que você leva para transferir arquivos pelo MSN, então o IP é "mostrado". Pode ser uma vulnerabilidade, mas difícilmente pode ocorrer, e 99,99% das vezes só acontece com sistemas operacionais e/ou programas desatualizados. Então caro leitor se você, caro leitor, estiver com aquele Windows piratão desatualizado, programas de comunicação com a internet raramente utilizados e desatualizados, aquele browser 6.0 antigão de 2000 sendo que já existe um novo atualizado 8.0 de 2009 e você não quer trocar porque gosta mais do visual do outro, é... você esta com um problemão.
-
No script da SUPER SD tem uma linha com esse comando: addDamageCondition Os argumentos dele são esses: condition, rounds, time, value Ou seja: addDamageCondition(condition, rounds, time, value) Almente somente o value (valor, ultimo argumento) para um número menor, que vai tirar mais do player. Ex.: Original: addDamageCondition(condition, 5, 2000, -25) Modificado: addDamageCondition(condition, 5, 2000, -200) O modificado vai tirar mais do que o original. Script vai ficar assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) function onCastSpell(cid, var) local condition = createConditionObject(CONDITION_CURSED) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, 5, 2000, -100) setCombatCondition(combat, condition) return doCombat(cid, combat, var) end function onCastSpell(cid, var) return doCombat(cid, combat, var) end ~~~~~~~~~~~~~~~~~~~~~~ Agora no script da SUPER UH... Há um erro, ele não tem o END no final! Nele tem uma função que retorna o mínimo e o máximo de recuperação: function onGetFormulaValues(cid, level, maglevel) min = (level * 2 + maglevel * 3) * 2.3 - 25 max = (level * 2 + maglevel * 3) * 2.6 if min < 1500 then min = 1500 end return min, max end min é mínimo de recuperação. max é máximo de recuperação. No mínimo, ele pega o level, multiplica por 2, soma com o ml multiplicado por 3, pega o valor, multiplica por 2,3 e diminue 25, dando o valor do mínimo. A mesma coisa acontece com o máximo, mas com uma outra fórmula. A partir desses valores do min e max, ele vai pegar um número randômico entre eles. Vou modificar ele um pouco para você: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.3, -30, 1.7, 0) function onGetFormulaValues(cid, level, maglevel) min = (level * 2.1 + maglevel * 3.1) * 2.5 - 25 max = (level * 2.1 + maglevel * 3.1) * 3 if min < 1500 then min = 1500 end return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Lembre-se de colocar o END no final (obs: eu já coloquei no de cima). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;D
-
Não precisa adicionar no map editor, a não ser que você queira que o player pegue a potion de algum lugar do mapa. Aqui vai meu script que você deve colocar na pasta data\actions\scripts com o nome potions.lua: local ultimateHealthPot = 8377 local greatHealthPot = 7591 local greatManaPot = 7590 local greatSpiritPot = 8376 local strongHealthPot = 7588 local strongManaPot = 7589 local healthPot = 7618 local manaPot = 7620 local smallHealthPot = 8610 local antidotePot = 8378 local greatEmptyPot = 7635 local strongEmptyPot = 7634 local emptyPot = 7636 local antidote = createCombatObject() setCombatParam(antidote, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(antidote, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(antidote, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE) setCombatParam(antidote, COMBAT_PARAM_AGGRESSIVE, FALSE) setCombatParam(antidote, COMBAT_PARAM_DISPEL, CONDITION_POISON) local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL) setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions')) function onUse(cid, item, fromPosition, itemEx, toPosition) if(itemEx.uid ~= cid or itemEx.itemid ~= 1) then return TRUE end if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if(item.itemid == antidotePot) then if(doCombat(cid, antidote, numberToVariant(cid)) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, emptyPot) elseif(item.itemid == smallHealthPot) then if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 50, 100, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, emptyPot) elseif(item.itemid == healthPot) then if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 100, 200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, emptyPot) elseif(item.itemid == manaPot) then if(doTargetCombatMana(0, cid, 70, 130, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, emptyPot) elseif(item.itemid == strongHealthPot) then if(not(isKnight(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by paladins and knights of level 50 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, strongEmptyPot) elseif(item.itemid == strongManaPot) then if(not(isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, strongEmptyPot) elseif(item.itemid == greatSpiritPot) then if(not(isPaladin(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by paladins of level 80 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR or doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, greatEmptyPot) elseif(item.itemid == greatHealthPot) then if(not(isKnight(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by knights of level 80 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 700, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, greatEmptyPot) elseif(item.itemid == greatManaPot) then if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doRemoveCondition(cid, CONDITION_PARALYZE) doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, greatEmptyPot) elseif(item.itemid == ultimateHealthPot) then if(not(isKnight(cid)) or (getPlayerLevel(cid) < 130)) and not(getPlayerGroupId(cid) >= 2) then doCreatureSay(cid, "This potion can only be consumed by knights of level 130 or higher.", TALKTYPE_ORANGE_1) return TRUE end if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 800, 1000, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then return FALSE end doAddCondition(cid, exhaust) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doTransformItem(item.uid, greatEmptyPot) end return TRUE end Agora volte uma pasta, data\actions, e abra o arquivo actions.xml, adicione essas linhas: <action itemid="7588" script="potions.lua"/> <action itemid="7589" script="potions.lua"/> <action itemid="7590" script="potions.lua"/> <action itemid="7591" script="potions.lua"/> <action itemid="7618" script="potions.lua"/> <action itemid="7620" script="potions.lua"/> <action itemid="8472" script="potions.lua"/> <action itemid="8473" script="potions.lua"/> <action itemid="8474" script="potions.lua"/> <action itemid="8704" script="potions.lua"/> ;D
-
Seu OT provavelmente tem algumas partes SQL, por isso você não esta encontrando as 2 pastas. http://www.xtibia.com/forum/Criando-Seu-Se...en-t103345.html ;D
-
Lua é script VB é objeto Como você vai diferenciar os 2? @topic Muito interessante a história.
-
Passa o script da sua Super SD e Super UH na pasta spells. Posso almentar o poder dela para você e te explicar.
-
LUA é muito parecido com VB. Simples, vá no script da UH, vai ter uma sintaxes parecidas com essas: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.3, -30, 1.7, 0) function onGetFormulaValues(cid, level, maglevel) min = (level * 2 + maglevel * 3) * 2.3 - 25 max = (level * 2 + maglevel * 3) * 2.6 if min < 250 then min = 250 end return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Adicione algumas funções, por exemplo: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.3, -30, 1.7, 0) function onGetFormulaValues(cid, level, maglevel) local vocation = getPlayerVocation(cid) min = (level * 2 + maglevel * 3) * 2.3 - 25 max = (level * 2 + maglevel * 3) * 2.6 if vocation = 1 then if min < 250 then min = 250 end else if min < 200 then min = 200 end end return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end ;D
-
Estatua Ou Teleport Para Virar Cidadão Da City.
tópico respondeu ao MUTAN0 de lucasjockey em Lixeira Pública
Se quiser você também pode utilizar essa função: (Troca o temple to player). ;D -
[dúvida] Existe Uma Função De "esperar"?
tópico respondeu ao Felp321 de lucasjockey em Lixeira Pública
@Eventide Sleep() é uma API, não queremos isso em um script, imagine um script usando funções do Kernel?? -
[dúvida] Existe Uma Função De "esperar"?
tópico respondeu ao Felp321 de lucasjockey em Lixeira Pública
Os parametros são as variaveis da função. Faça assim: local function faznada(params) -- Não faz nada :) end function onUse(cid, item, frompos, item2, topos) local pPos = {x=topos.x, y=topos.y, z=topos.z} local params = {pos=pPos} -- Params é a posição do player. addEvent(faznada, 1 * 1000, params) -- 1 segundo addEvent(faznada, 10 * 1000, params) -- 10 segundos addEvent(faznada, 60 * 1000, params) -- 1 min addEvent(faznada, 60 * 1000 * 60, params) -- 1 hora addEvent(faznada, 60 * 1000 * 60 * 12, params) -- 12 horas end Na função FAZNADA é só usar os parametros em algumas sintaxes, crie você ou se você já tiver aplique. ;D -
[dúvida] Existe Uma Função De "esperar"?
tópico respondeu ao Felp321 de lucasjockey em Lixeira Pública
Eu não sei muito bem, mas é assim: Você faz determinada função, ex.: local function faznada(params) -- Não faz nada :) end Depois você coloca assim no mesmo script, fora da função... addEvent(faznada, 10000, params) -- Executa função em 10 segundos O script (action) inteiro ficaria assim: local function faznada(params) -- Não faz nada :) end function onUse(cid, item, frompos, item2, topos) addEvent(faznada, 10000, params) end -
Cara, ta horrível esse script, ta tudo errado... if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Heloo' .. creatureGetName(cid) .. '! I can take you to the Mer Jungle (200 gps) the Samaransa Desert (150gps) House City (1000gps) Lost City (500gps) Isengard (1000gps).') focus = cid talk_start = os.clock() else selfSay('Sorry, only premium players can travel by boat.') focus = 0 talk_start = 0 end A função acima, por exemplo, verifica a mensagem HI do player e se ele estiver a uma distancia maior de 4 sqm do NPC, o mesmo falará: "Sorry, only premium players can travel by boat.". Mas arrumando seu script: local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if isPremium(cid) then selfSay('Heloo' .. creatureGetName(cid) .. '! I can take you to the Mer Jungle (200 gps) the Samaransa Desert (150gps) House City (1000gps) Lost City (500gps) Isengard (1000gps).') focus = cid talk_start = os.clock() else selfSay('Sorry, only premium players can travel by boat.') focus = 0 talk_start = 0 end elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'samaransa desert') then if pay(cid,150) then selfSay('Let's go!') selfSay('/send ' .. creatureGetName(cid) .. ', 263 111 6') focus = 0 talk_start = 0 else selfSay('Sorry, you don't have enough money.') end elseif msgcontains(msg, 'mer jungle') then if pay(cid,200) then selfSay('Let's go!') selfSay('/send ' .. creatureGetName(cid) .. ', 253 227 7') focus = 0 talk_start = 0 else selfSay('Sorry, you don't have enough money.') end elseif msgcontains(msg, 'house city') then if pay(cid,1000) then selfSay('Let's go!') selfSay('/send ' .. creatureGetName(cid) .. ', 363 107 7') focus = 0 talk_start = 0 else selfSay('Sorry, you don't have enough money.') end elseif msgcontains(msg, 'lost city') then if pay(cid,500) then selfSay('Let's go!') selfSay('/send ' .. creatureGetName(cid) .. ', 477 35 7') focus = 0 talk_start = 0 else selfSay('Sorry, you don't have enough money.') end elseif msgcontains(msg, 'isengard') then if pay(cid,1000) then selfSay('Let's go!') selfSay('/send ' .. creatureGetName(cid) .. ', 728 212 7') focus = 0 talk_start = 0 else selfSay('Sorry, you don't have enough money.') end if string.find(msg, '(%a*)yes(%a*)') and cid == focus and talkcount == 1 then if shop == 1 then buy(cid,item,count,price) talk_start = os.clock() end if shop == 2 then sell(cid,item,count,price) talk_start = os.clock() end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 3 then selfSay('Come back later...')') focus = 0 talk_start = 0 end end end end function onCreatureChangeOutfit(creature) end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end Se não funcionar poste a SS do erro.
-
No config.lua tem uma linha assim: newPlayerChooseVoc = "yes" Seria isso? ;D
-
O Map Editor não encontrou o arquivo dos NPCs e possivelmente dos monstros também. Use o Remere Map Editor, quando abrir o mapa ele vai avisar de que os arquivos de NPC's e/ou Monstros não foram encontrados, quando acontecer isso faça ele localizar, abra o arquivo Monstrers.xml na pasta Monster's e somente um arquivo de qualquer NPC na pasta dos NPC's, ele já carrega todos, depois disso é só apertar em Cancelar. ;D
-
Ta certo, APROVADO! Gostei cara ;D
-
Se foi você mesmo que fez o tutorial, me fale como você descobril que tinha que modifica 75 por EB, o que eles significam no assembly? ^^ Edit~~ Mais uma coisa, acho que isso é proibido... ;D
-
Vá no Items.xml e substitua o amulet of loss nele por esse: <item id="2173" article="an" name="amulet of loss"> <attribute key="weight" value="420"/> <attribute key="slotType" value="necklace"/> </item> ;D
-
[duvida]npc~que Adiciona Classe~8.4
tópico respondeu ao leandrosantucci2 de lucasjockey em Lixeira Pública
Cara, o Oracle tem funções de adicionar vocações no player... Estude elas, transforme e utilize nos seus scripts, como eu disse: trabalhava com versões antigas, as funções mudaram muito. -
[duvida]npc~que Adiciona Classe~8.4
tópico respondeu ao leandrosantucci2 de lucasjockey em Lixeira Pública
Vai ai um exemplo do script Oracle.lua: local LEVEL = 8 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start 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 -- OTServ event handling functions end function oracle(cid, message, keywords, parameters, node) if(cid ~= npcHandler.focus) then return false end local cityNode = node:getParent():getParent() local vocNode = node:getParent() local destination = cityNode:getParameters().destination local townid = cityNode:getParameters().townid local voc = vocNode:getParameters().voc if(destination ~= nil and voc ~= nil and townid ~= nil) then if(getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must first reach level ' .. parameters.level .. '!') else if voc == 1 then doPlayerAddItem(cid,2190,1) doPlayerSendTextMessage(cid,22,"You are now a Sorcerer. May your new wand give you might!") end if voc == 2 then doPlayerAddItem(cid,2182,1) doPlayerSendTextMessage(cid,22,"You are now a Druid. May your new rod give you intellect!") end if voc == 3 then doPlayerAddItem(cid,2456,1) doPlayerAddItem(cid,2544,50) doPlayerSendTextMessage(cid,22,"You are now a Paladin. May your new Bow and Arrows protect you in dangerous cases!") end if voc == 4 then doPlayerAddItem(cid,2428,1) doPlayerAddItem(cid,2531,1) doPlayerSendTextMessage(cid,22,"You are now a Knight. May your new shield and axe give you strength!") end doPlayerSetVocation(cid,voc) doPlayerSetTown(cid,townid) doTeleportThing(cid,destination) doSendMagicEffect(destination,12) end else error('Destination:', destination, 'Vocation:', vocation, 'Townid:', townid) end npcHandler:resetNpc() return true end function greetCallback(cid) if(getPlayerLevel(cid) < LEVEL) then npcHandler:say('CHILD! COME BACK WHEN YOU HAVE GROWN UP!') return false else return true end end -- Set the greeting callback function npcHandler:setCallback(CALLBACK_GREET, greetCallback) -- Set the greeting message. npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?') -- Pre-create the yes/no nodes. local yesNode = KeywordNode:new({'yes'}, oracle, {level = LEVEL}) local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'}) -- Create the actual keyword structure... local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'What city do you wish to live in? Carlin, Thais or Venore?'}) local node2 = node1:addChildKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 2, destination = {x=32360, y=31782, z=7}, text = 'Carlin will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'}) local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A druid! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node2 = node1:addChildKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 5, destination = {x=32369, y=32241, z=7}, text = 'Thais will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'}) local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A mighty druid! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node2 = node1:addChildKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 6, destination = {x=32957, y=32076, z=7}, text = 'Venore will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'}) local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A mighty druid! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'}) -- Make it react to hi/bye etc. npcHandler:addModule(FocusModule:new()) Eu sabia os comandos nas versões anteriores: getPlayerVocation(cid) -- Retorna a vocação. doPlayerSetVocation(cid,voc) -- Coloka uma vocação em determinado player (doPlayerSetVocation("Lucasjockey",4)) Mas o sistema mudou muito do 8.11 para agora... -
-.- Vai em File>Open e abra o mapa, depois procure as cits e o resto com os scrolls (barrinhas de rolagem) no map editor.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.