Ir para conteúdo

pedrizito15

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    pedrizito15 deu reputação a xBen em Spells de transformação e... Modificar magia exori   
    1* 
    local outfit = 126 -- numero da outfit local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 300000) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 20) local function healthTime(cid, time, percent, count, i, storage) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, storage) > os.time() then if count <= i then if isPlayer(cid) then doCreatureAddHealth(cid, percent) doSendMagicEffect(getThingPos(cid), 14) print(percent) end end else doRemoveCondition(cid, CONDITION_OUTFIT) return true end addEvent(healthTime, time*1000, cid, time, percent, count + 1, i, storage) end function onCastSpell(cid, var) if not isPlayer(cid) then return true end local config = { count = 1, i = 300, time = 5, percent = 60, storage = 2020, } if(getPlayerStorageValue(cid, config.storage) > os.time() and getPlayerStorageValue(cid, config.storage) < 400+os.time()) then return doPlayerSendTextMessage(cid, 24, "You are buffed.") end doSetCreatureOutfit(cid, {lookType = outfit}, -1) doAddCondition(cid, condition) setPlayerStorageValue(cid, config.storage, os.time() + config.i) healthTime(cid, config.time, config.percent, config.count, config.i, config.storage) return true end 2*
     
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, element, factor) local levelTotal, formula = level / 5, 0.0496 local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal)) return normal/2, normal, -math.random(elemental/2, elemental) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) local config = { storage = 2020, } if getPlayerStorageValue(cid, config.storage) > os.time() then doCombat(cid, combat, var) else doPlayerSendCancel(cid, "You need activated buff.") end return true end
  2. Gostei
    pedrizito15 deu reputação a Garou em (Resolvido)Escolher magias!   
    Eu testei superficialmente, mas acho que funciona.
    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 local spells = { ["rage of the skies"] = {price = 5, vocations = {1}, level = 60, storage = 17501}, ["hells core"] = {price = 5, vocations = {1}, level = 60, storage = 17501}, ["eternal winter"] = {price = 5, vocations = {1}, level = 60, storage = 17501}, ["wrath of nature"] = {price = 5, vocations = {1}, level = 60, storage = 17501}, } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local moeda = 2157 if msgcontains(msg, "spells") then local text = "Eu vendo essas magias: " local name, values = next(spells, nil) while name do text = text .." {".. name .."}: ".. values.price .." moedas" name, values = next(spells, name) if not name then text = text .."." else text = text .."," end end selfSay(text, cid) elseif spells[msg:lower()] then local spell = msg:lower() if not getPlayerLearnedInstantSpell(cid, spell) then if getPlayerLevel(cid) >= spells[spell].level then if isInArray(spells[spell].vocations, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, moeda, spells[spell].price) then if getCreatureStorage(cid, spells[spell].storage) == -1 then doPlayerLearnInstantSpell(cid, spell) selfSay("Você aprendeu uma nova magia chamada ".. spell .."!", cid) doCreatureSetStorage(cid, spells[spell].storage, 1) else selfSay("Você aprendeu uma magia desse tipo", cid) end else selfSay("Você não possui ".. spells[spell].price .." ".. getItemNameById(moeda) ..".", cid) end else selfSay("Sua vocação não pode aprender essa magia.", cid) end else selfSay("Você não possui o level necessário para aprender essa magia.", cid) end else selfSay("Você já aprendeu essa magia.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())

Informação Importante

Confirmação de Termo