Ir para conteúdo

Second Promote Npc


139

Posts Recomendados

Tipo do script: Npc

Protocolo (versão do Tibia): 8.4

Servidor utilizado: Tfs

Nível de experiência: 0

Adicionais/Informações: ----

 

Eu quero 1 script de Second Promote Seller, se for pra postar o script sem ter testado não postem.

Eu já usei 300 scripts diferentes [ inclusive daqui do Xtibia também, e eu não sei porque tem sempre gente que fala que ta bom e não ta --' ] e sempre da o mesmo problema.

Envez de o player ganhar a vocation promovida e dar look em si mesmo e ver:

You see yourself. You are a Nome da vocação.

Aparece:

You see yourself. You are .

Eu não sei o que fazer...

Já usei todos os scripts daki do xtibia e todos dão o mesmo problema, quando funcionam..

 

Aqui está o meu vocations.xml talvez seja util mas não tem bug nele:

 

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="None" description="none" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="0">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="2.0"/>
	<skill id="2" multiplier="2.0"/>
	<skill id="3" multiplier="2.0"/>
	<skill id="4" multiplier="2.0"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="1" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="300" soulmax="100" gainsoulticks="120" fromvoc="1">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="2.0"/>
	<skill id="2" multiplier="2.0"/>
	<skill id="3" multiplier="2.0"/>
	<skill id="4" multiplier="2.0"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="2" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="300" soulmax="100" gainsoulticks="120" fromvoc="2">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="1.8"/>
	<skill id="2" multiplier="1.8"/>
	<skill id="3" multiplier="1.8"/>
	<skill id="4" multiplier="1.8"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="3" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="1.4" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="3">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.2"/>
	<skill id="1" multiplier="1.2"/>
	<skill id="2" multiplier="1.2"/>
	<skill id="3" multiplier="1.2"/>
	<skill id="4" multiplier="1.1"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="4" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="85" gainmanaticks="6" gainmanaamount="40" manamultiplier="3.0" attackspeed="400" soulmax="100" gainsoulticks="120" fromvoc="4">
	<formula meleeDamage="1.1" distDamage="1.0" defense="1.2" armor="1.0"/>
	<skill id="0" multiplier="1.1"/>
	<skill id="1" multiplier="1.1"/>
	<skill id="2" multiplier="1.1"/>
	<skill id="3" multiplier="1.1"/>
	<skill id="4" multiplier="1.4"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="5" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="1">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="2.0"/>
	<skill id="2" multiplier="2.0"/>
	<skill id="3" multiplier="2.0"/>
	<skill id="4" multiplier="2.0"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="6" name="Elder Druid" description="an elder druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="2">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="1.8"/>
	<skill id="2" multiplier="1.8"/>
	<skill id="3" multiplier="1.8"/>
	<skill id="4" multiplier="1.8"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="7" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="100" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="3">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.2"/>
	<skill id="1" multiplier="1.2"/>
	<skill id="2" multiplier="1.2"/>
	<skill id="3" multiplier="1.2"/>
	<skill id="4" multiplier="1.1"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="8" name="Elite Knight" description="an elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="100" gainmanaticks="4" gainmanaamount="100" manamultiplier="3.0" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="4">
	<formula meleeDamage="1.2" distDamage="1.0" defense="1.3" armor="1.1"/>
	<skill id="0" multiplier="1.1"/>
	<skill id="1" multiplier="1.1"/>
	<skill id="2" multiplier="1.1"/>
	<skill id="3" multiplier="1.1"/>
	<skill id="4" multiplier="1.4"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="9" name="Vulcan Sorcerer" description="a vulcan sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="150" gainmanaticks="2" gainmanaamount="150" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="1">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="2.0"/>
	<skill id="2" multiplier="2.0"/>
	<skill id="3" multiplier="2.0"/>
	<skill id="4" multiplier="2.0"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="10" name="Forest Druid" description="a forest druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="150" gainmanaticks="2" gainmanaamount="150" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="2">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.5"/>
	<skill id="1" multiplier="1.8"/>
	<skill id="2" multiplier="1.8"/>
	<skill id="3" multiplier="1.8"/>
	<skill id="4" multiplier="1.8"/>
	<skill id="5" multiplier="1.5"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="11" name="Storm Paladin" description="a thunder paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="130" gainmanaticks="3" gainmanaamount="170" manamultiplier="1.4" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="3">
	<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
	<skill id="0" multiplier="1.2"/>
	<skill id="1" multiplier="1.2"/>
	<skill id="2" multiplier="1.2"/>
	<skill id="3" multiplier="1.2"/>
	<skill id="4" multiplier="1.1"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
<vocation id="12" name="Mountain Knight" description="a mountain knight" gaincap="30" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="200" gainmanaticks="3" gainmanaamount="100" manamultiplier="3.0" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="4">
	<formula meleeDamage="1.5" distDamage="1.0" defense="1.5" armor="1.1"/>
	<skill id="0" multiplier="1.1"/>
	<skill id="1" multiplier="1.1"/>
	<skill id="2" multiplier="1.1"/>
	<skill id="3" multiplier="1.1"/>
	<skill id="4" multiplier="1.4"/>
	<skill id="5" multiplier="1.1"/>
	<skill id="6" multiplier="1.1"/>
</vocation>
</vocations>

 

Script do ultimo second promote que eu usei e também não deu certo :

 

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 = {5,6,7,8}

if(msgcontains(msg, 'second promote') or msgcontains(msg, 'SECOND PROMOTE')) then 
selfSay('Você quer ser promovido 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
setPlayerPromotion(cid)
selfSay('Parabens,você foi promovido !', cid) 
talkState[talkUser] = 0 
else 
selfSay('Você não tem ' .. price .. ' gps para ser promovido', cid) 
talkState[talkUser] = 0 
end
else
selfSay('Desculpe mais você não tem vocação paraser promovido.', 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())

 

Erro no exe. quando o player fica com voc bugada dps de comprar o second promote :

 

[07/01/2011 18:33:43] Warning: [Vocations::getVocation] Vocation 4294967295 not found.
[07/01/2011 18:33:43] Warning: [Vocations::getVocation] Vocation 4294967295 not found.
[07/01/2011 18:33:43] Warning: [Vocations::getVocation] Vocation 4294967295 not found.

 

Ja chequei o meu LIB também e esta certo.

Eu gostaria que o script funcionasse assim:

 

Se 1 player com voc Id 1 ou 5 falar com o npc e comprar a promote ele vai pro voc Id 9

 

Se 1 player com voc Id 2 ou 6 falar com o npc e comprar a promote ele vai pro voc Id 10

 

Se 1 player com voc Id 3 ou 7 falar com o npc e comprar a promote ele vai pro voc Id 11

 

Se 1 player com voc Id 4 ou 8 falar com o npc e comprar a promote ele vai pro voc Id 12

 

* Da pra fazer change vocation Id envez de Promote ? Acho que assim fica + fácil.

 

E que se ele tiver voc maior ou igual a 9 apareça a msg { você ja foi promovido } e é claro ele não ser promovido. Que é o que acontece com muitos scripts porque eles simplismente adicionam +4 na vocação do char que esta falando com ele (cid)

 

Não precisa por requetimento de level,money,premium nada !

 

Eu queria que alguem postasse o script de second promote direito, se o problema for nas minhas vocations [ provavelmente não se não daria erro no exe. ] eu agradeço se me disserem.

 

Tenho certeza de que se alguem conseguir elaborar o script ele irá ajudar muita gente que quer criar vocations ;x

Ficarei grato eternamente a quem postar o script :happy: [ REP + garantido ]

 

PS:

Eu sei que tem otimos scripters aqui e provavelmente não vão nem ler o topico...

Aproveitando o topico peço aos que quereem criar 1 server de "PokeTibia" que parem de postar seus milhares de pedidos que já tem resposta tipo : Sistema de m1 , m2 , m3 , m4 [que ja foram respondidos é só procurar ;# ] porque afinal de contas isso faz com que o Topico dos outros que é importante vá para o fim da lista de pedidos e não seja lido por quase ngm.

 

 

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

tenta:

 

<?xml version="1.0" encoding="UTF-8"?> 
<vocations> 
       <vocation id="0" name="None" description="none" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="0"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>  
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="2.0"/> 
               <skill id="2" multiplier="2.0"/> 
               <skill id="3" multiplier="2.0"/> 
               <skill id="4" multiplier="2.0"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="1" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="300" soulmax="100" gainsoulticks="120" fromvoc="1"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>  
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="2.0"/> 
               <skill id="2" multiplier="2.0"/> 
               <skill id="3" multiplier="2.0"/> 
               <skill id="4" multiplier="2.0"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="2" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="6" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="300" soulmax="100" gainsoulticks="120" fromvoc="2"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="1.8"/> 
               <skill id="2" multiplier="1.8"/> 
               <skill id="3" multiplier="1.8"/> 
               <skill id="4" multiplier="1.8"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="3" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="1.4" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="3"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.2"/> 
               <skill id="1" multiplier="1.2"/> 
               <skill id="2" multiplier="1.2"/> 
               <skill id="3" multiplier="1.2"/> 
               <skill id="4" multiplier="1.1"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="4" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="85" gainmanaticks="6" gainmanaamount="40" manamultiplier="3.0" attackspeed="400" soulmax="100" gainsoulticks="120" fromvoc="4"> 
               <formula meleeDamage="1.1" distDamage="1.0" defense="1.2" armor="1.0"/> 
               <skill id="0" multiplier="1.1"/> 
               <skill id="1" multiplier="1.1"/> 
               <skill id="2" multiplier="1.1"/> 
               <skill id="3" multiplier="1.1"/> 
               <skill id="4" multiplier="1.4"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="5" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="1"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="2.0"/> 
               <skill id="2" multiplier="2.0"/> 
               <skill id="3" multiplier="2.0"/> 
               <skill id="4" multiplier="2.0"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="6" name="Elder Druid" description="an elder druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="2"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="1.8"/> 
               <skill id="2" multiplier="1.8"/> 
               <skill id="3" multiplier="1.8"/> 
               <skill id="4" multiplier="1.8"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="7" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="100" gainmanaticks="3" gainmanaamount="100" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="3"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.2"/> 
               <skill id="1" multiplier="1.2"/> 
               <skill id="2" multiplier="1.2"/> 
               <skill id="3" multiplier="1.2"/> 
               <skill id="4" multiplier="1.1"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="8" name="Elite Knight" description="an elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="100" gainmanaticks="4" gainmanaamount="100" manamultiplier="3.0" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="4"> 
               <formula meleeDamage="1.2" distDamage="1.0" defense="1.3" armor="1.1"/> 
               <skill id="0" multiplier="1.1"/> 
               <skill id="1" multiplier="1.1"/> 
               <skill id="2" multiplier="1.1"/> 
               <skill id="3" multiplier="1.1"/> 
               <skill id="4" multiplier="1.4"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="9" name="Vulcan Sorcerer" description="a vulcan sorcerer" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="150" gainmanaticks="2" gainmanaamount="150" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="5"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="2.0"/> 
               <skill id="2" multiplier="2.0"/> 
               <skill id="3" multiplier="2.0"/> 
               <skill id="4" multiplier="2.0"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="10" name="Forest Druid" description="a forest druid" gaincap="10" gainhp="5" gainmana="25" gainhpticks="4" gainhpamount="150" gainmanaticks="2" gainmanaamount="150" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="6"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.5"/> 
               <skill id="1" multiplier="1.8"/> 
               <skill id="2" multiplier="1.8"/> 
               <skill id="3" multiplier="1.8"/> 
               <skill id="4" multiplier="1.8"/> 
               <skill id="5" multiplier="1.5"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="11" name="Storm Paladin" description="a thunder paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="130" gainmanaticks="3" gainmanaamount="170" manamultiplier="1.4" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="7"> 
               <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
               <skill id="0" multiplier="1.2"/> 
               <skill id="1" multiplier="1.2"/> 
               <skill id="2" multiplier="1.2"/> 
               <skill id="3" multiplier="1.2"/> 
               <skill id="4" multiplier="1.1"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
       <vocation id="12" name="Mountain Knight" description="a mountain knight" gaincap="30" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="200" gainmanaticks="3" gainmanaamount="100" manamultiplier="3.0" attackspeed="450" soulmax="200" gainsoulticks="15" fromvoc="8"> 
               <formula meleeDamage="1.5" distDamage="1.0" defense="1.5" armor="1.1"/> 
               <skill id="0" multiplier="1.1"/> 
               <skill id="1" multiplier="1.1"/> 
               <skill id="2" multiplier="1.1"/> 
               <skill id="3" multiplier="1.1"/> 
               <skill id="4" multiplier="1.4"/> 
               <skill id="5" multiplier="1.1"/> 
               <skill id="6" multiplier="1.1"/> 
       </vocation> 
</vocations>

Link para o comentário
Compartilhar em outros sites

Cara ja aconteceu isso comigo.

Com certeza teras que mudar isso no function:

 

Se for igual ao meu:

Copie e passe por cima do seu:

 

Quando voce ve as partes assim:

return (isInArray({1,5}, getPlayerVocation(cid)) == TRUE)

 

Falto algo ali, adivinhe, a vocação nova, o id dela: fica assim:

return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE)

No caso se o 9 for a promoção do ID 1, e do ID 5.

ID=1 sorcerer

ID=5 Master sorcerer

ID=9 Epic Sorcerer - tendeu!!??

 

function doPlayerGiveItem(cid, itemid, amount, subType)
local item = 0
if(isItemStackable(itemid) == TRUE) then
	item = doCreateItemEx(itemid, amount)
	if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then
		return LUA_ERROR
	end
else
	for i = 1, amount do
		item = doCreateItemEx(itemid, subType)
		if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then
			return LUA_ERROR
		end
	end
end

return LUA_NO_ERROR
end

function doPlayerTakeItem(cid, itemid, amount)
if(getPlayerItemCount(cid, itemid) < amount or doPlayerRemoveItem(cid, itemid, amount) ~= TRUE) then
	return LUA_ERROR
end

return LUA_NO_ERROR
end

function doPlayerBuyItem(cid, itemid, count, cost, charges)
if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then
	return LUA_ERROR
end

return doPlayerGiveItem(cid, itemid, count, charges)
end

function doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges)
if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then
	return LUA_ERROR
end

for i = 1, count do
	local container = doCreateItemEx(containerid, 1)
	for x = 1, getContainerCapById(containerid) do
		doAddContainerItem(container, itemid, charges)
	end

	if(doPlayerAddItemEx(cid, container, TRUE) ~= RETURNVALUE_NOERROR) then
		return LUA_ERROR
	end
end

return LUA_NO_ERROR
end

function doPlayerSellItem(cid, itemid, count, cost)
if(doPlayerTakeItem(cid, itemid, count) ~= LUA_NO_ERROR) then
	return LUA_ERROR
end

if(doPlayerAddMoney(cid, cost) ~= TRUE) then
	error('Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).')
end

return LUA_NO_ERROR
end

function isInRange(pos, fromPos, toPos)
return (pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z) and TRUE or FALSE
end

function isPremium(cid)
return (isPlayer(cid) == TRUE and (getPlayerPremiumDays(cid) > 0 or getConfigInfo('freePremium') == "yes")) and TRUE or FALSE
end

function getMonthDayEnding(day)
if day == "01" or day == "21" or day == "31" then
	return "st"
elseif day == "02" or day == "22" then
	return "nd"
elseif day == "03" or day == "23" then
	return "rd"
else
	return "th"
end
end

function getMonthString(m)
return os.date("%B", os.time{year = 1970, month = m, day = 1})
end

function getArticle(str)
return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a"
end

function isNumber(str)
return tonumber(str) ~= nil and TRUE or FALSE
end

function getDistanceBetween(firstPosition, secondPosition)
local xDif = math.abs(firstPosition.x - secondPosition.x)
local yDif = math.abs(firstPosition.y - secondPosition.y)

local posDif = math.max(xDif, yDif)
if(firstPosition.z ~= secondPosition.z) then
	posDif = posDif + 9 + 6
end
return posDif
end

function doPlayerAddAddons(cid, addon)
for i = 0, table.maxn(maleOutfits) do
	doPlayerAddOutfit(cid, maleOutfits[i], addon)
end

for i = 0, table.maxn(femaleOutfits) do
	doPlayerAddOutfit(cid, femaleOutfits[i], addon)
end
end

function isSorcerer(cid)
if(isPlayer(cid) == FALSE) then
	debugPrint("isSorcerer: Jogador nao encontrado.")
	return false
end

return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE)
end

function isDruid(cid)
if(isPlayer(cid) == FALSE) then
	debugPrint("isDruid: Jogador nao encontrado.")
	return false
end

return (isInArray({2,6,10}, getPlayerVocation(cid)) == TRUE)
end

function isPaladin(cid)
if(isPlayer(cid) == FALSE) then
	debugPrint("isPaladin: Jogador nao encontrado.")
	return false
end

return (isInArray({3,7,11}, getPlayerVocation(cid)) == TRUE)
end

function isKnight(cid)
if(isPlayer(cid) == FALSE) then
	debugPrint("isKnight: Jogador nao encontrado.")
	return false
end

return (isInArray({4,8,12}, getPlayerVocation(cid)) == TRUE)
end

function isRookie(cid)
if(isPlayer(cid) == FALSE) then
	debugPrint("isRookie: Jogador nao encontrado.")
	return false
end

return (isInArray({0}, getPlayerVocation(cid)) == TRUE)
end

function getDirectionTo(pos1, pos2)
local dir = NORTH
if(pos1.x > pos2.x) then
	dir = WEST
	if(pos1.y > pos2.y) then
		dir = NORTHWEST
	elseif(pos1.y < pos2.y) then
		dir = SOUTHWEST
	end
elseif(pos1.x < pos2.x) then
	dir = EAST
	if(pos1.y > pos2.y) then
		dir = NORTHEAST
	elseif(pos1.y < pos2.y) then
		dir = SOUTHEAST
	end
else
	if(pos1.y > pos2.y) then
		dir = NORTH
	elseif(pos1.y < pos2.y) then
		dir = SOUTH
	end
end
return dir
end

function getPlayerLookPos(cid)
return getPosByDir(getThingPos(cid), getPlayerLookDir(cid))
end

function getPosByDir(fromPosition, direction, size)
local n = size or 1

local pos = fromPosition
if(direction == NORTH) then
	pos.y = pos.y - n
elseif(direction == SOUTH) then
	pos.y = pos.y + n
elseif(direction == WEST) then
	pos.x = pos.x - n
elseif(direction == EAST) then
	pos.x = pos.x + n
elseif(direction == NORTHWEST) then
	pos.y = pos.y - n
	pos.x = pos.x - n
elseif(direction == NORTHEAST) then
	pos.y = pos.y - n
	pos.x = pos.x + n
elseif(direction == SOUTHWEST) then
	pos.y = pos.y + n
	pos.x = pos.x - n
elseif(direction == SOUTHEAST) then
	pos.y = pos.y + n
	pos.x = pos.x + n
end

return pos
end

function getPlayerMoney(cid)
return ((getPlayerItemCount(cid, ITEM_CRYSTAL_COIN) * 10000) + (getPlayerItemCount(cid, ITEM_PLATINUM_COIN) * 100) + getPlayerItemCount(cid, ITEM_GOLD_COIN))
end

function doPlayerWithdrawAllMoney(cid)
return doPlayerWithdrawMoney(cid, getPlayerBalance(cid))
end

function doPlayerDepositAllMoney(cid)
return doPlayerDepositMoney(cid, getPlayerMoney(cid))
end

function doPlayerTransferAllMoneyTo(cid, target)
return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid))
end

function playerExists(name)
return getPlayerGUIDByName(name) ~= 0
end

function getTibiaTime()
local minutes = getWorldTime()
local hours = 0
while (minutes > 60) do
	hours = hours + 1
	minutes = minutes - 60
end

return {hours = hours, minutes = minutes}
end

function doWriteLogFile(file, text)
local file = io.open(file, "a+")
file:write("[" .. os.date("%d/%m/%Y  %H:%M:%S") .. "] " .. text .. "\n")
file:close()
end

function getExperienceForLevel(lv)
lv = lv - 1
return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3
end

function doMutePlayer(cid, time)
local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_TICKS, time * 1000)
return doAddCondition(cid, condition)
end

function getPlayerVocationName(cid)
return getVocationInfo(getPlayerVocation(cid)).name
end

function getPromotedVocation(vid)
return getVocationInfo(vid).promotedVocation
end

function doPlayerRemovePremiumDays(cid, days)
return doPlayerAddPremiumDays(cid, -days)
end

function getPlayerMasterPos(cid)
return getTownTemplePosition(getPlayerTown(cid))
end

function getItemNameById(itemid)
return getItemDescriptionsById(itemid).name
end

function getItemPluralNameById(itemid)
return getItemDescriptionsById(itemid).plural
end

function getItemArticleById(itemid)
return getItemDescriptionsById(itemid).article
end

function getItemName(uid)
return getItemDescriptions(uid).name
end

function getItemPluralName(uid)
return getItemDescriptions(uid).plural
end

function getItemArticle(uid)
return getItemDescriptions(uid).article
end

function getItemText(uid)
return getItemDescriptions(uid).text
end

function getItemWriter(uid)
return getItemDescriptions(uid).writer
end

function getItemDate(uid)
return getItemDescriptions(uid).date
end

function getTilePzInfo(pos)
return getTileInfo(pos).protection and TRUE or FALSE
end

function getTileZoneInfo(pos)
local tmp = getTileInfo(pos)
if(tmp.pvp) then
	return 2
end

if(tmp.nopvp) then
	return 1
end

return 0
end

function debugPrint(text)
return io.stdout:write(text)
end

function doShutdown()
return doSetGameState(GAMESTATE_SHUTDOWN)
end

function doSummonCreature(name, pos)
local cid = doCreateMonster(name, pos)
if(cid ~= LUA_ERROR) then
	return cid
end

cid = doCreateNpc(name, pos)
return cid
end

function getOnlinePlayers()
local tmp = getPlayersOnline()
local players = {}
for i, cid in ipairs(tmp) do
	table.insert(players, getCreatureName(cid))
end

return players
end

function getPlayerByName(name)
local cid = getCreatureByName(name)
return isPlayer(cid) == TRUE and cid or nil
end

function isPlayerGhost(cid)
return isPlayer(cid) == TRUE and getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or FALSE
end

function doPlayerSetExperienceRate(cid, value)
return doPlayerSetRate(cid, SKILL__LEVEL, value)
end

function doPlayerSetMagicRate(cid, value)
return doPlayerSetRate(cid, SKILL__MAGLEVEL, value)
end

function getPlayerFrags(cid)
return math.ceil((getPlayerRedSkullTicks(cid) / getConfigInfo('timeToDecreaseFrags')) + 1)
end

function getPartyLeader(cid)
local party = getPartyMembers(cid)
if(type(party) ~= 'table') then
	return 0
end

return party[1]
end

function isInParty(cid)
return type(getPartyMembers(cid)) == 'table' and TRUE or FALSE
end

function isPrivateChannel(channelId)
for i = CHANNEL_GUILD, CHANNEL_HELP do
	if(channelId == i) then
		return FALSE
	end
end

return TRUE
end

function doConvertIntegerToIp(int, mask)
local b4 = bit.urshift(bit.uband(int, 4278190080), 24)
local b3 = bit.urshift(bit.uband(int, 16711680), 16)
local b2 = bit.urshift(bit.uband(int, 65280), 8)
local b1 = bit.urshift(bit.uband(int, 255), 0)
if(mask ~= nil) then
	local m4 = bit.urshift(bit.uband(mask,  4278190080), 24)
	local m3 = bit.urshift(bit.uband(mask,  16711680), 16)
	local m2 = bit.urshift(bit.uband(mask,  65280), 8)
	local m1 = bit.urshift(bit.uband(mask,  255), 0)
	if((m1 == 255 or m1 == 0) and (m2 == 255 or m2 == 0) and (m3 == 255 or m3 == 0) and (m4 == 255 or m4 == 0)) then
		if m1 == 0 then b1 = "x" end
		if m2 == 0 then b2 = "x" end
		if m3 == 0 then b3 = "x" end
		if m4 == 0 then b4 = "x" end
	elseif(m1 ~= 255 or m2 ~= 255 or m3 ~= 255 or m4 ~= 255) then
		return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4 .. " : " .. m1 .. "." .. m2 .. "." .. m3 .. "." .. m4
	end
end

return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4
end

function doConvertIpToInteger(str)
local maskindex = str:find(":")
if(maskindex == nil) then
	local ipint = 0
	local maskint = 0

	local index = 24		
	for b in str:gmatch("([x%d]+)%.?") do
		if(b ~= "x") then
			if(b:find("x") ~= nil) then
				return 0, 0
			end

			if(tonumber(b) > 255 or tonumber(b) < 0) then
				return 0, 0
			end

			maskint = bit.ubor(maskint, bit.ulshift(255, index))
			ipint = bit.ubor(ipint, bit.ulshift(b, index))
		end

		index = index - 8
		if(index < 0) then
			break
		end
	end

	if(index ~= -8) then
		return 0, 0
	end

	return ipint, maskint
end

if(maskindex <= 1) then
	return 0, 0
end

local ipstring = str:sub(1, maskindex - 1)
local maskstring = str:sub(maskindex)

local ipint = 0
local maskint = 0

local index = 0
for b in ipstring:gmatch("(%d+).?") do
	if(tonumber(b) > 255 or tonumber(b) < 0) then
		return 0, 0
	end

	ipint = bit.ubor(ipint, bit.ulshift(b, index))
	index = index + 8
	if(index > 24) then
		break
	end
end

if(index ~= 32) then
	return 0, 0
end

index = 0
for b in maskstring:gmatch("(%d+)%.?") do
	if(tonumber(b) > 255 or tonumber(b) < 0) then
		return 0, 0
	end

	maskint = bit.ubor(maskint, bit.ulshift(b, index))
	index = index + 8
	if(index > 24) then
		break
	end
end

if(index ~= 32) then
	return 0, 0
end

return ipint, maskint
end

function getBooleanFromString(str)
return (str:lower() == "yes" or str:lower() == "true" or (tonumber(str) and tonumber(str) > 0)) and TRUE or FALSE
end

function doCopyItem(item, attributes)
local attributes = attributes or FALSE

local ret = doCreateItemEx(item.itemid, item.type)
if(attributes == TRUE) then
	if(item.actionid > 0) then
		doSetItemActionId(ret, item.actionid)
	end
end

if(isContainer(item.uid) == TRUE) then
	for i = (getContainerSize(item.uid) - 1), 0, -1 do
		local tmp = getContainerItem(item.uid, i)
		if(tmp.itemid > 0) then
			doAddContainerItemEx(ret, doCopyItem(tmp, TRUE).uid)
		end
	end
end

return getThing(ret)
end

table.find = function (table, value)
for i, v in pairs(table) do
	if(v == value) then
		return i
	end
end

return nil
end

table.isStrIn = function (txt, str)
for i, v in pairs(str) do
	if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
		return true
	end
end

return false
end

table.countElements = function (table, item)
local count = 0
for i, n in pairs(table) do
	if(item == n) then
		count = count + 1
	end
end

return count
end

table.getCombinations = function (table, num)
local a, number, select, newlist = {}, #table, num, {}
for i = 1, select do
	a[#a + 1] = i
end

local newthing = {}
while(true) do
	local newrow = {}
	for i = 1, select do
		newrow[#newrow + 1] = table[a[i]]
	end

	newlist[#newlist + 1] = newrow
	i = select
	while(a[i] == (number - select + i)) do
		i = i - 1
	end

	if(i < 1) then
		break
	end

	a[i] = a[i] + 1
	for j = i, select do
		a[j] = a[i] + j - i
	end
end

return newlist
end

string.split = function (str)
local t = {}
local function helper(word)
	table.insert(t, word)
	return ""
end

if(not str:gsub("%w+", helper):find("%S")) then
	return t
end
end

string.trim = function (str)
return (string.gsub(str, "^%s*(.-)%s*$", "%1"))
end

string.explode = function (str, sep)
local pos, t = 1, {}
if #sep == 0 or #str == 0 then
	return
end

for s, e in function() return str:find(sep, pos) end do
	table.insert(t, str:sub(pos, s - 1):trim())
	pos = e + 1
end

table.insert(t, str:sub(pos):trim())
return t
end

 

E o meu second promotion:

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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



local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Primeira Promotion por 20k. Voce quer?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Agora voce tem a primeira promotion.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true})




local node2 = keywordHandler:addKeyword({'vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Promotion VIP por 500k. Voce quer?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 500000, level = 10, promotion = 2, text = 'Agora voce tem a VIP promotion.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true})

npcHandler:addModule(FocusModule:new())

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

×
×
  • Criar Novo...