Ir para conteúdo
  • 0

Script Para Vocação Vip


nmaster

Pergunta

Bem galere, eu não presiso exatamento tudo, e sim so tentar corrigir um erro que deu no meu... meu amigo me passou um script promotion2 e um npc que lê esse script... esse npc ele da uma segunda promótion para os vip account.. só que eu fui testar a compra da promotion e depois que o NPC Confirmou eu dei look no char e apareceu "She is." não apareceu o nome nem nada...

 

Tem umas vocações extras no vocation.xml (que creio que seja os de vip) mais eu não sei configurar para funcionar com o npc da Promotion VIP....

 

A segunda dúvida, é pra quando acabar a vip essa promotion sumisse do char... tambem não sei fazer e nem sei se arrumando a duvida de cima eu arrumo essa tambem...

 

é porque sou novo nessa área... alguem pde me ajuda???

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

1º posta o script do npc

 

 

2º vai em data/creaturescripts/login antes do ultimo return TRUE adciona iso

 

if getPlayerStorageValue(cid,storagadavip)- os.time()<=0and(isInArray({5,6,7,8}, getPlayerVocation(cid)))then-- id das voc promotion

doPlayerSetVocation(cid,getPlayerVocation(cid)-4) -- aqui ele vai perde promotion

elseif getPlayerStorageValue(cid, storagedavip) - os.time() >= 1 and (isInArray({1, 2, 3, 4}, getPlayerVocation(cid))) then

doPlayerSetVocation(cid,getPlayerVocation(cid)+4) -- aqui ele ganha promotion

end

 

voce so edita as voc

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

  • 0

Ta aê

 

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

 

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

 

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

 

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

 

if(msgcontains(msg, 'Promote') or msgcontains(msg, 'promote')) then

selfSay('Deseja virar {Lonely Star} por 20 crystal coins?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if(getPlayerItemCount(cid, 2160) >= 20) then

doPlayerRemoveItem(cid, 2160, 20)

doPlayerSetVocation(cid,14)

selfSay('Vocação trocada com sucesso , Agora você é um Lonely Star.', cid)

else

selfSay('Você não tem {crystal coins} Suficientes.', cid)

end

talkState[talkUser] = 0

end

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Mais e assim ke eu kero e tipo fazer um npc de promotion ke quando eu seja promovido eu ganhe tal vocaçao e ganhe novas magias isso e facil

mais quando eu fiz as vocaçoes apareceu no account manager dai eu kero ke nao apareça no account manager e nem quando eu reloge vire outra vocaçao.

 

plis valendo rep +

Link para o comentário
Compartilhar em outros sites

  • 0
local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

local price = 1

local vocations = {1,2,3,4,5,6,7,8}

if(msgcontains(msg, 'lonely') or msgcontains(msg, 'lonely star')) then

selfSay('Você quer virar lonely star por '..price..' gps? {yes} ', cid)

talkState[talkUser] = 1

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then

if isInArray(vocations, getPlayerVocation(cid)) then

if doPlayerRemoveMoney(cid,price) == TRUE then

doPlayerSetVocation(cid,14)

selfSay('Parabens! Voce ja e lonely star. ', cid)

talkState[talkUser] = 0

else

selfSay('Você não tem ' .. price .. ' gps para ser promovido', cid)

talkState[talkUser] = 0

end

else

selfSay('Desculpe, voce precisa ter a primeira promoçao.', cid)

talkState[talkUser] = 0

end

elseif msg == "no" and talkState[talkUser] >= 1 then

selfSay("Then not", cid)

talkState[talkUser] = 0

npcHandler:releaseFocus(cid)

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

 

 

 

 

 

 

testa ai ai voce pode restringir qual vocaçao pode usar nessa linha local vocations = {1,2,3,4,5,6,7,8}

 

 

e o preço nessa local price = 1

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

  • 0

ae man vo ver um filme agora depois eu testo blz vlw ae se funfa do rep +

 

ei até ke deu certo sim. mais antes eu keria reset vocaçao pela quest dai eu nao axei eu resolvi fazer um npc ke desse promotion dai eu botava ele no final da quest e dava o promotion. so ke as vocaçoes fika no account manager dai eu ponho.

 

ex: formvoc:1 dai ele nao aparece no account manager mais dai quando reloga volta a vocaçao 1 eu kero ke quando ganhe promotion fike na mesma vocaçao sem buga a vocaçao e sem ke apareça no account manager.

 

 

tipo no vocations xml eu coloquei nas vocaçoes de promotion esse baguizinho <!-- dai no final --> mais isso nao funciona vc sabe algo ke ue possa fazer ke nao apareça no account manager e nem ke volta a vocaçao normal.

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

  • 0

1° vo passar meu vocations xml ta imcompleto mais da pra ter uma base

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="None" description="none" needpremium="0" gaincap="500" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
	   <vocation id="1" name="Master Sorcerer" description="a Master Sorcerer" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="1">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="2" name="Elder Druid" description="a Elder Druid" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="2">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="3" name="Royal Paladin" description="a Royal Paladin" needpremium="0" gaincap="200" gainhp="20" gainmana="30" gainhpticks="2" gainhpamount="1500" gainmanaticks="2" gainmanaamount="1300" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="3">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="4" name="Elite Knight" description="a Elite Knight" needpremium="0" gaincap="250" gainhp="30" gainmana="10" gainhpticks="1" gainhpamount="1700" gainmanaticks="2" gainmanaamount="800" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="4">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
	 <vocation id="5" name="Sorcerer" description="a Sorcerer" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="5">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
	    <vocation id="6" name="Druid" description="a Druid" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="6">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
	    <vocation id="7" name="Paladin" description="a Paladin" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="7">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
	    <vocation id="8" name="Knight" description="a Knight" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="8">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
	  <vocation id="9" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="9">
 <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
 <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
</vocations>

 

2° ta vendo entao kero saber como ke faço ke essa vocaçao nao apareça no account manager.

Link para o comentário
Compartilhar em outros sites

  • 0

mano nas vocaçao editada pra nao aparece no account manager voce colocar fromvoc 1 2 3 4 umas dessas que ai nao vai aparacer ficando assim as editada

 

 

<?xml version="1.0" encoding="UTF-8"?>

<vocations>

<vocation id="0" name="None" description="none" needpremium="0" gaincap="500" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="1" name="Master Sorcerer" description="a Master Sorcerer" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="1">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="2" name="Elder Druid" description="a Elder Druid" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="2">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="3" name="Royal Paladin" description="a Royal Paladin" needpremium="0" gaincap="200" gainhp="20" gainmana="30" gainhpticks="2" gainhpamount="1500" gainmanaticks="2" gainmanaamount="1300" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="4" name="Elite Knight" description="a Elite Knight" needpremium="0" gaincap="250" gainhp="30" gainmana="10" gainhpticks="1" gainhpamount="1700" gainmanaticks="2" gainmanaamount="800" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="4">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="5" name="Sorcerer" description="a Sorcerer" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="5">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="6" name="Druid" description="a Druid" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="6">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="7" name="Paladin" description="a Paladin" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="7">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="8" name="Knight" description="a Knight" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="8">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="9" name="Mixed Assassin" description="a Mixed Assassin" needpremium="0" gaincap="100" gainhp="10" gainmana="60" gainhpticks="2" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1500" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="4">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

</vocations>

 

Link para o comentário
Compartilhar em outros sites

  • 0

se quando reloga volta é necessario meio que fixar a storage da vocation assim, você primeiro pega a storage que cada player recebe ao adquirir o vip vocation vai no creature scripts/scripts e cria 4 arquivo eu fiz cada um com o nome "loginvoc e loginvoc2 e loginvoc3 loginvoc4"

 

e dentro eu coloco isso

function onLogin(cid)

vocstatus = getPlayerStorageValue(cid, 6006) -- mude conforme a storage de um das vocations no caso esse é do elder druid que vira high saintess

 

if vocstatus == 1 then

doPlayerSetVocation(cid, 9) -- esse é o numero da vocation que vai lá no vocations.xml creio que seja já o novo elder druid

 

return TRUE

else

return TRUE

end

end

Link para o comentário
Compartilhar em outros sites

  • 0

se quando reloga volta é necessario meio que fixar a storage da vocation assim, você primeiro pega a storage que cada player recebe ao adquirir o vip vocation vai no creature scripts/scripts e cria 4 arquivo eu fiz cada um com o nome "loginvoc e loginvoc2 e loginvoc3 loginvoc4"

 

e dentro eu coloco isso

function onLogin(cid)

vocstatus = getPlayerStorageValue(cid, 6006) -- mude conforme a storage de um das vocations no caso esse é do elder druid que vira high saintess

 

if vocstatus == 1 then

doPlayerSetVocation(cid, 9) -- esse é o numero da vocation que vai lá no vocations.xml creio que seja já o novo elder druid

 

return TRUE

else

return TRUE

end

end

 

 

ai mesmo que ele nao tenha falado com o npc ele vai virar vocation :S to trabalhando num aki aguarde

Link para o comentário
Compartilhar em outros sites

  • 0

sim você quem ira criar a storage...e no .xml voce coloca assim DIGAMOS

 

<event type="login" name="VocLogin" script="loginvoc.lua"/>

<event type="login" name="VocLogin2" script="loginvoc2.lua"/>

<event type="login" name="VocLogin3" script="loginvoc3.lua"/>

<event type="login" name="VocLogin4" script="loginvoc4.lua"/>

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...