Ir para conteúdo
  • 0

[Bug] Player Compra Promotion 2 No Npc E Quando Desloga Ela Acaba


lorenzoh20

Pergunta

Galera quando os player do meu ot compram a promotion 2, funciona normalmente, porém ao deslogar essa promotion acaba, o que fazer? alguem em ajude por favor.

 

Valendo REP+ pra quem ajudar

 

OT 8.6

MYSQL

SITE

 

( Se precisar saber das vocations ou do npc da promotion eu mando )

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

tente usar esse script.



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}
local level = 100
if(msgcontains(msg, 'promote dois') or msgcontains(msg, 'second promotion')) 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 getPlayerLevel(cid) >= level then
if doPlayerRemoveMoney(cid,price) == TRUE then
setPlayerPromotionLevel(cid, 2)
selfSay('Parabens! Voce tem sua segunda promocao. ', cid)
talkState[talkUser] = 0
else
selfSay('Você não tem ' .. price .. ' gps para ser promovido', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, você precisa ter level '.. level .. ' ou mais para se promover!', cid)
talkState[talkUser] = 0
end
else
selfSay('Desculpe, mais você não possui a primeira promotion.', 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())

 

se continuar poste sua voc

Link para o comentário
Compartilhar em outros sites

  • 0

Vou tentar aqui, só abrir o ot, se não der vou postar as vocations, mais valeu assim mesmo desde já.

 

ae, ta escrito ai assim

local vocations = {5,6,7,8}

 

as minhas são 9,10,11 e 12 , é pra mudar?

Link para o comentário
Compartilhar em outros sites

  • 0

Coloca 3 aki ?

setPlayerPromotionLevel(cid, 2)

 

Eu não coloquei 3 em nenhum lugar apenas modifiquei para 9,10,11 e 12 e olhe no que deu:

13:31 The Forgotten King: Desculpe, mais você não possui a primeira promotion.

Link para o comentário
Compartilhar em outros sites

  • 0

maninho, o negócio é que a 1,2,3,4 não é promotion, a 5,6,7,8 é a 1ª promo e a 9,10,11 e 12 é a segunda promo :S

 

Mano, DESCULPE O NPC FUNCIONOU, MAS QUANDO DESLOGA VOLTA A SER MASTER SORCERER, ELDER DRUID, ETC, voce quer meu vocations.xml ?

Link para o comentário
Compartilhar em outros sites

  • 0

vai na lib/031-vocations mude pra isso.

 

 


function isSorcerer(cid)
return isInArray({1, 5}, getPlayerVocation(cid))
end

function isDruid(cid)
return isInArray({2, 6}, getPlayerVocation(cid))
end

function isPaladin(cid)
return isInArray({3, 7}, getPlayerVocation(cid))
end

function isKnight(cid)
return isInArray({4, 8}, getPlayerVocation(cid))
end
function isSorcerer(cid)
return isInArray({5, 9}, getPlayerVocation(cid))
end

function isDruid(cid)
return isInArray({6, 10}, getPlayerVocation(cid))
end

function isPaladin(cid)
return isInArray({7, 11}, getPlayerVocation(cid))
end

function isKnight(cid)
return isInArray({8, 12}, getPlayerVocation(cid))

Link para o comentário
Compartilhar em outros sites

  • 0

é pra mudar o meu fromvoc da vocations.xml ? olha ai

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="None" description="a criador de char" needpremium="0" gaincap="5" 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="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.1" attackspeed="1000" soulmax="100" gainsoulticks="120" 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="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.1" attackspeed="1000" soulmax="100" gainsoulticks="120" 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="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.4" attackspeed="1000" soulmax="100" gainsoulticks="120" 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="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="3.0" attackspeed="1000" soulmax="100" gainsoulticks="120" 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="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
 <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="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.1" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
 <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="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.4" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
 <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="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="3.0" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
 <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="9" name="Extrem Sorcerer" description="an extreme sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="30" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50">
 <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="10" name="Healing Druid" description="an healing druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="30" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
 <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="11" name="Assassin Paladin" description="an assassin paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="2" gainmanaamount="30" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
 <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="12" name="Killer Knight" description="an killer knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="10" gainmanaticks="2" gainmanaamount="30" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
 <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>
</vocations>

Link para o comentário
Compartilhar em outros sites

  • 0

o fromvoc seu a do druid e igual a do elder druid, axo que vc teria que por tpw assim

 

from voc sorc 1 master sorc 1 extreme sorc 1

from voc druid 2 elder druid 2 healing druid 2

from voc pala 3 royal pala 3 assassin paladin 3

from voc kina 4 elite kina 4 killer knight 4

 

axo que ficaria assim. tente mudar

Link para o comentário
Compartilhar em outros sites

  • 0

@Vodkart - Seguinte maninho, simplesmente quando o player paga a promotion, funciona de boa, dae quando ele desloga ele volta a ser master sorcerer, elder druid, etc

 

@tchubaka

 

vou tentar isso mais provavelmente não vai dar certo, não deu antes.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...