Ir para conteúdo

Featured Replies

Postado

 

  Citar

como posso fazer com que uma arma execulte esse script 

 

function onCastSpell(cid, var)
  	local target = getCreatureTarget(cid)
	local NumberOfHits = 1
	local value = getCreatureMaxMana(target)*0.20 -- 0.20 representa a 20% da mana total do seu target
    local restoremana = "false"

	if isMonster(target)then
		return false
	end


	for x=1,NumberOfHits do
		if isPlayer(target) then
			doCreatureAddMana(target, -value)
      		if restoremana == "true" then
      			doCreatureAddMana(cid, value)
        	end
		end
	end
  	return true
end

e se possivel tem como mandar uma script(spell) que gera x item

 

  • Respostas 13
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

function onUseWeapon(cid, var)
        local target = getCreatureTarget(cid)
        local NumberOfHits = 1
        local value = getCreatureMaxMana(target)*0.20 -- 0.20 representa a 20% da mana total do seu target


    local restoremana = "false"

    if isMonster(target)then
        return false
    end


    for x=1,NumberOfHits do
        if isPlayer(target) then
            doCreatureAddMana(target, -value)
              if restoremana == "true" then
                  doCreatureAddMana(cid, value)
            end
        end
    end
      return true
end

 

-------------------------------------------------------------------------------

 

Não testei

 

 

Postado
  • Autor
  Em 19/09/2019 em 16:29, mardenzaro disse:

function onUseWeapon(cid, var)
        local target = getCreatureTarget(cid)
        local NumberOfHits = 1
        local value = getCreatureMaxMana(target)*0.20 -- 0.20 representa a 20% da mana total do seu target


    local restoremana = "false"

    if isMonster(target)then
        return false
    end


    for x=1,NumberOfHits do
        if isPlayer(target) then
            doCreatureAddMana(target, -value)
              if restoremana == "true" then
                  doCreatureAddMana(cid, value)
            end
        end
    end
      return true
end

 

-------------------------------------------------------------------------------

 

Não testei

 

 

 

no caso quando atacar ele vai roubar a mana?

 

onde add esse script?

funcionou mais como

  Em 19/09/2019 em 16:29, mardenzaro disse:

function onUseWeapon(cid, var)
        local target = getCreatureTarget(cid)
        local NumberOfHits = 1
        local value = getCreatureMaxMana(target)*0.20 -- 0.20 representa a 20% da mana total do seu target


    local restoremana = "false"

    if isMonster(target)then
        return false
    end


    for x=1,NumberOfHits do
        if isPlayer(target) then
            doCreatureAddMana(target, -value)
              if restoremana == "true" then
                  doCreatureAddMana(cid, value)
            end
        end
    end
      return true
end

 

-------------------------------------------------------------------------------

 

Não testei

 

 

 

funcionou mais como posso botar um script de ataque nele? tipo 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

function onUseWeapon(cid, var)
    local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+0, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
    doSendMagicEffect(position1, 136)
    return doCombat(cid, combat, var)
end

Postado

@kido omega testa
 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area = createCombatArea({
	{0, 0, 0},
	{0, 3, 0},
	{0, 0, 0}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
local target = getThingPosition(getCreatureTarget(cid))
local pos = {x=target.x+0, y=target.y+0, z=target.z+0}
doSendMagicEffect(pos, 670)

        local target2 = getCreatureTarget(cid)
        local NumberOfHits = 1
        local value = getCreatureMaxMana(target2)*0.20 -- 0.20 representa a 20% da mana total do seu target


    local restoremana = "false"

    if isMonster(target2)then
        return false
    end


    for x=1,NumberOfHits do
        if isPlayer(target) then
            doCreatureAddMana(target, -value)
              if restoremana == "true" then
                  doCreatureAddMana(cid, value)
            end
        end
    end
	return doCombat(cid, combat, var)
end

 

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Postado
  Em 19/09/2019 em 18:23, LeoTK disse:

@kido omega testa
 


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area = createCombatArea({
	{0, 0, 0},
	{0, 3, 0},
	{0, 0, 0}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
local target = getThingPosition(getCreatureTarget(cid))
local pos = {x=target.x+0, y=target.y+0, z=target.z+0}
doSendMagicEffect(pos, 670)

        local target2 = getCreatureTarget(cid)
        local NumberOfHits = 1
        local value = getCreatureMaxMana(target2)*0.20 -- 0.20 representa a 20% da mana total do seu target


    local restoremana = "false"

    if isMonster(target2)then
        return false
    end


    for x=1,NumberOfHits do
        if isPlayer(target) then
            doCreatureAddMana(target, -value)
              if restoremana == "true" then
                  doCreatureAddMana(cid, value)
            end
        end
    end
	return doCombat(cid, combat, var)
end

 

 

acho que ele quer saber onde vai as tags 

Jamais se desespere em meio as sombrias afeiçoes da sua vida, pois das nuvens mais negras cai água límpida e fecunda

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo