Ir para conteúdo
  • Cadastre-se

TFS 0.3.6 {Pedido} Modificação em Script


Posts Recomendados

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

Link para o post
Compartilhar em outros sites

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

Link para o post
Compartilhar em outros sites
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

Link para o post
Compartilhar em outros sites

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

Link para o post
Compartilhar em outros sites

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

Link para o post
Compartilhar em outros sites

Mas e os outros que eu falei...?

qual deu certo ?

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

Link para o post
Compartilhar em outros sites

Humm..., poisé, eu não tinha muita fé não...

era só um palpite bobo, e em seguida eu fui dormir, agora cá estou indo de novo...

 

mas se ninguém ver achar, eu tento depois do almoço...

vou passar o olho mais uma vez...

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

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por hekan19
      Olá pessoal,
       
      Estou com um problema no sistema de autoloot.
      Ao abrir um Pokémon, itens aparecem no chão. Recebo "0" no console do TFS.
       
      Obrigado pela ajuda
    • Por wallaceg15
      Sempre que mato o poke, cai um corpinho e o pokemon continua vivo, e aparece esse erro na distro... Alguém poderia me ajudar? 
       
      [Error - CreatureScript Interface]
      data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
      Description:
      data/lib/towerSystem.lua:931: attempt to index global 'magmaTP2' (a nil value)
      stack traceback:
              data/lib/towerSystem.lua:931: in function 'doKillBossTower'
              data/lib/Death System.lua:599: in function 'doKillWildPoke'
              data/creaturescripts/scripts/player/statsChange.lua:1461: in function <data/creaturescripts/scripts/player/statsChange.lua:6>
      statsChange.lua towerSystem.lua Death System.lua
    • Por NathanAmaro
      Olá!
       
      Estou precisando de algum script, ou algum jeito de quando o player comprar premium account (isPremium) ele receber a promotion junto.
      A premium é fornecida por um npc, então eu quero que quando o jogador compre a premium account a promotion venha junto. Sendo assim:
       
      Um knight vire um Elite knight 
      Um druid vire um Elder druid
      Um sorcerer vire um Master sorcerer
      um paladin vire um Royal paladin
       
      Script do npc:
       



       
      Agradeço a atenção!   
    • Por GamerGoiano
      Me mandaram esse servidor e eu decidi deixar ele jogável porque muita gente tinha dificuldade em deixar online.
      Como deixar online:
      Basta criar um banco de dados com o xampp (use o xampp mais recente), com o nome poketibia e do lado onde está utf, escolhe Agrupamento (Colation) após isso é só importar o banco de dados que ta junto com o servidor.
      Ai é só abrir o servidor, esperar carregar e depois abrir o cliente e logar 
      Conta god: GOD / 123456
      Download: https://www.mediafire.com/file/3atv44omlf3f036/PokeAimar.rar/file
      Vem com Sources e SPR+Dat Editável
      Scan: https://www.virustotal.com/gui/file/828a6e443c29221b9cd46f3fffe5f65c63bbb8e8ffc109a4fc91554d9c10e752/detection
      Créditos: Kaboflow, PDA, Psoul, Pstorm, Gengo, TFS Team, Cipsoft, DxP, PokemasterX.
      É um mistão de scripts do fórum + scripts próprios, acima listados os responsáveis pela criação do datapack e servidor.
      Descrição:
      Level System 100%
      1ª e 2ª geração completos
      Kanto e Ilhas Laranjas 100%
      Tv System 100%
      (Techinical Machine) Ensinar Moves pros Pokes 100%
      Daycare e Egg System 100%
      Duel System (PVP) 100%
      Gym System 100%
      Berries (Plantar, Colher e Usar) 100%
      Fly, Surf, Ride, Dive e Headbutt 100%
      Mastery System (Especializar em Elemento) 100%
      Tournament System 100%
      Saffari Zone 100%
      Poke Balls Effects 100%
      Pokemons na Character List 100%
      Poke Bar 100%
      Atravessar seu pokemon 100%
      Relógio In-Game 100%
      New Pokedex 100%
       



       
    • Por L3K0T
      L3K0TTFS 04 e TFS 0.3.6
      Olá galera, hoje vim trazer um sistema chamado "First to Speak Summon" mais pera ai L3K0T, como funciona? Bom ele sumonar um monstro numa posição setada por sua preferencia, também verifica uma posxyz que você pode setar também e assim falar o comando "!fss"... mais pera ai L3K0T oque tem de diferente??? ... calma ... esse comando só pode ser pronunciado por 1 player somente, no caso se alguém falar o comando depois de você... não irá sumonar até que o tempo pra falar novamente acabe "configurado" e BORA PRO TUTORIAL???
       
       
      TUTORIAL;;
       
      1° vai na pasta Servidor\data\talkactions\scripts copia um arquivo.lua e renomeia para fss e dentro coloque;;
       
      local t = { sto = 565674, --Storage global; temp = 300, --Tempo para falar em milesimo 300 = 5 minutos // segundos o comando; monstro = "Demon", --Nome monstrinho que vá nascer; localmapa = {x=1569, y=214, z=7}, --Posição aonde o monstrinho vai nascer; pisomapa = {x=1565, y=215, z=7}, --Posição aonde o player precisa estar para falar o comando de sua preferencia; msgsucesso = "monstro foi criado!!!", --Mensagem que manda ao player ao criar o monstrinho; msgsono = "Demon Está dormindo zzzZZZ", --Mensagem ao tentar usar o comando com intervalo de espera do comando; msgnull = "Está acordado corra lá", --Mensagem quando o monstro acordar } function onSay(cid, words, param, channel) local tp = getThingPos(cid) --verficação --inicio if tp.x == t.pisomapa.x and tp.y == t.pisomapa.y and tp.z == t.pisomapa.z then --verificação if getPlayerStorageValue(cid, t.sto) > os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgsono) return true end for _, cid in ipairs(getPlayersOnline()) do --verificação players global setPlayerStorageValue(cid, t.sto, os.time() + t.temp) --seta storage end doCreateMonster(t.monstro, t.localmapa) doPlayerSendTextMessage(cid, 27, t.msgsucesso) else --fora do tile if getPlayerStorageValue(cid, t.sto) > os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgsono) return true end if getPlayerStorageValue(cid, t.sto) < os.time() then --verificação tempo doPlayerSendTextMessage(cid, 27, t.msgnull) return true end end --fim script BY L3K0T return true end tag xml;;
       
      <talkaction words="!fss" event="script" value="fss.lua"/> feito isso salva tudinho e use da melhor forma que achar.
       
      Video;;
       
       
      Créditos: @L3K0T
       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo