Ir para conteúdo

RigBy

Visconde
  • Total de itens

    411
  • Registro em

  • Última visita

  • Dias Ganhos

    10

Histórico de Reputação

  1. Upvote
    RigBy deu reputação a DuuhCarvalho em Lista de Callbacks   
    Faça isso , vai ajudar bastante os iniciantes .
  2. Upvote
    RigBy recebeu reputação de kavaskiva em Lista de Callbacks   
    Callbacks

    Você já deve ter se perguntado como os scripts funcionam ou não. Por exemplo: Como o servidor sabe que quando eu apertar com o botão direito em um Health Potion ele terá que healar o player alvo?
    Em primeiro lugar devemos entender o que são callbacks. Do modo mais simples callback é algo que acontece devido a uma reação, é como a Terceira Lei de Newton que diz que toda ação gera uma reação, esse callback é a nossa reção, é uma função que vai ser executada assim que algo acontecer, no caso do Health Potion assim que ele for usado.
    Credito: Maxwellden



    ACTIONS
    onUse(cid, item, fromPosition, itemEx, toPosition) CREATURE SCRIPTS
    onLogin(cid) onLogout(cid) onAdvance(cid, skill, oldLevel, newLevel) onStatsChange(cid, attacker, type, combat, value) onDirection(cid, old, current) onOutfit(cid, old, current) onSendMail(cid, receiver, item, openBox) onReceiveMail(cid, sender, item, openBox) onTradeRequest(cid, target, item) onTradeAccept(cid, target, item, targetItem) onJoinChannel(cid, channel, users) onLeaveChannel (cid, channel, users) onLook(cid, thing, position, lookDistance) onThink(cid, interval) onTextEdit(cid, item, newText) onReportBug(cid, comment) onAreaCombat(cid, tileItem, tilePosition, isAggressive) onPush(cid, target) onTarget(cid, target) onFollow(cid, target) onCombat(cid, target) onAttack(cid, target) onCast(cid, target) onKill(cid, target, lastHit) onDeath(cid, corpse, deathList) onPrepareDeath(cid, deathList) GLOBAL EVENTS
    onThink(interval) onStartup() onShutdown() onGlobalSave() onRecord(current, old, cid) onTime() MOVEMENTS
    onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor) onEquip(cid, item, slot) onDeEquip(cid, item, slot) onAddItem(moveItem, tileItem, position, cid) onRemoveItem(moveItem, tileItem, position, cid) SPELLS
    onCastSpell(cid, var) TALKACTIONS
    onSay(cid, words, param, channel) WEAPONS
    onUseWeapon(cid, var)
    Retirado do SCRIPTSYSTEM_HELP, doc das Sources do TFS.
     
    ​Créditos: Renato
    RigBy
  3. Upvote
    RigBy recebeu reputação de Jaysonsilva em Piso Remover   
    local monster = {x = 1, y = 2, z = 3} -- posição que o trainer vai aparecer local name = "trainer" -- NOME DO MONSTRO QUE SERA SUMONADO DEVE SEMPRE ESTAR ENTRE ASPAS Exemplo: "dragon" "frost dragon" function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then doPlayerSendCancel(cid, "Bem vindo ao trainer.") doSummonCreature(name, monster) end return true end function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor) doPlayerSendCancel(cid, "Tchau.") doRemoveCreature(getTopCreature(monster).uid) return true end testa ai so basta criar outra tag com stepout com o mesmo actionid
     
    tags
     
    <movevent type="StepIn" actionid="57573" event="script" value="as.lua"/> <movevent type="StepOut" actionid="57573" event="script" value="as.lua"/>
  4. Upvote
    RigBy recebeu reputação de dirceujunior1 em problemas com nava vocation   
    Se você adiciona ele como promotion, ela não vai aparecer.
    tipo:
     
    fromvoc="9" -- so basta editar colocando aqui o id da vocação que voce vai querer que seja promovida
     
    tipo druid id 2 ai vc coloca fromvoc="2" e cria uma script de promote ou adiciona com o god hehehe.
    flw
  5. Upvote
    RigBy recebeu reputação de felippepsa em System akatsuki   
    @likinho: acho que isso não tem nada a ver com o pedido que o cara fez ,esse script e so um changer vocation feito pelo 20cm.
     
    @topico: Caso ainda não tenha resolvindo fala ai que não, que quando eu chega em casa eu tento fazer sua script falo.
     
    @script
    npc
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Tobi" script="data/npc/scripts/tobi npc script.lua" walkinterval="2000" speed="0" floorchange="0"> <health now="100" max="100"/> <look type="480" head="0" body="0" legs="0" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Voce que troca seus coracoes para pode entra na akatsuki.reponda {yes} ?"/> </parameters> </npc> script do npc
    local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local vocation = 120 -- vocation que precisa ter local vocatiion = 900 -- vocation que vai se transforma local item = 5943 -- ID do Item que necessita para trocar local quantidade = 10 -- quantidade de corações local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'sim')) then if getPlayerStorageValue(cid, 8219382) == -1 then if getPlayerVocation(cid) == vocation then if getPlayerItemCount(cid, item) < quantidade then selfSay('Não tente me enganar, voce não tem os '..quantidade..' corações !', cid) else doPlayerRemoveItem(cid, item, quantidade) doPlayerSetVocation(cid, vocatiion) setPlayerStorageValue(cid,8219382,1) selfSay('Voce agora faz parte da akatsuki.', cid) end else selfSay('Voce nao tem a vocacao nessessaria.', cid) end else selfSay('Voce ja faz parte da akatsuki.', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Coração
     
    Creaturescript/script/nome do script adicione isso dentro
     
    function onKill(cid, target, lastHit) local item = 5943 local level = 300 if isPlayer(cid) and isPlayer(target) then if getPlayerLevel(target) >= level then local add = doPlayerAddItem(cid, item, 1) doItemSetAttribute(add, "description","Esse coração é de "..getPlayerName(target).." que foi morto no level "..getPlayerLevel(target).." por "..getPlayerName(cid)..".") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce Mato " ..getPlayerName(target).. ".") doSendMagicEffect(getPlayerPosition(cid),12) end end return true end Tag:
    <event type="kill" name="HeartSys" event="script" value="heart.lua"/> Testado e funcionando
  6. Upvote
    RigBy deu reputação a felippepsa em Galeria Felippepsa   
    Olá pessoal como estou fazendo remake de tudo decidi refazer o topico.
     
    Sasuke Remake :
     
    Sasuke com cabelo mais claro :
     
    Madara Rikudou Akatsuki Remake :
     
    Bastão Obito Rikudou :
     
    Bastão Rikudou Sennin :
     
    Bastão Madara Rikudou :
     
    Espada :
     
    Espada Kakashi (Criança) :
     
    Novas :
     
    Sabre de Luz :
     
    Pra Zoar :
     
    Objetos de Hokey :
     
    Ainda estou terminando algumas sprites. Embreve mais remakes.
  7. Upvote
    RigBy recebeu reputação de dirceujunior1 em problemas com nava vocation   
    pronto ajeitei ,eu apaguei aqueles vocation epic já que você não usa e adicionei a sua.caso você queria adicionar mais agora pega. demon fury id:9
     
     
    <?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="9" name="Demon Fury" description="a Demon Fury" needpremium="1" gaincap="30" gainhp="30" gainmana="30" gainhpticks="2" gainhpamount="700" gainmanaticks="2" gainmanaamount="700" manamultiplier="1.1" attackspeed="70" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="20"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> </vocations>
  8. Upvote
    RigBy recebeu reputação de deviletico em Npc Hunt por Item   
    Testa assim:
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) local pos = {x=1039, y=1072, z=7} -- Local da hunt local posreturn = {x=1039, y=1072, z=7} -- Posiçao onde o player sera teleportado quando acabar o tempo local itemid = 2160 -- item que sera removido local quantidade = 1 -- quantidade config = { time = 10 ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto----- } function doReturnPos() doTeleportThing(cid, posreturn) setGlobalStorageValue(24688, 0) setGlobalStorageValue(24686, none) setPlayerStorageValue(cid, 28680, 0) end if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'hunt') then if getGlobalStorageValue(24688) == 1 then doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta na hunt") return true end if not doPlayerRemoveItem(cid, itemid, quantidade) then doPlayerSendTextMessage(cid,22,""..getPlayerName(cid)..", voce precisa do "..itemid.." para usar a hunt paga") return true end doPlayerRemoveItem(cid, itemid, quantidade) doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.") doTeleportThing(cid, pos) setGlobalStorageValue(24688, 1) setGlobalStorageValue(24686, getPlayerName(cid)) setPlayerStorageValue(cid, 28680, 1) addEvent(doReturnPos, config.time*60*1000) else selfSay('Diga Hunt', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  9. Upvote
    RigBy recebeu reputação de kazaana em criando npc de mudar vocation ?   
    em vocation.xml
     
    fromvoc="1" -- mude pro mesmo id da vocation
  • Quem Está Navegando   0 membros estão online

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