Ir para conteúdo

Spell Por Reset


Carlinhow789

Posts Recomendados

demon ver o meu tbm ?

 

--[[ <(Advanced Reset System 2.0)>

 

Autor: MarcelloMkez. Contato: (marcello_dirt@hotmail.com)

Versão: 2.0

Testado em: 8.50 e 8.60

TFS: 0.3.6 and 0.4.0

Fórum: http://www.xtibia.com/forum/topic/142463-advanced-reset-system-20/

 

-=[Características]=-

~( Versão 2.0 )~

 

- Resets agora Armazenados na DataBase; (Sem Valor de Storage)

- Instala o System e cria a Tabela de Resets com o comando "/installreset";

- Resets no Look do jogador ex: 22:10 You see Marcello [Reset 2] (Level 8). He is an elder druid.;

- [sTAGES] para "Premium Account" e "Free Account"; ]]

 

--=[Functions]=--

 

-- installReset()' [instala o Sistema.]

-- tableResetInstall()' [Verifica Se o Sistema ja foi instaladao.]

-- nowReseting()' [Verifica, retorna o erro ou reseta.]

-- getPlayerReset(cid)' [Pega numero de resets do player.]

-- checLevelStageReset(cid)' [Verifica o Level para Resetar.]

-- newReset(cid)' [Verifica todas as Condições de Reset.]

-- addValue(value)' [Adiciona numero de resets.]

 

--=[Comandos de Jogadores]=--

-- "/installreset" -- Só será usado uma vez, para instalar o sistema.

-- "!resetar" -- Para Resetar.

 

function onSay(cid, words, param)

 

if words =="!resetar" then

 

--[ Condições de Reset ] --

local coNdConf = {

 

needPz = true, -- Precisa estar em Pz pra resetar? [true, false]

needPa = false, -- Precisa ser Premium Account Pra resetar? [true, false]

withe = true, -- Players com Pk Withe podem resetar? [true, false]

red = true, -- Players com Pk Red pode resetar? [true, false]

battle = true, -- Players precisão estar sem battle pra resetar? [true, false]

teleport = true, -- Teleportar Player para o templo após resetar? [true, false]

look = true, -- Aparecer Resets no Look do Player? [true, false]

pid = getPlayerGUID(cid), -- Não Mexer.

 

 

--[ Configurações do Reset ] --

resetConf = {

 

Level = 350, -- Level Necessário para Resetar. [Valor]

backLvl = 8, -- Level que voltará após o Reset. [Valor]

time = 1, -- Tempo para o Player deslogar ao resetar, em segundos. [Valor]

 

},

}

--[[>> STAGES <<]]--

x=true;X=true -- Não Mexer.

local stage = {Abilitar = {x}, Desabilitar = {}, --<< Abilitar Stages?? >>-- [{x};{}]

 

-- [RESETS] | [PREMMY] | [FREE]

stage1= {resets= 0, premmy= 700000, free= 700000},

stage2= {resets= 11, premmy= 710000, free= 710000}, -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])

stage3= {resets= 140000, premmy= 9999999999, free= 9999999999}, -- resets = Número de resets para o Stage;

stage4= {resets= 190000, premmy= 9999999999, free= 9999999999}, -- premmy = Level necessário para Premium Accounts;

stage5= {resets= 240000, premmy= 9999999999, free= 9999999999}, -- free = Level necessário para Free Accounts;

stage6= {resets= 290000, premmy= 9999999999, free= 9999999999}, -- Coloque em Ordem...

stage7= {resets= 350000, premmy= 9999999999, free= 9999999999}, -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]

stage8= {resets= 400000, premmy= 9999999999, free= 9999999999}, -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}

stage9= {resets= 450000, premmy= 9999999999, free= 9999999999},

stage10={resets= 500000, premmy= 9999999999, free= 9999999999},

 

}

--[[>> FIM STAGES <<]]--

 

--=[Pega Valor de Resets]=--

function getPlayerReset(cid)

local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";")

rss = qr:getDataInt("reset", coNdConf.pid)

if rss < 0 then

rss = 0

end

return rss

end

 

local success = " ~~ Sucesso! ~~ \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessage

local qrt = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";");rss_db = qrt:getDataInt("reset", coNdConf.pid)

local lvl_query = "UPDATE `players` SET `level` = "..(coNdConf.resetConf.backLvl)..", `experience` = 0 WHERE `id`= " .. coNdConf.pid .. ";"

local reset_query = "UPDATE `players` SET `reset` = "..(getPlayerReset(cid)+(1)).." WHERE `id`= " .. coNdConf.pid .. ";"

local nolook_query = "UPDATE `players` SET `description` = '' WHERE `players`.`id`= " .. coNdConf.pid .. ";"

local look_query = "UPDATE `players` SET `description` = ' [Reset "..(getPlayerReset(cid)+(1)).."]' WHERE `players`.`id`= " .. coNdConf.pid .. ";"

 

--=[Reseta]=--

function addValue(value)

if coNdConf.look == false then

doRemoveCreature(cid)

db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(nolook_query)

else

doRemoveCreature(cid)

db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(look_query)

return LUA_NO_ERROR

end

end

 

function nowReseting()

if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")

return true

end

if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then

doPlayerPopupFYI(cid, success)

addEvent(addValue, coNdConf.resetConf.time*1000, value)

else

doPlayerPopupFYI(cid, success)

addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))

addEvent(addValue, coNdConf.resetConf.time*1000, value)

return true

end

end

 

--[sTAGES Nao mexer em nada.]--

function checkLevelStageReset(cid)

 

local stages = {

{resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.free},

{resets= stage.stage2.resets, premmy= stage.stage2.premmy, free= stage.stage2.free},

{resets= stage.stage3.resets, premmy= stage.stage3.premmy, free= stage.stage3.free},

{resets= stage.stage4.resets, premmy= stage.stage4.premmy, free= stage.stage4.free},

{resets= stage.stage5.resets, premmy= stage.stage5.premmy, free= stage.stage5.free},

{resets= stage.stage6.resets, premmy= stage.stage6.premmy, free= stage.stage6.free},

{resets= stage.stage7.resets, premmy= stage.stage7.premmy, free= stage.stage7.free},

{resets= stage.stage8.resets, premmy= stage.stage8.premmy, free= stage.stage8.free},

{resets= stage.stage9.resets, premmy= stage.stage9.premmy, free= stage.stage9.free},

{resets=stage.stage10.resets, premmy=stage.stage10.premmy, free=stage.stage10.free},

}

local resets = getPlayerReset(cid)

for i, tab in ipairs(stages) do

if resets <= tab.resets then

coNdConf.resetConf.Level = isPremium(cid) and tab.premmy or tab.free

break

end

end

if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then

err(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")

return TRUE

end

 

if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then

doPlayerPopupFYI(cid, success)

addEvent(addValue, coNdConf.resetConf.time*1000, value)

else

doPlayerPopupFYI(cid, success)

addEvent(addValue, coNdConf.resetConf.time*1000, value)

addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))

return true

end

end

function newReset(cid)

if(coNdConf.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then

err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar em Protection Zone Para Resetar. -") return TRUE end

if(coNdConf.needPa == true) and not isPremium(cid) then

err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa ser Premium Account para Resetar. -") return TRUE end

if(coNdConf.withe == false) and (getCreatureSkullType(cid) == 3) then

err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Withe. -") return TRUE end

if(coNdConf.red == false) and (getCreatureSkullType(cid) == 4) then

err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Red. -") return TRUE end

if(coNdConf.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar sem Battle para Resetar. -") return TRUE end

 

local xy = {true,false}

table.insert(stage.Abilitar, false)

table.insert(stage.Desabilitar, false)

if stage.Abilitar[1] == xy[1] and stage.Desabilitar[1] == xy[2] then

checkLevelStageReset(cid)

elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] then

nowReseting()

else

doPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!")

end

return true

end

function tableResetInstall()

print(not rss_db and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")

addEvent(newReset, 1000, cid)

return false

end

if tableResetInstall() then

end

end

--=[install System]=--

function installReset()

if db.executeQuery("ALTER TABLE `players` ADD reset INT(11) NOT NULL DEFAULT 0;") then

print("[MarcelloMkez] -= Advanced Reset System 2.0 por DataBase =- Instalado com sucesso!")

return TRUE

end

print('[Advanced Reset System/MarcelloMkez] Não foi possível instalar o Sistema.')

return FALSE

end

local tt = {

"Preparando Instalação...",

"Instalando: TableReset Db...",

"Instalando: getPlayerReset()...",

"Instalando: addValue()...",

"Instalando: checkLevelStageReset()...",

"Instalando: newReset() and nowReseting()...",

"Finalizando Instalação...",

"...",

success = {

"Iniciando...",

"function: TableReset Db... [success]",

"function: getPlayerReset()... [success]",

"function: addValue(value)... [success]",

"function: checkLevelStageReset()... [success]",

"function: newReset() and nowReseting()... [success]",

"Fim da Instalação. ",

"by: ~~ MarcelloMkez ~~ \nContato: marcello_dirt@hotmail.com",

inst = {"MarcelloMkez","Advanced Reset System 2.0 por DataBase"

 

},

 

},

 

}

if words == "/installreset" and getPlayerAccess(cid) >= 3 then

function install()

if installReset() then

print(""..tt.success[7].."")

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,""..tt.success[8].."")

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] -="..tt.success.inst[2].."=- Instalado com sucesso!")

else

print("["..tt.success.inst[1].."] FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].")

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].")

end

return 1

end

function concl(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[7].."")

print(""..tt[8].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[7].."")

doPlayerSendTextMessage(cid, typetx,""..tt[8].."")

addEvent(install, 1000,cid)

end

function finall(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[6].."")

print(""..tt[7].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[6].."")

doPlayerSendTextMessage(cid, typetx,""..tt[7].."")

addEvent(concl, 3000,cid)

end

function installDd(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[5].."")

print(""..tt[6].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[5].."")

doPlayerSendTextMessage(cid, typetx,""..tt[6].."")

addEvent(finall, 1000,cid)

end

function installCc(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[4].."")

print(""..tt[5].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[4].."")

doPlayerSendTextMessage(cid, typetx,""..tt[5].."")

addEvent(installDd, 1000,cid)

end

function installBb(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[3].."")

print(""..tt[4].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[3].."")

doPlayerSendTextMessage(cid, typetx,""..tt[4].."")

addEvent(installCc, 1000,cid)

end

function installAa(cid)

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[2].."")

print(""..tt[3].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[2].."")

doPlayerSendTextMessage(cid, typetx,""..tt[3].."")

addEvent(installBb, 1000,cid)

end

function toInstall()

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt.success[1].."")

print(""..tt[2].."")

doPlayerSendTextMessage(cid, typetx,""..tt.success[1].."")

doPlayerSendTextMessage(cid, typetx,""..tt[2].."")

addEvent(installAa, 1000,cid)

end

function preparation()

local typetx = MESSAGE_STATUS_CONSOLE_BLUE

print(""..tt[1].."")

doPlayerSendTextMessage(cid, typetx,""..tt[1].."")

addEvent(toInstall, 3000,cid)

end

if preparation() then

end

end

return 1

end

--=[by: MarcelloMkez]=--

Link para o comentário
Compartilhar em outros sites

deu certo n!

olha so minha spell.

 

local acombat1 = createCombatObject()

local acombat2 = createCombatObject()

local acombat3 = createCombatObject()

local acombat4 = createCombatObject()

local acombat5 = createCombatObject()

 

 

 

local combat1 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 30)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 39)

 

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -115.3, 1.5, -115.3, 10)

 

local combat2 = createCombatObject()

setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 30)

setCombatParam(combat2, COMBAT_PARAM_EFFECT, 39)

setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

 

local combat3 = createCombatObject()

setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 30)

setCombatParam(combat3, COMBAT_PARAM_EFFECT, 39)

setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

 

local combat4 = createCombatObject()

setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 30)

setCombatParam(combat4, COMBAT_PARAM_EFFECT, 39)

setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

 

local combat5 = createCombatObject()

setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

setCombatParam(combat5, COMBAT_PARAM_EFFECT, 49)

setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

 

arr1 = {

{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, 3, 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, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 3, 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}

}

 

arr3 = {

{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, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

}

 

 

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

local area4 = createCombatArea(arr4)

local area5 = createCombatArea(arr5)

setCombatArea(combat1, area1)

setCombatArea(combat2, area2)

setCombatArea(combat3, area3)

setCombatArea(combat4, area4)

setCombatArea(combat5, area5)

 

function onTargetTile(cid, pos)

doCombat(cid,combat1,positionToVariant(pos))

end

 

function onTargetTile2(cid, pos)

doCombat(cid,combat2,positionToVariant(pos))

end

 

function onTargetTile3(cid, pos)

doCombat(cid,combat3,positionToVariant(pos))

end

 

function onTargetTile4(cid, pos)

doCombat(cid,combat4,positionToVariant(pos))

end

 

function onTargetTile5(cid, pos)

doCombat(cid,combat5,positionToVariant(pos))

end

 

 

 

 

 

 

 

setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

 

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

 

setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

 

setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")

 

setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")

 

 

 

 

 

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, acombat1, parameters.var)

end

 

local function onCastSpell2(parameters)

doCombat(parameters.cid, acombat2, parameters.var)

end

 

local function onCastSpell3(parameters)

doCombat(parameters.cid, acombat3, parameters.var)

end

 

local function onCastSpell4(parameters)

doCombat(parameters.cid, acombat4, parameters.var)

end

 

local function onCastSpell5(parameters)

doCombat(parameters.cid, acombat5, parameters.var)

end

 

 

 

 

 

 

 

 

function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 800, parameters)

addEvent(onCastSpell3, 1600, parameters)

addEvent(onCastSpell4, 2400, parameters)

addEvent(onCastSpell5, 2600, parameters)

return TRUE

end

Link para o comentário
Compartilhar em outros sites

local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()
local acombat5 = createCombatObject()



local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 39)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -115.3, 1.5, -115.3, 10)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 49)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

arr1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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, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

arr4 = {
{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, 3, 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}
}

arr5 = {
{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, 3, 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}
}



local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5) 

function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
doCombat(cid,combat4,positionToVariant(pos))
end

function onTargetTile5(cid, pos)
doCombat(cid,combat5,positionToVariant(pos))
end







setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")

setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")






local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, acombat4, parameters.var)
end

local function onCastSpell5(parameters)
doCombat(parameters.cid, acombat5, parameters.var)
end





local min = 0 -- resets

function getPlayerReset(cid) -- Marcello Mkez
local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";")
rss = qr:getDataInt("reset", getPlayerGUID(cid))
if rss < 0 then
rss = 0
end
return rss
end

function onCastSpell(cid, var)

if getPlayerReset(cid) >= min then
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 800, parameters)
addEvent(onCastSpell3, 1600, parameters)
addEvent(onCastSpell4, 2400, parameters)
addEvent(onCastSpell5, 2600, parameters)
return true
end

return false
end

Editado por Demonbholder
Link para o comentário
Compartilhar em outros sites

pego aki , so que tipo tem como por assim pra avisar qui tem que ter tantos resets n?

pq se n tiver aki , n aparece nada que n pode usar , ai a pessoa vai ficar axando que a spell não funfa.

Link para o comentário
Compartilhar em outros sites

local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()
local acombat5 = createCombatObject()



local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 39)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -115.3, 1.5, -115.3, 10)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -105.3, 1.5, -105.3, 10)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 30)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 39)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 49)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -125.3, 1.5, -125.3, 10)

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

arr4 = {
{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, 3, 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}
}

arr5 = {
{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, 3, 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}
}



local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5) 

function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
doCombat(cid,combat4,positionToVariant(pos))
end

function onTargetTile5(cid, pos)
doCombat(cid,combat5,positionToVariant(pos))
end







setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")

setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")






local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, acombat4, parameters.var)
end

local function onCastSpell5(parameters)
doCombat(parameters.cid, acombat5, parameters.var)
end





local min = 0 -- resets

function getPlayerReset(cid) -- Marcello Mkez
local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";")
rss = qr:getDataInt("reset", getPlayerGUID(cid))
if rss < 0 then
rss = 0
end
return rss
end

function onCastSpell(cid, var)

if getPlayerReset(cid) >= min then
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 800, parameters)
addEvent(onCastSpell3, 1600, parameters)
addEvent(onCastSpell4, 2400, parameters)
addEvent(onCastSpell5, 2600, parameters)
return true
end

doPlayerSendCancel(cid, "Você precisa de " .. min .. " resets para usar esta spell.")
return false
end

Link para o comentário
Compartilhar em outros sites

Meu Script De Reset é Esse

 

--[[ SCRIPTING> MarcelloMkez <scriptING ]]

 

--[[ [Advanced Reset System]

Autor: MarcelloMkez

Versão: 1.0

TFS: 0.3.6

Testado em: 8.50

Fórum: www.xtibia.com/forum/topic/138026-talk-action-advanced-reset-system/

 

[Características]

~ Versão 1.0 ~

 

- Resets no Look;

- Premium Account ou não;

- Mudar Vocação;

- Limite de Resets;

- Opções para Abilitar e Desabilitar Condições;

 

[Em Construção]

 

- Stages Free e Premium;

- 'Talvez' um novo sistema de mudar Vocação;

sem data para postagem. ]]

 

Q

 

function onSay(cid, words, param)

 

--[Configurações de Condição]__

 

config = { --[[verdadeiro / Falso]]

 

needPa = true, -- Precisa de Premium Account? [true / false]

needPz = true, -- Precisa estar em Protection Zone? [true / false]

battle = false, -- Precisa estar sem Batlle para Resetar? [true / false]

withe = false, -- Players PK Withe pode Resetar? [true / false]

red = false, -- Players PK Red pode Resetar? [true / false]

tp = true, -- Teleportar para o Templo após o reset? [true / false]

look = false, -- Mostrar Resets no Look do Player? [true / false]

addLimite = false, -- Abilitar Limite de Resets? [true / false]

setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]

storage = 2310, -- Storage [valor]

 

 

--[Configurações do Reset]__

 

resetStatus = {

 

player = getPlayerGUID(cid), -- Não Mude.

lvl = 10000 , -- Level Necessário para Resetar. [valor]

lvlreset = 100, -- Level que retornará após o Reset. [valor]

limite = 300, -- Máximo de resets que um player pode chegar. [valor]

newClasse = 1, -- Id da Nova Vocação após o Reset. [valor]

tempo= 5 -- Tempo para o Player deslogar para Resetar. Em segundos. [valor]

},

}

 

--[Funções]__

 

function Reseting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function noAll(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

 

function noTeleporting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

 

function noLook(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

 

function noClasse(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function setClasse(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function look(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function teleporting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,config.storage)

 

if resets < 0 then

resets = 0

end

return resets

 

end

 

 

local resets = getResets(cid)

local needLvl ="Você precisa de mais "..config.resetStatus.lvl-getPlayerLevel(cid).." leveis para resetar."

local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."

 

 

--[Condiçoes]__

 

if(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then

doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")

return TRUE

 

elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then

doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")

return TRUE

 

elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then

doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")

return TRUE

 

elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then

doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")

return TRUE

 

elseif(config.needPa == true) and not isPremium(cid) then

doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")

return TRUE

 

elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")

return TRUE

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then

addEvent(Reseting, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then

addEvent(noAll, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then

addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then

addEvent(noLook, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then

addEvent(noClasse, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then

addEvent(setClasse, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then

addEvent(look, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then

addEvent(teleporting, config.resetStatus.tempo* 1000, cid)

 

elseif doPlayerSendCancel(cid, needLvl) then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

return TRUE

end

 

if doPlayerPopupFYI(cid, msg) then

 

end

return TRUE

 

end

Link para o comentário
Compartilhar em outros sites

Substitua isso:

 

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

 

Por isso:

 

local min = 0 -- resets

function getResets(cid) -- MarcelloMkez
resets = getPlayerStorageValue(cid,2310) 

if resets < 0 then 
resets = 0 
end 
return resets 

end 

function onCastSpell(cid, var)

if getResets(cid) >= min then
return doCombat(cid, combat, var)
end

doPlayerSendCancel(cid, "Você precisa de " .. min .. " resets para usar esta spell.")
return false
end

 

Não esqueça de colocar o min ali para quanto você quiser.

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

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