Ir para conteúdo

MasterDino

Campones
  • Total de itens

    83
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Posts postados por MasterDino

  1. No Object Builder na page de outfits buga do 1000 ao 2700 (aqui pelo menos né...), mas fora isso está perfeito, muito bom REP+

     

    --Edit

    Era a versão do meu O.B (0.4.1), troquei pelo 0.3.4 e foi de boa.

  2.  

     

    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    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
    
    npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Say {halloween}.")
    
    local outfits = {857,853,852,851,843,837,833,785,720,659,597,549,544,523,510,878,877,890}
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
    
    function onTargetCreature(cid, target)
    	doSetCreatureOutfit(target, math.random(#outfits), 3 * 24 * 3600 * 1000)
    end
    setCombatCallBack(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    
    setCombatArea(combat, createCombatArea({
    	{1,1,1,1,1},
    	{1,1,1,1,1},
    	{1,1,3,1,1},
    	{1,1,1,1,1},
    	{1,1,1,1,1}
    }))
    
    function creatureSayCallback(cid, type, msg)
    	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    	if(not npcHandler:isFocused(cid)) then
    		return false
    	end
    	
    	if(msg:lower() == "halloween") then
    		doCombat(getNpcId(), combat, positionToVariant(getThingPos(getNpcId())))
    		npcHandler:say('You are Dead, Suprise!', talkUser)
    	end
    	return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())
    

     

     

     

    Não testado.

  3. MELODIA:

     

     

    local tempo = 60 -- tempo em segundos.

    local effect = {136} -- effect no player

    local ml = 6 -- quantos ira aumentar o skill de ML
    local skillfist = 5 -- quantos ira aumentar o skill de Fist
    local skillsword = 5 -- quantos ira aumentar o skill de Sword
    local skillaxe = 5 -- quantos ira aumentar o skill de Axe
    local skillclub = 5 -- quantos ira aumentar o skill de Club
    local skilldistance = 5 -- quantos ira aumentar o skill de Distance
    local skillshield = 5 -- quantos ira aumentar o skill de Shield
    local health = 150 -- A cada 1 segundo quantos aumentar de vida
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
    setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
    setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
    setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
    setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)
    setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)
    setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)
    setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
    setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
    setCombatCondition(combat, condition)

    local condition = createConditionObject(CONDITION_HASTE)
    setConditionParam(condition, CONDITION_PARAM_SPEED, 250)
    setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
    setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
    setCombatCondition(combat, condition)

    local condition = createConditionObject(CONDITION_REGENERATION)
    setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
    setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
    setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
    setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
    setCombatCondition(combat, condition)

    function magicEffect(tempo2,tempo3,cid)
    if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
    for i=1, #effect do
    local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
    doSendMagicEffect(position, effect)
    end
    end
    end
    end

    function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    setPlayerStorageValue(cid, 91838, os.time() + tempo)
    tempo2 = 0
    while (tempo2 ~= (tempo*1000)) do
    addEvent(magicEffect, tempo2, tempo2, tempo*1000, cid)
    tempo2 = tempo2 + 300
    end
    setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado.
    else
    doPlayerSendCancel(cid, "Voce ja esta com Buff.")
    end
    end

     

     

     

    EXIVA:

     

     

    function onCastSpell(cid, var)
    local mana = getCreatureMana(cid)
    if not getCreatureCondition(cid, CONDITION_ATTRIBUTES) or getPlayerStorageValue(cid, 91838) < os.time() then
    return doPlayerSendCancel(cid, "Voce prescisa esta com MELODIA ativada.")
    end
    if getCreatureTarget(cid) == nil or not getCreatureTarget(cid) or getCreatureTarget(cid) == 0 then
    doPlayerSendCancel(cid, "Voce precisa de um alvo.")
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    return false
    end
    if isCreature(getCreatureTarget(cid)) then
    doPlayerAddMana(cid, -mana)
    doCreatureAddHealth(getCreatureTarget(cid), -mana)
    doSendDistanceShoot(getThingPos(cid), getThingPos(getCreatureTarget(cid)), 13)
    doSendMagicEffect(getThingPos(getCreatureTarget(cid)), 49)
    end
    return true
    end

     

     

  4. so prescisa modificar o creaturescripts para nao ganhar os points:

    local config = {
        repeatAfterDeath = false,
        points = 5,
        storage = 14005,
        vocations = {1,2,3}, -- IDs das vocation que poderao ganhar points.
    } 
    
    function onAdvance(cid, skill, oldlevel, newlevel) 
        if skill ~= SKILL__LEVEL or (not config.repeatAfterDeath and getPlayerStorageValue(cid, config.storage) >= newlevel) then return true end
        if not isInArray(config.vocations, getPlayerVocation(cid)) then return true end
        doShowTextDialog(cid, 0, "Voce recebeu 5 points.  \n  Va ao dumbledore para trocar seus pontos.")
        addPoints(cid, config.points)
        setPlayerStorageValue(cid, config.storage, newlevel)
        return true
    end
    
  5. Fiz um aqui, mas foi meio corrido e nao testei:

     

     

    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 talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid


    local config = {
    vocations = {1}, -- IDs das vocation que poderao resetar, caso mais de 1, adicionar virgulas dentro da tabela
    minLevel = 100, -- level minimo para resetar
    newLevel = 5, -- level após reset
    newVoc = 2, -- ID da vocation que ira ganhar ao resetar
    maxResets = 1, -- máximo de resets
    storage = 1020, -- storage do reset
    outfit = 229, -- outfit que ira ganhar ao resetar
    }


    if msgcontains(msg, "resetar") then
    if not isInArray(config.vocations, getPlayerVocation(cid)) then
    selfSay("Voce nao pode resetar.", cid)
    return true
    end
    if getPlayerStorageValue(cid,config.storage) < config.maxResets then
    selfSay("Voce deseja resetar seu char?", cid)
    talkState[talkUser] = 1
    else
    selfSay("Você nao pode resetar mais!", cid)
    end

    elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
    selfSay("Ok.", cid)
    talkState[talkUser] = 0

    elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
    if getPlayerLevel(cid) >= config.minLevel then
    if getPlayerStorageValue(cid,config.storage) < 0 then
    setPlayerStorageValue(cid,config.storage,1)
    else
    setPlayerStorageValue(cid,config.storage,getPlayerStorageValue(cid,config.storage)+1)
    end
    doCreatureChangeOutfit(cid, {lookType = config.outfit})
    doPlayerSetVocation(cid, config.newVoc)
    npcHandler:releaseFocus(cid)
    local GUID = getPlayerGUID(cid)
    doRemoveCreature(cid)
    db.executeQuery("UPDATE players SET level = "..config.newLevel.." WHERE id = "..GUID)
    else
    selfSay("O level minimo necessario para resetar é "..config.minLevel.."!", cid)
    end
    end

    return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())

     

     

  6. Vá em data/actions/scripts e crie um arquivo .lua qualquer e cole isto dentro:

    local config = {
        item1 = {XXXX, 2000}, -- {ID DO ITEM, QUANTIDADE QUE VAI ALMENTAR DE HEALTH}
        item2 = {XXXX, 2000}, -- {ID DO ITEM, QUANTIDADE QUE VAI ALMENTAR DE MANA}
    }
    
    function onUse(cid, item, frompos, item2, topos)
        if item.itemid == config.item1[1] then
            if getPlayerStorageValue(cid,12345) < 1 then
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + config.item1[2])
                setPlayerStorageValue(cid,12345,1)
                doRemoveItem(item.uid)
            else
                return doPlayerSendCancel(cid, "You can't use this item again.")
            end
    
        elseif item.itemid == config.item2[1] then
            if getPlayerStorageValue(cid,12346) < 1 then
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + config.item2[2])
                setPlayerStorageValue(cid,12346,1)
                doRemoveItem(item.uid)
            else
                return doPlayerSendCancel(cid, "You can't use this item again.")
            end
        end
        return true
    end
    

    agora so adicionar essas tags em actions.xml:

    <action itemid="ID DO ITEM1" event="script" value="NOME DO ARQUIVO.lua"/>
    <action itemid="ID DO ITEM2" event="script" value="NOME DO ARQUIVO.lua"/>
    

    OBS: nao testei

  7. isso vai ser necessario alteraçao na spell de buff entao farei os 2 scripts.

     

    Primeiro vá em data/spells/scripts e crie um arquivo .lua com nome Buff.lua e cole isto dentro:

     

     

    local config = {
    tempo = 60, -- tempo de duraçao do buff em segundos
    effect = {10}, -- efeito do buff, caso mais de 1, adicionar virgulas dentro da tabela
    timer = 300, -- loop de tempo em milisegundos para soltar efeito
    }

    local condition_config = {
    magic = 30, -- quantos que ira almentar de Magic Level
    fist = 30, -- quantos que ira almentar de Fist
    sword = 30, -- quantos que ira almentar de Sword
    axe = 30, -- quantos que ira almentar de Axe
    club = 30, -- quantos que ira almentar de Club
    distance = 30, -- quantos que ira almentar de Distance
    shield = 30, -- quantos que ira almentar de Shield
    }

    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, config.tempo*1000)
    setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, condition_config.magic)
    setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, condition_config.fist)
    setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, condition_config.sword)
    setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, condition_config.axe)
    setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, condition_config.club)
    setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, condition_config.distance)
    setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, condition_config.club)
    setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
    setCombatCondition(combat, condition)

    local function Buff(cid)
    if isCreature(cid) and getCreatureCondition(cid, CONDITION_ATTRIBUTES) == true then
    for i=1, #config.effect do
    local position = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
    doSendMagicEffect(position, config.effect)
    end
    end
    end

    function onCastSpell(cid, var)
    if getCreatureCondition(cid, CONDITION_ATTRIBUTES) == false then
    if exhaustion.check(cid, 12345) == false then
    doCombat(cid, combat, var)
    local check = 0
    while check <= config.tempo*1000 do
    addEvent(Buff, check, cid)
    check = check + config.timer
    end
    else
    return doPlayerSendCancel(cid, "You are exhausted.") and false
    end
    else
    return doPlayerSendCancel(cid, "Sorry, you are transformed.") and false
    end
    return true
    end

     

     

    agora crie um chamado Remove buff.lua e cole isto dentro:

     

     

    local config = {
    cid_time = 10, -- tempo em segundos que o usuario vai ficar com exhausted.
    target_time = 10, -- tempo em segundos que o oponente vai ficar com exhausted.
    }

    function onCastSpell(cid, var)
    if not isPlayer(getCreatureTarget(cid)) then
    return doPlayerSendCancel(cid, "Only target players.") and false
    end
    if exhaustion.check(cid, 12346) == false then
    doRemoveCondition(getCreatureTarget(cid), CONDITION_ATTRIBUTES)
    exhaustion.set(getCreatureTarget(cid), 12345, config.target_time)
    exhaustion.set(cid, 12346, config.cid_time)
    else
    return doPlayerSendCancel(cid, "You are exhausted.") and false
    end
    return true
    end

     

     

     

    agora so adiocionar as tags em spells.xml e editar a gosto:

    <instant name="MAGIA DO BUFF" words="MAGIA DO BUFF" lvl="LEVEL" mana="MANA" prem="0" aggressive="0" exhaustion="0" needlearn="0" blockwalls="1" enabled="1" event="script" value="Buff.lua">
    <vocation id="ID"/>
    </instant>
    
    <instant name="REMOVE BUFF" words="REMOVE BUFF" lvl="LEVEL" mana="MANA" prem="0" needtarget="1" range="5" aggressive="0" exhaustion="0" needlearn="0" blockwalls="1" enabled="1" event="script" value="Remove buff.lua">
    <vocation id="ID"/>
    </instant>
    

    OBS: nao sao necessarios adicionar o exhausted nas tags.

  8. O doDecayItem(item) serve para dar um "start" no tempo do item, tenta usar ele mesmo, vai ficar mais ou menos assim:

    local item = doCreateItem(math.random(2016, 2021), 2, {x = pos.x - 1, y = pos.y , z = pos.z, stackpos=1})
    doDecayItem(item)
    
  9. 
    

    <item id="2202" article="a" name="stealth ring">

    <attribute key="weight" value="100" />

    <attribute key="slotType" value="ring" />

    <attribute key="decayTo" value="0" />

    <attribute key="transformDeEquipTo" value="2165" />

    <attribute key="duration" value="600" />

    <attribute key="showduration" value="1" />

    <attribute key="invisible" value="1" />

    <attribute key="showattributes" value="1" />

    </item>

  • Quem Está Navegando   0 membros estão online

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