Ir para conteúdo
  • 0

Edição em spell de premium


bernardes22

Pergunta

Bom Dia Xtibia!!!



eu estou com uma grande dificuldade para editar essa magia, Nesse Script contem 2 spells, Spells Free,


e Spells Vip, Sendo que a spells free basta o player compra promotion que o player poderá usar a magia, e a vip o player terá que fazer uma quest e assim que ele termina de mata o monstro a magia ira involuir para VIP, eu queria que a Vip não fosse ativa pela quest, mais sim quando adquirisse Premium Account alguém poderia editar pra mim por favor? to a 2 dias tentando fazer isso infelizmente não estou conseguindo :sad:



Aqui esta o script, nome da spells = Housenka




local config =
{
seconds = 10,
storage = 10,
msg = "Você precisa aguardar %d segundos para usar essa magia novamente.",
mana = 2400,
semMana = "Você não tem mana suficiente.",
}


local function useAgain(cid)
setPlayerStorageValue(cid, config.storage, 2)
return TRUE
end


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat10 = createCombatObject()
setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat10, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.8, -32)


local combat20 = createCombatObject()
setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat20, COMBAT_PARAM_EFFECT, 43)
setCombatFormula(combat20, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.9, -32)


arr1 = {
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 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
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
arr20 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
}


local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area10 = createCombatArea(arr10)
local area20 = createCombatArea(arr20)


setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat10, area10)
setCombatArea(combat20, area20)


function onCastSpell(cid, var)
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, os.time()-config.seconds)
end
if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then
doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage))))
return true
end
if getPlayerMana(cid) >= config.mana then
doPlayerAddMana(cid, -config.mana)
setPlayerStorageValue(cid, config.storage, os.time())
if getPlayerStorageValue(cid, 10007) >= 1 then
addEvent(doCombat, 000, cid, combat1, var)
addEvent(doCombat, 600, cid, combat2, var)
else
addEvent(doCombat, 000, cid, combat10, var)
addEvent(doCombat, 700, cid, combat20, var)
end
else
doPlayerSendCancel(cid, config.semMana)
doSendMagicEffect(getPlayerPosition(cid),2)
end
return true
end

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

 

 

local config =
 {
  seconds = 10,
   storage = 10,
  msg = "Você precisa aguardar %d segundos para usar essa magia novamente.",
  mana = 2400,
  semMana = "Você não tem mana suficiente.",
}


local function useAgain(cid)
 setPlayerStorageValue(cid, config.storage, 2)
 return TRUE
end


local combat1 = createCombatObject()
 setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat1, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat2 = createCombatObject()
 setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat2, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat10 = createCombatObject()
 setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat10, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.8, -32)


local combat20 = createCombatObject()
 setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat20, COMBAT_PARAM_EFFECT, 43)
setCombatFormula(combat20, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.9, -32)


arr1 = {
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0,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},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
}


local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area10 = createCombatArea(arr10)
local area20 = createCombatArea(arr20)


setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat10, area10)
setCombatArea(combat20, area20)


function onCastSpell(cid, var)
  if getPlayerStorageValue(cid, config.storage) == -1 then
    setPlayerStorageValue(cid, config.storage, os.time()-config.seconds)
  end
  if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then
    doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage))))
    return true
  end
  if getPlayerMana(cid) >= config.mana then
    doPlayerAddMana(cid, -config.mana)
    setPlayerStorageValue(cid, config.storage, os.time())
      if isPremium(cid) then
        addEvent(doCombat, 000, cid, combat1, var)
        addEvent(doCombat, 600, cid, combat2, var)
      else
        addEvent(doCombat, 000, cid, combat10, var)
        addEvent(doCombat, 700, cid, combat20, var)
      end
  else
doPlayerSendCancel(cid, config.semMana)
              doSendMagicEffect(getPlayerPosition(cid),2)
  end
  return true
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

 

 

local config =
 {
  seconds = 10,
   storage = 10,
  msg = "Você precisa aguardar %d segundos para usar essa magia novamente.",
  mana = 2400,
  semMana = "Você não tem mana suficiente.",
}


local function useAgain(cid)
 setPlayerStorageValue(cid, config.storage, 2)
 return TRUE
end


local combat1 = createCombatObject()
 setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat1, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat2 = createCombatObject()
 setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat2, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.2, -150, -4.6, -250)


local combat10 = createCombatObject()
 setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat10, COMBAT_PARAM_EFFECT, 52)
setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.8, -32)


local combat20 = createCombatObject()
 setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
 setCombatParam(combat20, COMBAT_PARAM_EFFECT, 43)
setCombatFormula(combat20, COMBAT_FORMULA_LEVELMAGIC, -3.6, -32, -3.9, -32)


arr1 = {
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0,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10)
local area20 = createCombatArea(arr20)


setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat10, area10)
setCombatArea(combat20, area20)


function onCastSpell(cid, var)
  if getPlayerStorageValue(cid, config.storage) == -1 then
    setPlayerStorageValue(cid, config.storage, os.time()-config.seconds)
  end
  if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then
    doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage))))
    return true
  end
  if getPlayerMana(cid) >= config.mana then
    doPlayerAddMana(cid, -config.mana)
    setPlayerStorageValue(cid, config.storage, os.time())
      if isPremium(cid) then
        addEvent(doCombat, 000, cid, combat1, var)
        addEvent(doCombat, 600, cid, combat2, var)
      else
        addEvent(doCombat, 000, cid, combat10, var)
        addEvent(doCombat, 700, cid, combat20, var)
      end
  else
doPlayerSendCancel(cid, config.semMana)
              doSendMagicEffect(getPlayerPosition(cid),2)
  end
  return true
end

 

 

 

 

Meu Heroi <3 kkk teria como me mostra a linha que foi editado para que eu possa fazer nas outras magias?

Link para o comentário
Compartilhar em outros sites

  • 0
if getPlayerStorageValue(cid, 10007) >= 1 then

para

if isPremium(cid) then

Vejo que tem interesse em aprender, vou criar uma escolinha de scripting aqui no fórum, se quiser participar, será bem-vindo.

Em breve eu vou postar o tópico explicando.

Link para o comentário
Compartilhar em outros sites

  • 0

Tópico Movido
Este tópico foi movido de "OTServScriptingDownloads Scripts"
para "OTServScriptingSuporte Scripting".

 

 


Desculpa o off topic ,mais eu sou voluntario em ser aluno professor Caronte. :XTibia_smile:

 

Haha, só esperar mais um tempinho que vou postar um tópico já pronto, de como será o esquema.


@@bernardes22, Você postou 2 vezes o mesmo tópico, Double post é proibido no fórum.

É permitido dar @UPs diários no tópico, para evitar esse tipo de inconveniência.

 

 

Se o tópico foi resolvido clique em Resolvido no post que resolveu seu pedido.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...