Ir para conteúdo

siralex69

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    siralex69 deu reputação a KekezitoLHP em The Zodiac   
    ┌──────────────────────────────────────────────────┐
    │Nome: Sign of Zodiac
    │Versão do script: 1.0.0
    │Tipo do script: Sistema (Creature Script, Talkaction e Lib)
    │Servidor Testado: The Forgotten Server 0.4.0 Doomed Elderberry
    │Autor: Lwkass
    └──────────────────────────────────────────────────┘   - Características:  
    ~ Bônus em experiencia (Todos recebem 10% a mais) ~ Bônus na defesa contra elemento (Todos absorvem 5%) ~ Cada signo possui um elemento (Fire, Ice, Lighting ou Earth) ~ Signos de Fogo: Aries, Leo e Sagittarius ~ Signos da Terra: Taurus, Virgo e Capricorn ~ Signos da Eletricidade (Ar): Gemini, Libra e Aquarius ~ Signos de Agua: Cancer, Scorpio e Pisces    
    - Explicando: Para escolher o signo o player deve colocar o dia e o mês do aniversário e o sistema automaticamente coloca o signo, comando:    
    !zodiac dia/mês    
    Só para deixar claro como o sistema funciona, usando de exemplo o signo de Leão (Leo) que é do elemento Fire:
    * Se receber um dano do elemento Fire, absorve 5% (modificável) do dano total, ou seja, o dano seria igual a 95% do que seria (dano absorvido indicado por animatedText).
    * Se matar um monstro que tenha uma defesa contra Fire maior que 0% ganha bônus de 10% (modificável) da exp total, ou seja, ganha-se 110% (exp extra indicada por animatedText).

    Se o signo fosse do elemento Earth, então seria a mesma coisa só que com o elemento Earth, se fosse Ice ou Lighting a mesma coisa.

    Pode-se usar o comando !zodiac info para informações.


    - Script:
    Primeiro, na pasta data/lib (caso a pasta não exista, crie) do seu servidor crie um arquivo Lua com o nome zodiac-Lib.lua (Lib com maiúscula) e salve com isso dentro:   --[[ Sign of Zodiac System v1.0.0 by: Lwkass ([email protected]) ]] Zodiac = { constant = { OPTION_PERCENT_BLOCK = 5, -- In Percent OPTION_EXTRA_EXP_RATE = 10, -- In Percent STORAGE_SIGN = 16161, elements = { ["Fire"] = { combat = COMBAT_FIREDAMAGE, color = COLOR_ORANGE }, ["Earth"] = { combat = COMBAT_EARTHDAMAGE, color = COLOR_LIGHTGREEN }, ["Lighting"] = { combat = COMBAT_ENERGYDAMAGE, color = COLOR_TEAL }, ["Ice"] = { combat = COMBAT_ICEDAMAGE, color = COLOR_LIGHTBLUE } } }, signs = { ["Aries"] = { date = {"21/03", "20/04"}, element = "Fire" }, ["Taurus"] = { date = {"21/04", "20/05"}, element = "Earth" }, ["Gemini"] = { date = {"21/05", "20/06"}, element = "Lighting" }, ["Cancer"] = { date = {"21/06", "21/07"}, element = "Ice" }, ["Leo"] = { date = {"22/07", "22/08"}, element = "Fire" }, ["Virgo"] = { date = {"23/08", "22/09"}, element = "Earth" }, ["Libra"] = { date = {"23/09", "22/10"}, element = "Lighting" }, ["Scorpio"] = { date = {"23/10", "21/11"}, element = "Ice" }, ["Sagittarius"] = { date = {"22/11", "21/12"}, element = "Fire" }, ["Capricorn"] = { date = {"22/12", "20/01"}, element = "Earth" }, ["Aquarius"] = { date = {"21/01", "19/02"}, element = "Lighting" }, ["Pisces"] = { date = {"20/02", "20/03"}, element = "Ice" } }, getSignInfo = function (signName) return Zodiac.signs[signName] end, set = function (cid, signName) setPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN, signName) end, get = function (cid) return getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN), Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)) or 0 end, getElement = function (cid) return Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)).element end, getSign = function (cid, day, month) for sign, info in pairs(Zodiac.signs) do _, _, beginDay, beginMonth = info.date[1]:find("(%d+)/(%d+)") _, _, endDay, endMonth = info.date[2]:find("(%d+)/(%d+)") beginDay, beginMonth, endDay, endMonth = tonumber(beginDay), tonumber(beginMonth), tonumber(endDay), tonumber(endMonth) if ((month == beginMonth and day >= beginDay) or (month == endMonth and day <= endDay)) then return sign, info end end end } Agora na pasta data/creaturescripts/scripts:
    No arquivo login.lua adicione isso antes do return:   -- Zodiac registerCreatureEvent(cid, "zodiacKill") registerCreatureEvent(cid, "zodiacStats") if (getPlayerLastLogin(cid) <= 0 or getPlayerStorageValue(cid, 16160) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Please, when is your birthday date ? (Example: !zodiac day/month = !zodiac 1/2, !zodiac 23/7,...)") setPlayerStorageValue(cid, 16160, 1) -- Talk state else doPlayerSetSpecialDescription(cid, ", sign of " .. getPlayerStorageValue(cid, 16161)) end E crie esses arquivos:
    zodiacKill.lua   dofile('data/lib/zodiac-Lib.lua') function getMonsterPath(monstername) f = io.open ("data/monster/monsters.xml", 'r') for line in f:lines() do _, _, name, path, file_name = string.find(line, '<monster name="(.+)" file="(.+)/(.+).xml"/>') if (name and path and file_name and name:lower() == monstername:lower()) then f:close() return path .. "/" .. file_name .. ".xml" end end end function getMonsterElementDefense(monstername, element) f = io.open ("data/monster/" .. getMonsterPath(monstername), 'r') for line in f:lines() do if (string.find(line, '</elements>')) then break end _, _, n = string.find(line, '<element '.. element:lower() ..'Percent="([-%d]+)"/>') if (n) then f:close() return tonumber(n) end end f:close() return 0 end ------- function onKill(cid, target, lastHit) if (isMonster(target) and getMonsterElementDefense(getCreatureName(target), (Zodiac.getElement(cid) == "Lighting" and "Energy" or Zodiac.getElement(cid))) > 0) then local exp_bonus = math.ceil(getMonsterInfo(getCreatureName(target)).experience * (Zodiac.constant.OPTION_EXTRA_EXP_RATE/100)) doSendAnimatedText(getThingPos(cid), exp_bonus, COLOR_GREY) doPlayerAddExperience(cid, exp_bonus) end return true end  zodiacStats.lua
    dofile('data/lib/zodiac-Lib.lua') function onStatsChange(cid, attacker, type, combat, value) playerSign = Zodiac.get(cid) if (combat == Zodiac.constant.elements[Zodiac.getElement(cid)].combat) then valuem = math.ceil(value*(Zodiac.constant.OPTION_PERCENT_BLOCK/100)) doCreatureAddHealth(cid, valuem) doSendAnimatedText(getThingPos(cid), "+"..valuem, Zodiac.constant.elements[Zodiac.getElement(cid)].color) end return true end Certo, agora no arquivo data/creaturescripts/creaturescripts.xml, adicione isso:
     
    <event type="statschange" name="zodiacStats" event="script" value="zodiacStats.lua"/> <event type="kill" name="zodiacKill" event="script" value="zodiacKill.lua"/> Na pasta data/talkactions/scripts, adicione um arquivo Lua com o nome de zodiacTalk.lua:
     
    dofile('data/lib/zodiac-Lib.lua') function onSay(cid, words, param, channel) if (param:len() == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use '!zodiac day/month' or '!zodiac info'") return true end playerSign, Info = Zodiac.get(cid) if (type(playerSign) == "string" and param:lower() == "info") then doPlayerPopupFYI(cid, [[ Zodiac Informations ~ ------------------------------- * Sign: ]] .. playerSign .. [[ * Element: ]] .. Info.element .. [[ * Bonus: +]] .. Zodiac.constant.OPTION_EXTRA_EXP_RATE .. [[% experience of ]] .. Zodiac.getElement(cid) .. [[ monsters +]] .. Zodiac.constant.OPTION_PERCENT_BLOCK .. [[% of defense in attacks with ]] .. Zodiac.getElement(cid) .. [[ element ]]) elseif (getPlayerStorageValue(cid, 16160) == 1) then _, _, day, month = string.find(param, "(%d+)/(%d+)") day, month = tonumber(day), tonumber(month) if (day and month and day > 0 and day <= 31 and month > 0 and month <= 12) then Zodiac.set(cid, Zodiac.getSign(cid, day, month)) playerSign = Zodiac.get(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param) doSendMagicEffect(getThingPos(cid), math.random(28, 30)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sign of zodiac is " .. playerSign .. " which is of element " .. Zodiac.getElement(cid) .. " !") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can see more information saying '!zodiac info', remember this...") setPlayerStorageValue(cid, 16160, -1) else doPlayerSendCancel(cid, "You put a invalid date.") end end return true end Coloque essa tag no arquivo data/talkactions/talkactions.xml
     
    <talkaction words="!zodiac" event="script" value="zodiacTalk.lua"/>  
  2. Gostei
    siralex69 deu reputação a xWhiteWolf em Knight Implode/Explode   
    Eu tava brincando de "vamos procurar uns scripts legais e tentar melhorá-los" e eis que eu me deparei com duas spells muito legalzinhas num forum americano e decidi editá-las pra que elas funcionassem em conjunto.
    Feito isso eu acabei criando o seguinte sistema de combos: O cara solta a primeira spell e ele tem 5 segundos pra soltar a segunda spell, NÃO É POSSÍVEL UTILIZAR A SEGUNDA SPELL SEM TER USADO A PRIMEIRA ANTES e se o player tentar usar a primeira spell novamente nesses 5 segundos ele vai perder 15% de vida.... só se atentem ao fato de que a segunda magia deve ser bem mais forte que a primeira pra coisa ter graça.

    Primeiro de tudo crie dois scripts chamados kaesar7.lua e kaesar9.lua
    em kaesar7.lua adicione o seguinte:



     
    e em kaesar9.lua adicione o seguinte:



     
    e em spells.xml adicione:
    <instant name="Implode" words="knight implode" lvl="120" mana="200" prem="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="attack/kaesar9.lua"> <vocation id="4"/> <vocation id="8"/> </instant> <instant name="Explode" words="knight explode" lvl="120" mana="200" prem="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="attack/kaesar7.lua"> <vocation id="4"/> <vocation id="8"/> </instant> Bom, ambos scripts são complexos mas as edições são bem parecidas com qualquer outra magia.
    No script 1 vc pode editar aqui:
    local stepDelay = 75 --- tempo entre um e outro.. quanto menor mais rápido a magia sai
    local spins = 2  --- numero de voltas que vai dar antes de explodir
    local percent = 15 --- porcentagem de vida que perde caso use a spell 2x seguidas
     
    Créditos: 90% pro Colandus (o cara que fez os scripts)
    10% pra mim por ter editado tudo e feito as magias serem dependentes
  3. Gostei
    siralex69 deu reputação a xWhiteWolf em Anel de Sauron   
    Fala galera do TK, criei esse anelzinho pra servers que procuram inovar.. 
    bom, oque ele faz??
    Simples, ele torna o usuário invisível.
    aff, mas já existe o stealth ring que faz isso!
    Sim mas dessa vez eu digo invisível mesmo, nenhum monstro ou players conseguirá te ver.
    que lixo, assim qualquer player vai poder ficar invisível e passar no meio dos monstros e players.. vai estragar o server
    Aí é que vc se engana porque o anel vem uma maldição, quem usar ele vai perdendo 3% de vida por segundo (ajustável) e só vai estragar o server se vc sair distribuindo o anel pra todos os players haha

    O anel em si possui duas versões, na primeira ele retira 3% de vida por segundo, na segunda ele adiciona uma condição que te deixa perdendo uma quantidade fixa de vida, CONTUDO, na segunda versão aparece uma poça de sangue cada vez que toma o dano então dá pros players te pegarem caso vc coloque o anel e resolva fugir kkkkk
    Vou chamar aqui de versão 1 e 2 respectivamente.
    OBS: ISSO É EM MOVEMENTS!

     
     
    1ª versão (sem sangue mas que tira 3% de vida por segundo):
    local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) local percent = 3 local tempo = 1 -- em segundos function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "By using this ring you will become fully invisible and lose health over time because of it's curse.") function lifesteal(cid) steal = addEvent(lifesteal, 1000*tempo, cid) if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-"..math.floor((getCreatureMaxHealth(cid) * (percent/100))), 144, cid) doCreatureAddHealth(cid, -math.floor(getCreatureMaxHealth(cid) * (percent/100))) end end lifesteal(cid) doAddCondition(cid, invisible) doAddCondition(cid, outfit) doSendMagicEffect(getCreaturePos(cid), 12) return true end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2165) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") stopEvent(steal) doRemoveCondition(cid, CONDITION_INVISIBLE) doSendMagicEffect(getCreaturePos(cid), 12) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) return true end   2ª versão (a cada 1,5 segundos ele te tira um dano configurado e deixa uma poça de sangue embaixo de vc facilitando que te identifiquem mesmo estando invisivel):
    local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) local condition = createConditionObject(CONDITION_PHYSICAL) setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE) addDamageCondition(condition, -1, 1500, -500) function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "By using this ring you will become fully invisible and lose health over time because of it's curse.") doAddCondition(cid, condition) doAddCondition(cid, invisible) doAddCondition(cid, outfit) doSendMagicEffect(getCreaturePos(cid), 12) return true end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2165) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") doRemoveCondition(cid, CONDITION_PHYSICAL) doRemoveCondition(cid, CONDITION_INVISIBLE) doSendMagicEffect(getCreaturePos(cid), 12) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) return true end Agora edite no items.xml o stealth ring pra que ele seja infinito:
    <item id="2202" article="a" name="stealth ring"> <attribute key="weight" value="100" /> <attribute key="slotType" value="ring" /> <attribute key="transformDeEquipTo" value="2165" /> </item> e em movements.xml adicione essas linhas:
    <movevent type="Equip" itemid="2202" slot="ring" event="script" value="stealth.lua"/> <movevent type="DeEquip" itemid="2202" slot="ring" event="script" value="stealth.lua"/> Editando:
    Na primeira versão vc pode alterar as seguintes coisas que estão em colorido:
    local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE)
    local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false)
    local percent = 3
    local tempo = 1 -- em segundos
     
    em vermelho é o tempo que dura a invisibilidade... -1 é infinito
    em azul é a porcentagem de vida que perde por tempo
    em verde é o tempo em que se perde vida.. nesse caso a cada 1 segundo perde 3%
     
    Na segunda versão vc pode editar as mesmas coisas do primeiro só que o tempo e o dano pelo tempo estão na condition:
     
    local condition = createConditionObject(CONDITION_PHYSICAL)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE)
    addDamageCondition(condition, -1, 1500, -500)
     
    em vermelho é o numero de vezes que vai tirar vida. Mais uma vez -1 significa infinito (infinito até remover o anel)
    em azul é o dano que vc toma a cada tempo (lembre-se de deixar sempre um - na frente se não ele vai adicionar vida)
    em verde é o tempo em que se perde vida.. nesse caso a cada 1 segundo e meio retira 500 de vida
     
     
    Bom, é isso.. um script simples mas que vai ajudar muita gente pelo fato de usar conditions não tão comuns e de uma forma diferente haha

Informação Importante

Confirmação de Termo