LE
talkaction

[Talkaction] Promotion Para Vips - Systems [Kydrai, Storage, Premium, Mock]

Por Leoxtibia, 11 de jun. de 2012 em Actions e Talkactions

promotion
vips
system
otserv
tibia
script
14
3.1k
LeoxtibiaL
11 de junho de 2012 às 14:50

É 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!

Editado Junho 13 por Leoxtibia

link

VildenV
11 de junho de 2012 às 15:17

Se a vip dele acabar ele não vai perde a vocação, só se ele usar o comando..

Rep+ por esta ajudando bastante na área de script e essa script vai ajudar a despoluir a área de pedidos.

 

Tomei a liberdade de editar o tópico com o link do system vip, http://www.xtibia.com/forum/topic/136543-vip-system-by-account-v10/

GodalonexDG
11 de junho de 2012 às 21:27

e Depois que acabar a vip? perde o promote?

Diego RulezD
12 de junho de 2012 às 01:04

@topic

Eu testei em meu servidor e quando você reloga o char, ele volta pra antiga vocação.

LeoxtibiaL
12 de junho de 2012 às 09:09

@Vilden

Vlw por adicionar o link.. já resolvi esse problema de ter que falar !promote para a vocação sair.

 

@Titanico xD

Agora perde, consertei isso =P

 

@Diego_o

Isso já foi consertado agora também, pode testar que vai funcionar ^^

Editado Junho 12 por Leoxtibia

VildenV
12 de junho de 2012 às 09:19

Agora sim está completo, que tal criar para os outros systemas vips? De storage, premium e mock?

LeoxtibiaL
12 de junho de 2012 às 09:52

Calma, ainda estou aprendendo kkk mas vou dar uma olhada nos outros sistemas, se eu conseguir coloco aqui mesmo ^^

VildenV
12 de junho de 2012 às 10:01

É basicamente a mesma coisa.. o que vai muda é a informação que ele pega do player [get].

 

por storage;

getPlayerStorageValue(cid,valueid) >= 1

por premium;

ispremium(cid) == true

por mock;

vip.hasVip(cid) == true

 

 

Boa sorte

Editado Junho 12 por Vilden

Diego RulezD
12 de junho de 2012 às 10:07

Como sou um usuário antigo no Xtibia, não estou interado ainda sobre as regras atuais do fórum então não sei se estou cometendo flood por postar novamente aqui. Caso seja flood me desculpem.

 

@topic.

Realmente está tudo concertado e o script funciona. Acredito que seja o único "sistema" de terceira promote compatível com o sistema vip do Kydrai que realmente funcione. Parabéns pelo script. REP+

LeoxtibiaL
12 de junho de 2012 às 21:05

Comando para os outros sistemas adicionado ^^

GodalonexDG
12 de junho de 2012 às 21:24

e pra por o site gesior para reconheçer a vocação nova? voce sabe tambem? '-'

estou tentando aqui mais num estou tendo sucesso, htdocs/config.

LeoxtibiaL
13 de junho de 2012 às 08:46

Malz aí cara, eu não sei porra nenhuma nada de site =S

1 mês depois...
SubwatS
15 de julho de 2012 às 13:55

fiz tudo certinho e não funcionou cara, tipo ele fala "voce foi promovido" e tal ae eu do look no char e fica You are. e nao mostra a vocation ta bugado.

e eu arrumei certinho la no vocations.xml o negocio do fromvoc e tal e msm assim n ta funfando

LeoxtibiaL
15 de julho de 2012 às 18:33

Cara, o script é de segunda promotion, isso aconteceu aqui quando eu tinha colocado como se fosse 1ª promotion. Veja se não foi isso que aconteceu com você. Abraços.