Ir para conteúdo

Featured Replies

Postado

Olá!

 

Estou precisando de uma ajuda! Baixei um mapa de FoxWorld para pegar o script de gemas, mas preciso de uma ajuda para configura-lo... 

 

O script atualmente faz o seguinte:

 

 

Funciona da seguinte maneira:

Quando você chega ao lvl 200, você pode dar use em um determinado crystal do mapa que te dará a gema (só pode absorver uma vez e quando gastar pode absorver denovo)... A gema é uma magia (uma pra cada vocação) com um dano bem alto, em sqm aleatorios de uma determinada area (6x6) além disso, quando você adquire a gema uma "aura" começa a sair de você:

 

Dito isto já da pra ter uma noção, basicamente é o que o script do FoxWolrd faz, pra quem entende... Eu gostaria que ele funcionasse da seguinte maneira:

 

 

Não precise de level para usar a gema. Continua precisando dar use em um cristal para conseguir as gemas. Só pode absorver uma vez, mas ela não gasta, usou uma vez fica pra sempre e não pode absorver mais. A magia pode continuar sendo da mesma maneira, porém sem sqm aleatórios, sim, irá ficar do mesmos efeitos e tal, mas sem sqm aleatórios, seria basicamente um "exevo gran mas tera" só que com novos efeitos, e também após usar a magia NÃO irá sair o efeito de gema como dito antes, continuará para sempre e sempre podendo usar a magia. A aura continua a mesma.

 

PS: Gostaria de pedir uma ultima modificação: Quando um kinght, um paladin, um druid e um sorcerer usar as gemas, elas darão um bônus configurável de regeneração de vida e mana.

 

 

Dito isto irei postar os scripts:

 

 

 

creaturescripts\scripts\login.lua:
adicionar antes do ultimo return true:

if getPlayerStorageValue(cid, 21202) > 0 then
            local voc = getPlayerVocation(cid)
            if getPlayerPromotionLevel(cid) > 0 then
              voc = voc - (getPlayerPromotionLevel(cid) * 4)
            end
            if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
                  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
            end   
      end   

 

 

actions.xml:

			  <!--GEMAS-->
        <action uniqueid="5478" script="gems.lua"/>
        <action itemid="8634" script="gems.lua" />
        <action itemid="8636" script="gems.lua" />
        <action itemid="8635" script="gems.lua" />
        <action itemid="8633" script="gems.lua" />

actions\scripts\gems.lua:

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerGroupId(cid) > 2 and getPlayerGroupId(cid) < 5 then return true end

  local voc = getPlayerVocation(cid)
  if getPlayerPromotionLevel(cid) > 0 then
     voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end
  gem = gems.id[voc]

  if item.itemid == gem then

          if getPlayerLevel(cid) < 200 then
          doPlayerSendTextMessage(cid,22,"É necessário level 200 ou maior para absorver uma gema espiritual!")
          else

                if getPlayerPromotionLevel(cid) > 0 then

                      if getPlayerStorageValue(cid,21202) == -1 then
                      setPlayerStorageValue(cid,21202,1)
                      doUseGem(cid, item)
                      doPlayerSendTextMessage(cid,22,"Você absorveu uma gema espiritual!")
                      doSendMagicEffect(getPlayerPosition(cid),65)
                      else
                      doPlayerSendTextMessage(cid,22,"Você ainda possui uma gema espiritual absorvida.")
                      end

                else
                doPlayerSendTextMessage(cid,22,"Você precisa estar promovido para usar a gema.")
                end
 
          end

  else
  return false
  end
  return true
  end 

 

data\lib\047 - Gems.lua:
gems = {
id = {8635, 8636, 8633, 8634, 8635, 8636, 8633, 8634, 8635, 8636, 8633, 8634},
storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012},
interval = {600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600}
}

gemMsg = {
rnd = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ´ ."},
colorDruid = {180,180},
colorSorcerer = {30,215},
colorPaladin = {251,10},
colorKnight = {204,212},
colorElderDruid = {180,180},
colorMasterSorcerer  = {30,215},
colorRoyalPaladin = {251,10},
colorEliteKnight = {204,212}
}

function doRemoveGemEffect(cid)

  local voc = getPlayerVocation(cid)

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end

  if getPlayerStorageValue(cid, gems.storage[voc]) == -1 then
  else
    setPlayerStorageValue(cid, gems.storage[voc], 0)
  end

end

function doUseGem(cid, item)

  local level = getPlayerLevel(cid)
  local voc = getPlayerVocation(cid)
  local interval = gems.interval[voc]

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end

  if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return false
  end

  setPlayerStorageValue(cid, gems.storage[voc], 1)
  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
  doRemoveItem(item.uid, 1)

  return true 
end

function sendGemEffect(cid, storage, interval)

if isPlayer(cid) then

  local pos = getThingPos(cid)
  local voc = getPlayerVocation(cid)
  local level = getPlayerLevel(cid)
  local color = 1

  if level > 199 then

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end
          if voc == 1 then
            color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)]
          elseif voc == 2 then
            color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)]
          elseif voc == 3 then
            color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)]
          elseif voc == 4 then
            color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)]
          end

  doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color)
    if getPlayerStorageValue(cid, gems.storage[voc]) >= 1 then 
      addEvent(sendGemEffect, interval, cid, storage, interval)
    end

else
stopEvent(sendGemEffect(cid, storage, interval))
end

end

function doRemoveAllGemEffect(cid)
  for i = 1, table.maxn(gms.storage) do
    setPlayerStorageValue(cid, gems.storage[i], 0)
  end
  return true
end

function isGemActivated(cid)

  local voc = getPlayerVocation(cid)

  if getPlayerPromotionLevel(cid) > 0 then
    voc = voc - (getPlayerPromotionLevel(cid) * 4)
  end

  if getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return true
  end
  return false
end

  return true
end


 

spells.xml:

<instant name="Gema de Sorc" words="zesshou hachimon" lvl="200" prem="0" selftarget="0" exhaustion="900" needlearn="0" script="vip/Gema Sorc.lua">
                <vocation name="Master Sorcerer"/>
        </instant>
	<instant name="Gema de Druid" words="jukai kousan" lvl="200" prem="0" selftarget="0" exhaustion="900" needlearn="0" script="vip/Gema Druid.lua">
                <vocation name="Elder Druid" />
        </instant>
	<instant name="Gema de Pala" words="mugen shiki" lvl="200" prem="0" selftarget="0" exhaustion="900" needlearn="0" script="vip/Gema Pala.lua">
                <vocation name="Royal Paladin"/>
        </instant>
	<instant name="Gema de Kina" words="yahumuki" lvl="200" prem="0" selftarget="0" exhaustion="900" needlearn="0" script="vip/Gema Kina.lua">
                <vocation name="Elite Knight"/>
        </instant>	
	

data\spells\scripts\vip\Gema Druid.lua:

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_BIGPLANTS)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -3.5, -175, -5.5, -175)

local stun = createConditionObject(CONDITION_POISON)
setConditionParam(stun, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
addDamageCondition(stun, 1, 3000, -700)
setCombatCondition(meteor, stun)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_BIGPLANTS)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -3.5, -175, -5.5, -175)

combat_arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

function onTargetTile(cid, pos)
    if (math.random(0, 1) == 1) then
        local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
        if (isInArray(water, ground.itemid) == TRUE) then
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_EARTH)
            addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
        else
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos,CONST_ANI_EARTH)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)

local mana = 2400
local cmana = getCreatureMana(cid)

if cmana >= mana then
    if getPlayerStorageValue(cid, 21202) == 1 then
      doCreatureAddMana(cid, -mana)
      doRemoveGemEffect(cid)
      setPlayerStorageValue(cid, 21202, -1)
      return doCombat(cid, combat, var)
    else
      doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "Você precisa absorver uma gema espiritual para usar essa magia.")
      return false
    end
  else
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
 doPlayerSendCancel(cid, "Você não possui mana suficiente.")
return false
  end
end

data\spells\scripts\vip\Gema Kina.lua:

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,46424643,4644,4645,4646,4647,4648,4649,4650}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 44)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -5.5, -550, -4.5, -400)

local stun = createConditionObject(CONDITION_PARALYZE)
setConditionParam(stun, CONDITION_PARAM_TICKS, 5000)
setConditionFormula(stun, -0.8, 0, -0.9, 0)
setCombatCondition(meteor, stun)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 44)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -5.5, -550, -4.5, -400)

combat_arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

function onTargetTile(cid, pos)
    if (math.random(0, 1) == 1) then
        local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
        if (isInArray(water, ground.itemid) == TRUE) then
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_LARGEROCK)
            addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
        else
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_LARGEROCK)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local mana = 0.90
local cmana = getCreatureMana(cid)

if cmana >= mana then
    if getPlayerStorageValue(cid, 21202) == 1 then
      doCreatureAddMana(cid, -(mana * getCreatureMaxMana(cid)))
      doRemoveGemEffect(cid)
      setPlayerStorageValue(cid, 21202, -1)
      return doCombat(cid, combat, var)
    else
      doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "Você precisa absorver uma gema espiritual para usar essa magia.")
      return FALSE
    end
  else
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
 doPlayerSendCancel(cid, "Você não possui mana suficiente.")
return FALSE
  end
end

data\spells\scripts\vip\Gema Pala.lua:

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -5.5, -35, -3.1, -325)

local stun = createConditionObject(CONDITION_ENERGY)
setConditionParam(stun, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
addDamageCondition(stun, 1, 3000, -400)
setCombatCondition(meteor, stun)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -5.5, -35, -3.1, -325)

combat_arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

function onTargetTile(cid, pos)
    if (math.random(0, 1) == 1) then
        local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
        if (isInArray(water, ground.itemid) == TRUE) then
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_HOLY)
            addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
        else
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_HOLY)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local mana = 0.60
local cmana = getCreatureMana(cid)

if cmana >= mana then
    if getPlayerStorageValue(cid, 21202) == 1 then
      doCreatureAddMana(cid, -(mana * getCreatureMaxMana(cid)))
      doRemoveGemEffect(cid)
      setPlayerStorageValue(cid, 21202, -1)
      return doCombat(cid, combat, var)
    else
      doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "Você precisa absorver uma gema espiritual para usar essa magia.")
      return FALSE
    end
  else
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
 doPlayerSendCancel(cid, "Você não possui mana suficiente.")
return FALSE
  end
end

data\spells\scripts\vip\Gema Sorc.lua:

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -6.0, -40, -3.4, -450)

local stun = createConditionObject(CONDITION_PARALYZE)
setConditionParam(stun, CONDITION_PARAM_TICKS, 5000)
setConditionFormula(stun, -0.8, 0, -0.9, 0)
setCombatCondition(meteor, stun)


local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -6.0, -40, -3.4, -450)

combat_arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

function onTargetTile(cid, pos)
    if (math.random(0, 1) == 1) then
        local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
        if (isInArray(water, ground.itemid) == TRUE) then
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_SUDDENDEATH)
            addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
        else
            local newpos = {x = pos.x - 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_SUDDENDEATH)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local mana = 3200
local cmana = getCreatureMana(cid)

if cmana >= mana then
    if getPlayerStorageValue(cid, 21202) == 1 then
      doCreatureAddMana(cid,-mana)
      doRemoveGemEffect(cid)
      setPlayerStorageValue(cid, 21202, -1)
      return doCombat(cid, combat, var)
    else
      doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "Você precisa absorver uma gema espiritual para usar essa magia.")
      return FALSE
    end
  else
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
 doPlayerSendCancel(cid, "Você não possui mana suficiente.")
return FALSE
  end
end


 

 

 

PS²: Peguei esses scripts já postados neste tópico, quem postou foi o xWhiteWolf, créditos pela separação dos scripts e esse "PS" acima são dele.

 

Bom, é isso. Se alguém puder me ajudar...  :hum:  ;D 

Editado por NathanAmaro (veja o histórico de edições)

Oi

  • Respostas 9
  • Visualizações 412
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Muda essa parte: if level > 199 then  De 199 para 0, ou tira a linha e elimina o segundo END que aparecer de cima para baixo (Contando da linha removida)...             Tira essas

Postado

Não precise de level para usar a gema.

 

Muda essa parte:

  if level > 199 then

 De 199 para 0, ou tira a linha e elimina o segundo END que aparecer de cima para baixo (Contando da linha removida)...

 

 

Continua precisando dar use em um cristal para conseguir as gemas. Só pode absorver uma vez, mas ela não gasta, usou uma vez fica pra sempre e não pode absorver mais.
 

 

e também após usar a magia NÃO irá sair o efeito de gema como dito antes, continuará para sempre e sempre podendo usar a magia. A aura continua a mesma.
 

 

Tira essas linhas, de todas as magias:

setPlayerStorageValue(cid, 21202, -1)
doRemoveGemEffect(cid)

(Não precisa excluir a função !) 

 

 

 


 

 

 

Só não entendi o aleatório, como é ?

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor
Só não entendi o aleatório, como é ?   

 

Assim: Quando o player convoca a magia ela pode hitar em sqms aleatórios cada vez que usa, não atinge sempre os mesmos sqms, cada vez que usa atinge sqms diferentes...

Oi

Postado

To indo dormir...

tenta tirar:

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

Se der merda, coloca de volta...

depois eu dou uma olhada melhor...

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

To indo dormir...

tenta tirar:

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

Se der merda, coloca de volta...

depois eu dou uma olhada melhor...

 

Ok. Obrigado!

To indo dormir...

tenta tirar:

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

Se der merda, coloca de volta...

depois eu dou uma olhada melhor...

 

Não deu certo!

Editado por NathanAmaro (veja o histórico de edições)

Oi

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