Ir para conteúdo

Skulls

Herói
  • Total de itens

    859
  • Registro em

  • Última visita

  • Dias Ganhos

    22

Tudo que Skulls postou

  1. Da forma que eu pus ele considera a vocação e sua promoção como uma so, mas da pra mudar. Nao, nao daria bug. Testa e me fala.
  2. Não sei, o meu n tem. Mas faz um talkaction que faz um opcode que chama uma função no otc que facaisso obplayer falar algo, ai vc sabe se funcionou.
  3. Se o seu server nao tiver opcode naobvai funcionar. Caso não tenha eu tenho um módulo que criei que faz o mesmo papel.
  4. A claro, eu defini essa area e esqueci de postar kkk em spells/lib/spells.lua coloque: AREA_SQUARE3X3 = { {1,1,1,1,1,1,1}, {1,1,1,1,1,1,1}, {1,1,1,1,1,1,1}, {1,1,1,2,1,1,1}, {1,1,1,1,1,1,1}, {1,1,1,1,1,1,1}, {1,1,1,1,1,1,1} }
  5. Uai mas eu fiz assim.
  6. Eu ja vi no 2010, mas queria 2013 Up
  7. Ot client buga o hideHealth, to tentando reaolver isso. Lobo nao sei o tile, te mando chegando em casa amanhã. @Up Invisibilidade funcionando no OTC: Dark binding da morgana (LOL) Ai ele mata o bicho entao nao mostra, mas fica disparando efeitos no alvo por 3 segundos e ele fica imovel nesse tempo.
  8. Por nada cara. Mais alguma coisa ou tudo resolvido? Caso esteja, marque como resolvido para moverem o tópico. Abraços!
  9. Hm, pode ser. Mudarei isso então, fica até mais simples, pq ao inves de for terá um random. xDEditei la da forma que você sugeriu. Fiz a spell1 do jeito que eu entendi, não sei se está do jeito que você queria mas com alguns ajustes chegamos lá: <instant name="Spell1" words="baratask spell1" lvl="1" mana="100" prem="0" exhaustion="20000" groups="1,2000" icon="23" needlearn="0" event="script" value="attack/spell1.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> local config = { cd = 20, hit_delay = 2000, stg = 5573, life_percent = 5, mana_percent = 10, hits = 3 } local combat = createCombatObject() local area = createCombatArea(AREA_SQUARE3X3) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatArea(combat, area) function onTargetCreature(cid, target) if not isCreature(target) then return false end local healthDmg = -getCreatureHealth(target)*config.life_percent/100 local manaDmg = -getCreatureMana(target)*config.mana_percent/100 doSendMagicEffect(getCreaturePosition(target), CONST_ME_MAGIC_RED) doTargetCombatHealth(cid, target, COMBAT_LIFEDRAIN, healthDmg, healthDmg, CONST_ME_MAGIC_RED) doTargetCombatMana(cid, target, manaDmg, manaDmg, CONST_ME_MAGIC_BLUE) return true end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function attack(cid, var, hits) n = hits or 0 if n >= config.hits then return false end doCombat(cid, combat, var) addEvent(attack, config.hit_delay, cid, var, n+1) end function onCastSpell(cid, var) if not isPlayer(cid) then return false end if getPlayerStorageValue(cid, config.stg) - os.time() <= 0 then setPlayerStorageValue(cid, config.stg, os.time() + config.cd) attack(cid, var) else doPlayerSendCancel(cid, "You're exhausted.") end return true end Up, e ao cara funcionou?!
  10. Não não, to venho pra isso. So curti os sprites xD. Valeu!
  11. @Caronte wolf tava me explicando melhor obvar ontem, ele eh mt útil. Como que a gt nao sabia?! Kkk
  12. Boa tarde galera, Gostaria de saber se existe algum tutorial de compilação do tfs 0.4 em visual C++ 2013. Se não houver, alguém saberia me instruir como criar um projeto no msvc 2013 para compilar o tfs 0.4? Valeu! Abraços,
  13. Tenta isso ai: (só confere a ordem das vocações se druid é 1, sorc 2, etc mesmo. local vocation = { druid, sorcerer, paladin, knight } function onDeath(cid, corpse, deathList) local gid = 0 local winner = {} if isMonster(cid) and getCreatureName(cid) == "Ice Crystal" then if not getPlayingGuilds() then return true end local guilds = getPlayingGuilds() local max = 0 for index, var in pairs(guild_hit_count) do if var > max then max = var gid = index end end setGlobalStorageValue(1823999, gid) query("UPDATE `castle_dono` SET `guild_id` = '"..gid.."' WHERE `guild_id` > 0") doBroadcastMessage("{Castle War} O evento acabou, a guild com maior desempenho foi "..getGuildNameById(gid)..", com "..pointNumber(max).." pontos sobre o castelo.") updateCastleData() setGlobalStorageValue(18219113, -1) if gid > 0 then local mx = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerGuildId(pid) == gid then local st = getPlayerStorageValue(pid, 1827311) local i = getPlayerVocation(pid) if st > mx[i%4] then mx[i%4] = st winner[i%4] = pid end end end for i = 0, #winner do if isPlayer(winner[i]) then local r = math.random(1,100) for v, k in pairs(premios) do if r >= v[1] and r <= v[2] then local rand = k[math.random(#k)] itemr, amountr = rand[1], (not rand[2] and 1 or rand[1] and rand[2] or 1) end end local recompensa = doPlayerAddItem(winner[i], itemr, amountr) doBroadcastMessage("{Castle War} O jogador com maior desempenho da vocação " ..vocation[i].." foi "..getCreatureName(winner[i])..", com "..pointNumber(mx).." pontos sobre o castelo. Ele recebeu "..pointNumber(amountr).."x "..getItemNameById(itemr).." como premio.") doItemSetAttribute(recompensa, 'description', "Premio do jogador "..getCreatureName(winner[i]).." ganho no evento castle war do dia "..os.date("%d/%m/%y")..".") local medal = doPlayerAddItem(winner[i], 10127, 1) doItemSetAttribute(medal, 'description', "Trofeu ganho pelo jogador "..getCreatureName(winner[i]).." no evento castle war do dia "..os.date("%d/%m/%y")..".") end end end for _, pid in pairs(getPlayersOnline()) do if isInArea(getThingPos(pid), {x = 500, y = 574, z = 6}, {x = 575, y = 620, z = 6}) or isInArea(getThingPos(pid), {x = 511, y = 588, z = 5}, {x = 556, y = 607, z = 5}) or isInArea(getThingPos(pid), {x = 511, y = 588, z = 4}, {x = 556, y = 607, z = 4}) or isInArea(getThingPos(pid), {x = 511, y = 588, z = 3}, {x = 556, y = 607, z = 3}) or isInArea(getThingPos(pid), {x = 481, y = 580, z = 7}, {x = 683, y = 798, z = 7}) then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end guild_hit_count = {} end return true end
  14. Você pode usar dentro da função que você criou getPlayerSkillLevel(cid, skillId) e usar esse skill na formula, mas não faria muito sentido. rs @Lobo e Caronte, obrigado pelos comentarios e feedbacks! Abraços,
  15. Boa noite galera, Estou a alguns dias tentando resolver um problema que tive com o OTC: ao usar a função doCreatureSetHideHealth simplesmente o player trava e não consegue fazer nada até o hidehealth ser desfeito. Isso ocorre porque, na source do OTC, a declaração de morte é feita baseada em porcentagem de vida e essa inexiste quando o hideHealth é acionado, somente a vida total e a vida máxima é que continuam com valores relevantes. Então, o OTC simplesmente te considera como um morto vivo quando você usa hideHealth e você não pode realizar nenhuma ação no jogo a não ser deslogar. Após alguns dias fuçando consegui finalmente resolver o problema e vim compartilhar a solução com vocês. 1) Na source do seu OTC vá em creatures.cpp. Crie as funções abaixo: double Creature::getLocalPlayerHealth() { return g_game.getLocalPlayer()->getHealth(); } bool Creature::isDead() { if (!isLocalPlayer()) return m_healthPercent <= 0; double m_health = getLocalPlayerHealth(); return m_health <= 0; } Substitua: if(m_healthPercent < 1) // creature is dead return; por if(m_healthPercent < 1) // creature is dead if (!isLocalPlayer()) return; 2) Vá em creature.h e troque a declaração da função isDead() por: bool isDead(); 3) Em game.cpp troque a função proccessDeath por: void Game::processDeath(int deathType, int penality) { if (m_localPlayer->getHealth() > 0){ m_dead = true; m_localPlayer->stopWalk(); g_lua.callGlobalField("g_game", "onDeath", deathType, penality); } } Pronto, o seu OTC agora suporta a função doCreatureSetHideHealth (e de bônus você consegue enxergar o seu player com uma barra preta e seu nome, apesar dos outros não te verem). Bom é simples, mas útil espero que ajude. Abraços,
  16. Entendo Caronte. Obrigado pelo feedback, mas não sei se caberia aqui pq realmente é um conteúdo mais complexo que depende de conhecimentos anteriores. Acho que seria um desperdício explicar toda a dinâmica das spells para chegar ao ponto central do tutorial, sendo que tem bilhares de tutoriais que ensinam o básico. O que eu acho que poderia ter feito era indicar no inicio do tutorial conteudos mais basicos para que o leitor pudesse entendera base e ai sim vir a este tutorial, o que acha? Valeu novamente. Abraços,
  17. @UP Resolvido: Nas sources do otclient ir em creature.cpp e criar as funções: double Creature::getLocalPlayerHealth(){ return g_game.getLocalPlayer()->getHealth(); } bool Creature::isDead() { if (!isLocalPlayer()) return m_healthPercent <= 0; double m_health = getLocalPlayerHealth(); return m_health <= 0; } Ainda em creature.cpp alterar na função drawInformation a linha if(m_healthPercent < 1) // creature is dead return; por if(m_healthPercent < 1) // creature is dead if (!isLocalPlayer()) return; Em creature.h alterar a declaração de isDead para somente: bool isDead(); Em game.cpp alterar a função processDeath por: void Game::processDeath(int deathType, int penality) { if (m_localPlayer->getHealth() > 0){ m_dead = true; m_localPlayer->stopWalk(); g_lua.callGlobalField("g_game", "onDeath", deathType, penality); } }
  18. Na verdade CALLBACK_PARAM_SKILLVALUE cria uma formula sua que você pode definir o que quiser baseado em level, skill, attack, factor. O skill que é passado por parâmetro para a função que você definiu nesse callback é o skill da arma que você estiver empunhando. No caso de nenhuma, ai é fist.
  19. Tambem acho, mas pelo pedido dele acho que são todos mesmo, não?
  20. O erro ta ai, então. rs mas não sei arrumar isso não, pq mesmo que você crie uma coluna online tem que mandar o servidor atualizar ela quando o player estiver online e quando ele deixar de estar.
  21. Abre seu banco de dados e ve se em players tem uma coluna chamada "online"
  22. Coluna online não existe ali.
  23. Terceira: <instant name="Skell Summon" words="utevo res skell" lvl="1" mana="500" prem="0" exhaustion="1" groups="1,1" icon="23" needlearn="0" event="script" value="attack/skellsummon.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> local config = { creature = "Demon", summon_time = 15*1000, cd = 20, stgs = {cd = 5571, remove = 5572}, life_percent = 20 } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_INFIGHT) setConditionParam(condition, CONDITION_PARAM_TICKS, 15 * 1000) function removeSummon(cid) if getPlayerStorageValue(cid, config.stgs.remove) == -1 then return false end if not isPlayer(cid) then return false end summons = getCreatureSummons(cid) for _, i in pairs(summons) do if isCreature(i) then if getCreatureName(i) == config.creature then doRemoveCreature(i) setPlayerStorageValue(cid, config.stgs.remove, -1) doRemoveCondition(cid, CONDITION_INFIGHT) return true end end end return false end function onCastSpell(cid, var) if not isPlayer(cid) then return false end if getPlayerStorageValue(cid, config.stgs.remove) ~= -1 then summons = getCreatureSummons(cid) for _, i in pairs(summons) do if isCreature(i) then if getCreatureName(i) == config.creature then doRemoveCreature(i) setPlayerStorageValue(cid, config.stgs.remove, -1) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)*config.life_percent/100) doCombat(cid, combat, var) doRemoveCondition(cid, CONDITION_INFIGHT) return true end end end return false end if getPlayerStorageValue(cid, config.stgs.cd) - os.time() <= 0 then doAddCondition(cid, condition) setPlayerStorageValue(cid, config.stgs.cd, os.time() + config.cd) setPlayerStorageValue(cid, config.stgs.remove, 1) doCombat(cid, combat, var) monster = doSummonCreature(config.creature, getCreaturePosition(cid)) doConvinceCreature(cid, monster) addEvent(removeSummon, config.summon_time, cid) else doPlayerSendCancel(cid, "You're exhausted.") end return true end Testa ai e ve se ta no jeito. PS: mude o nome de Demon para o monstro que você quiser. Abraços, EDITADO: SOBRE A PRIMEIRA SPELL ELA EH AREA 3x3 EM VOLTA DO PLAYER OU DIRECIONADA?
  24. Acabei fazendo a 2 aqui de bobeira xD @@baratask Tente isso: <instant name="Statue Attack" words="utevo res statue" lvl="1" mana="500" prem="0" exhaustion="20000" groups="1,4000" icon="23" needlearn="0" event="script" value="attack/statue.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> Em um arquivo chamado statue.lua, dentro de spells/attack coloque o codigo: local config = { statue = 1444, range = 5, max_dmg = -150, min_dmg = -50, hit_delay = 1000, statue_time = 10*1000, cd = 20, stg = 5570 } local max_hits = config.statue_time/config.hit_delay local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(combat, COMBAT_FORMULA_DAMAGE, 0, config.min_dmg, 0, config.max_dmg) local condition = createConditionObject(CONDITION_INFIGHT) setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000) function removeItem(pos) doRemoveItem(getTileItemById(pos, config.statue).uid) end function attackSpecs(cid, pos, var, hits) n = hits or 0 if n >= max_hits then return false end local spec = getSpectators(pos, config.range, config.range) i = spec[math.random(1, #spec)] if #spec <= 1 then return false end while(i == cid) do i = spec[math.random(1, #spec)] end if isCreature(i) then var.pos = getCreaturePosition(i) doSendDistanceShoot(pos, var.pos, CONST_ANI_SUDDENDEATH) doCombat(cid, combat, var) end addEvent(attackSpecs, config.hit_delay, cid, pos, var, n+1) end function itemInteraction(cid, pos, var) attackSpecs(cid, pos, var) addEvent(removeItem, config.statue_time, pos) end function onCastSpell(cid, var) if not isPlayer(cid) then return false end if getPlayerStorageValue(cid, config.stg) - os.time() <= 0 then doAddCondition(cid, condition) setPlayerStorageValue(cid, config.stg, os.time() + config.cd) local pos = Position(getCreaturePosition(cid).x+1, getCreaturePosition(cid).y, getCreaturePosition(cid).z) doCreateItem(config.statue, 1, pos) itemInteraction(cid, pos, var) else doPlayerSendCancel(cid, "You're exhausted.") end return true end Me dê retorno. gif dela: Abraços, ps: você não deu maiores detalhes como no que depende o dano, velocidade dos hits, nem cooldown, qual estatua usar, etc. Então fiz do jeito que preferi, mas é altamente customizável basta mexer/pedir.
  • Quem Está Navegando   0 membros estão online

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