É o meu primeiro script aqui (na verdade já atendi alguns pedidos), mas postando nessa seção é meu primeiro. São sistemas que dependem do seu sistema de vip e que dará uma segunda promotion ao usar o comando !promote.
(Para todos os Sistemas) Vá até a pasta talkactions>scripts e crie um arquivo chamado promotion.lua (ou qualquer nome de sua preferência) e cole isto dentro:
Para VIP System by Account [Kydrai] -- Link
-- Script [Promotion por Talkaction] by Leoxtibia --
local table = {
[5] = {price = 10, minlevel = 10}, --- [vocação] / preço da moeda / level minimo para usar o comando
[6] = {price = 10, minlevel = 100},
[7] = {price = 10, minlevel = 100},
[8] = {price = 10, minlevel = 100}
}
local moeda = 2160 -- id da moeda (2160 é crystal coin)
function onSay(cid, words, param)
if table[getPlayerVocation(cid)] then
if getPlayerLevel(cid) >= table[getPlayerVocation(cid)].minlevel then
if isVip(cid) == TRUE then
if doPlayerRemoveItem(cid, moeda, table[getPlayerVocation(cid)].price) == TRUE then
setPlayerPromotionLevel(cid, 2)
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "Voce foi promovido!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 24, "Você não tem ".. table[getPlayerVocation(cid)].price .." ".. getItemNameById(moeda) ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você não é VIP.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter level ".. table[getPlayerVocation(cid)].minlevel .." ou mais para usar o comando.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter a primeira promotion antes de conseguir a segunda.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
Para VIP System por storage
-- Script [Promotion por Talkaction] by Leoxtibia --
local table = {
[5] = {price = 10, minlevel = 100}, -- [vocação] -- preço da promotion (em crystal coins) e minimo de level para usar o comando
[6] = {price = 10, minlevel = 100},
[7] = {price = 10, minlevel = 100},
[8] = {price = 10, minlevel = 100}
}
local stor = 4532 -- storage da sua vip account
local moeda = 2160 -- id da moeda (2160 é crystal coin)
function onSay(cid, words, param)
if table[getPlayerVocation(cid)] then
if getPlayerLevel(cid) >= table[getPlayerVocation(cid)].minlevel then
if getPlayerStorageValue(cid, stor) >= 1 then
if doPlayerRemoveItem(cid, moeda, table[getPlayerVocation(cid)].price) == TRUE then
setPlayerPromotionLevel(cid, 2)
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "Voce foi promovido!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 24, "Você não tem ".. table[getPlayerVocation(cid)].price .." ".. getItemNameById(moeda) ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você não é VIP Account.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter level ".. table[getPlayerVocation(cid)].minlevel .." ou mais para usar o comando.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter a primeira promotion antes de conseguir a segunda.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
Para VIP System por Premium
-- Script [Promotion por Talkaction] by Leoxtibia --
local table = {
[5] = {price = 10, minlevel = 10},
[6] = {price = 10, minlevel = 100},
[7] = {price = 10, minlevel = 100},
[8] = {price = 10, minlevel = 100}
}
local moeda = 2160 -- id da moeda (2160 é crystal coin)
function onSay(cid, words, param)
if table[getPlayerVocation(cid)] then
if getPlayerLevel(cid) >= table[getPlayerVocation(cid)].minlevel then
if isPremium(cid) == TRUE then
if doPlayerRemoveItem(cid, moeda, table[getPlayerVocation(cid)].price) == TRUE then
setPlayerPromotionLevel(cid, 2)
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "Voce foi promovido!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 24, "Você não tem ".. table[getPlayerVocation(cid)].price .." ".. getItemNameById(moeda) ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você não é premium.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter level ".. table[getPlayerVocation(cid)].minlevel .." ou mais para usar o comando.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter a primeira promotion antes de conseguir a segunda.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
Para VIP System by Mock
-- Script [Promotion por Talkaction] by Leoxtibia --
local table = {
[5] = {price = 10, minlevel = 100}, -- [vocação] -- preço da promotion (em crystal coins) e minimo de level para usar o comando
[6] = {price = 10, minlevel = 100},
[7] = {price = 10, minlevel = 100},
[8] = {price = 10, minlevel = 100}
}
local moeda = 2160 -- id da moeda (2160 é crystal coin)
function onSay(cid, words, param)
if table[getPlayerVocation(cid)] then
if getPlayerLevel(cid) >= table[getPlayerVocation(cid)].minlevel then
if vip.hasVip(cid) == TRUE then
if doPlayerRemoveItem(cid, moeda, table[getPlayerVocation(cid)].price) == TRUE then
setPlayerPromotionLevel(cid, 2)
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "Você foi promovido!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 24, "Você não tem ".. table[getPlayerVocation(cid)].price .." ".. getItemNameById(moeda) ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você não é VIP Account.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter level ".. table[getPlayerVocation(cid)].minlevel .." ou mais para usar o comando.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, 24, "Você deve ter a primeira promotion antes de conseguir a segunda.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
(Para todos os Tipos) Agora em em creaturescripts>scripts no arquivo login.lua adicione o script abaixo, antes do return true para a vocação voltar ao normal assim que a vip acabar:
Para VIP System by Account -- [Kydrai]
if isVip(cid) == FALSE and (isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
end
Para VIP System por Storage
if getPlayerStorageValue(cid, 4532) == FALSE and (isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
end
Lembre-se de alterar o storage aqui se alterou lá no script
Para VIP por Premium
if isPremium(cid) == FALSE and (isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
end
Para VIP by MOCK
if vip.hasVip(cid) == FALSE and (isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
end
(Para todos os Tipos) Na parte acima, aqui são os ids das novas vocações: {9, 10, 11, 12} que voltarão à vocação anterior, no nosso caso, [5];[6];[7];[8]
(Para todos os Tipos) Agora em talkactions.xml coloque a tag:
<talkaction words="!promote" event="script" value="promotion.lua"/>
Lembre-se que se mudou o nome do arquivo lá emcima, mude na tag também.
Atenção com essa parte... no vocations.xml configurem corretamente a partir de qual vocação será conseguida a vocação promote. Vejam o exemplo abaixo:
fromvoc="X" -- Significa "da vocação" é de qual vocação essa Supreme Sorcerer virá, se você quiser que venha do Master Sorcerer que o id é 5, você coloca 5, ficando: fromvoc="5"
Então é isso aí galera, ainda estou começando em scripting mas espero ter ajudado alguém. Abraços!