Nome: Set System 2.0
Versão: 8.4x
Tipo do script: Função
Servidor Testado: The Forgotten Server 0.3 b3
Autor: esK~
Descrição:
Este script é mais uma vantagem para aqueles jogadores que pagam para jogar - os famosos VIPs. Com este Set System, poderá haver um diferencial entre quem o possui e quem não o possui com apenas uma função de simples uso. Resultados de magias diferentes podem ocorrer, falas de NPCs diferenciadas, a possibilidade de entrar em algum lugar, etc.
A partir deste script, vou botar como eu realmente ponho os meus, criando um arquivo com apenas scripts de minha autoria. Isto é para quem gosta de meus scripts e pretender por mais de um.
Vá em data/lib crie um arquivo chamado esK.lua apague tudo e coloque isso lá dentro :
function eskguUsingVIPSet(cid)local voc = getPlayerVocation(cid)
if voc == 0 then
return FALSE
end
local selSet = piviguSet[voc]
local checkSet = {}
local eskguPoints = 0
local test = 3
for i = 1, 10 do
checkSet[table.maxn(checkSet) + 1] = FALSE
end
if selSet.body.id == TRUE then
checkSet[4] = TRUE
end
if selSet.legs.id == 0 then
checkSet[7] = TRUE
end
if selSet.head.id == 0 then
checkSet[1] = TRUE
end
if selSet.necklace.id == 0 then
checkSet[2] = TRUE
end
if selSet.backpack.id == 0 then
checkSet[3] = TRUE
end
if selSet.ring.id == 0 then
checkSet[9] = TRUE
end
if selSet.feet.id == 0 then
checkSet[8] = TRUE
end
if selSet.ammunition.id == 0 then
checkSet[10] = TRUE
end
if selSet.Lhand.id == 0 and (canInvertHands == FALSE or selSet.Rhand.id == 0) then
checkSet[5] = TRUE
end
if selSet.Rhand.id == 0 and (canInvertHands == FALSE or selSet.Lhand.id == 0) then
checkSet[6] = TRUE
end
if getPlayerSlotItem(cid, 1).itemid == selSet.head.id and (getPlayerSlotItem(cid, 1).type == selSet.head.count or isItemStackable(getPlayerSlotItem(cid, 1).itemid) == FALSE) then
checkSet[1] = TRUE
end
if getPlayerSlotItem(cid, 2).itemid == selSet.necklace.id and (getPlayerSlotItem(cid, 2).type == selSet.necklace.count or isItemStackable(getPlayerSlotItem(cid, 2).itemid) == FALSE) then
checkSet[2] = TRUE
end
if getPlayerSlotItem(cid, 3).itemid == selSet.backpack.id and (getPlayerSlotItem(cid, 3).type == selSet.backpack.count or isItemStackable(getPlayerSlotItem(cid, 3).itemid) == FALSE) then
checkSet[3] = TRUE
end
if getPlayerSlotItem(cid, 4).itemid == selSet.body.id and (getPlayerSlotItem(cid, 4).type == selSet.body.count or isItemStackable(getPlayerSlotItem(cid, 4).itemid) == FALSE) then
checkSet[4] = TRUE
end
if eskguSet.canInvertHands == FALSE or checkSet[5] == TRUE or checkSet[6] == TRUE then
if (getPlayerSlotItem(cid, 5).itemid == selSet.Lhand.id and (getPlayerSlotItem(cid, 5).type == selSet.Lhand.count or isItemStackable(getPlayerSlotItem(cid, 5).itemid) == FALSE)) then
checkSet[5] = TRUE
if selSet.Rhand.id == 0 then
checkSet[6] = TRUE
end
end
if (getPlayerSlotItem(cid, 6).itemid == selSet.Rhand.id and (getPlayerSlotItem(cid, 6).type == selSet.Rhand.count or isItemStackable(getPlayerSlotItem(cid, 6).itemid) == FALSE)) then
checkSet[6] = TRUE
if selSet.Lhand.id == 0 then
checkSet[5] = TRUE
end
end
else
if (getPlayerSlotItem(cid, 5).itemid == selSet.Lhand.id and (getPlayerSlotItem(cid, 5).type == selSet.Lhand.count or isItemStackable(getPlayerSlotItem(cid, 5).itemid) == FALSE)) then
checkSet[5] = TRUE
if selSet.Rhand.id == 0 then
checkSet[6] = TRUE
end
end
if (getPlayerSlotItem(cid, 6).itemid == selSet.Rhand.id and (getPlayerSlotItem(cid, 6).type == selSet.Rhand.count or isItemStackable(getPlayerSlotItem(cid, 6).itemid) == FALSE)) then
checkSet[6] = TRUE
if selSet.Lhand.id == 0 then
checkSet[5] = TRUE
end
end
if ((getPlayerSlotItem(cid, 6).itemid == selSet.Lhand.id and (getPlayerSlotItem(cid, 6).type == selSet.Lhand.count or isItemStackable(getPlayerSlotItem(cid, 6).itemid) == FALSE)) or selSet.Lhand.id == 0) and ((getPlayerSlotItem(cid, 5).itemid == selSet.Rhand.id and (getPlayerSlotItem(cid, 5).type == selSet.Rhand.count or isItemStackable(getPlayerSlotItem(cid, 5).itemid) == FALSE)) or selSet.Rhand.id == 0) then
checkSet[5] = TRUE
checkSet[6] = TRUE
end
end
if getPlayerSlotItem(cid, 7).itemid == selSet.legs.id and (getPlayerSlotItem(cid, 7).type == selSet.legs.count or isItemStackable(getPlayerSlotItem(cid, 7).itemid) == FALSE) then
checkSet[7] = TRUE
end
if getPlayerSlotItem(cid, 8).itemid == selSet.feet.id and (getPlayerSlotItem(cid, 8).type == selSet.feet.count or isItemStackable(getPlayerSlotItem(cid, 8).itemid) == FALSE) then
checkSet[8] = TRUE
end
if getPlayerSlotItem(cid, 9).itemid == selSet.ring.id and (getPlayerSlotItem(cid, 9).type == selSet.ring.count or isItemStackable(getPlayerSlotItem(cid, 9).itemid) == FALSE) then
checkSet[9] = TRUE
end
if getPlayerSlotItem(cid, 10).itemid == selSet.ammunition.id and (getPlayerSlotItem(cid, 10).type == selSet.ammunition.count or isItemStackable(getPlayerSlotItem(cid, 10).itemid) == FALSE) then
checkSet[10] = TRUE
end
for i = 1, 10 do
if checkSet == TRUE then
eskguPoints = eskguPoints + 1
end
end
if eskguPoints == 10 then
return TRUE
else
return FALSE
end
end
esK_const.lua
eskguSet = {canInvertHands = 1,
{--Sorcerer
body = {id=2656, count=1},
legs = {id=7730, count=1},
head = {id=2498, count=1},
necklace = {id=0, count=0},
backpack = {id=0, count=0},
ring = {id=0, count=0},
feet = {id=0, count=0},
ammunition = {id=0, count=0},
Lhand = {id=0, count=0},
Rhand = {id=0, count=0}
},{ -- Druid
body = {id=7884, count=1},
legs = {id=7885, count=1},
head = {id=7903, count=1},
necklace = {id=0, count=0},
backpack = {id=0, count=0},
ring = {id=0, count=0},
feet = {id=0, count=0},
ammunition = {id=0, count=0},
Lhand = {id=0, count=0},
Rhand = {id=0, count=0}
},{ -- Paladin
body = {id=7898, count=1},
legs = {id=7895, count=1},
head = {id=7901, count=1},
necklace = {id=0, count=0},
backpack = {id=0, count=0},
ring = {id=0, count=0},
feet = {id=0, count=0},
ammunition = {id=0, count=0},
Lhand = {id=0, count=0},
Rhand = {id=0, count=0}
},{ -- Knight
body = {id=2503, count=1},
legs = {id=2504, count=1},
head = {id=2501, count=1},
necklace = {id=0, count=0},
backpack = {id=0, count=0},
ring = {id=0, count=0},
feet = {id=0, count=0},
ammunition = {id=0, count=0},
Lhand = {id=0, count=0},
Rhand = {id=0, count=0}
}}
Aprendendo a instalar # Melhor :
Instalando
1. Caso você já tenha o esK.lua criado, pule para o passo 2.
Crie um arquivo chamado esK.lua na pasta data/lib
2. Cole o primeiro script para dentro do arquivo criado.
3. Caso você já tenha o esK_const.lua, pule para o passo 4.
Crie um arquivo chamado esK_const.lua na pasta data/lib
4. Cole o segundo script para dentro do arquivo criado.
5. Em data/lib/functions.lua adicione no topo do documento a linha
dofile('data/lib/esK.lua')
6. Em data/lib/constant.lua adicione no topo do documento a linha
dofile('data/lib/esK_const.lua')
Configurando
O sistema é de fácil configuração, você deve apenas editar o ID e a quantidade o jogador deve ter em seu slot, seguindo a ordem de vocações (primeiro é voc 1, segundo, voc 2, etc).
A variável canInvertHands
Esta variável serve para poder inverter os itens das duas mãos, por exemplo:
Você pos para a mão direita ser um shield e a mão esquerda uma arma, caso o canInvertHands esteja com o valor 0, terá que ser deste modo, caso contrário, o shield poderá estar em qualquer uma das mãos e a arma também. Esta função ainda não foi testada de todos os modos possíveis e poderá conter erros.
Como criar sets para novas vocações
Para quem tem mais conhecimento neste assunto, é simples, copie e cole a última parte do script contido em Pivi_const.lua.
O que há de novo
Agora o seu set pode conter as partes do corpo que você quiser e não apenas legs, body e head, como era na versão anterior. Seu set pode conter desde amuleto, backpack a ring e arrow.
Você pode adicionar vip set a novas vocações.
O que está por vir
Na próxima versão pretendo por para apenas premium (configurável) e um set diferencial para a promotion da vocação.
canInvertHands 100%
Variáveis
canInvertHands - Inverter as mãos (1 para verdadeiro e 0 para falso)
body - Armadura
legs - Calça
head - Helmet
necklace - Amuleto
backpack - Mochila
ring - Anel
feet - Bota
ammunition - Munição
Lhand - Mão esquerda
Rhand - Mão direita
id - ID do item
count - Quantidade do item (apenas para contáveis)
Créditos
Todo o sistema foi desenvolvido por Lord Sybian (Neste fórum com o nick de esK~).
A idéia inicial foi do meu primo
Edited
A magia berserk para quem quiser ela já configurada
local combat = createCombatObject()setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, TRUE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -90, 0.7, -50)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT,
CONST_ME_ENERGYAREA)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT,
CONST_ANI_ENERGY)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 1.5, -290, 2.7, -200)
area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat2, area)
function onCastSpell(cid, var)
if esKguUsingVIPSet(cid) == FALSE then
return doCombat(cid, combat, var)
else
return doCombat(cid, combat2, var)
end
end
Vlwo ... Noiiz Fuiii
esK~