DE
dúvida

bug vocaçao

Por Dersinho, 11 de out. de 2013 em Scripts

resolvido
script
18
1.8k
DersinhoD
11 de outubro de 2013 às 18:54

meu server tem um problema meu voc

 

 

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

<vocations>
<vocation id="0" clientId="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no" droploot="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" clientId="3" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="900" 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" clientId="4" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.1" attackspeed="900" 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" clientId="2" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="1.4" attackspeed="900" 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.5" club="1.2" sword="1.2" axe="1.1" distance="1.5" shielding="1.3" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="4" clientId="1" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="50" gainmanaticks="6" gainmanaamount="50" manamultiplier="3.0" attackspeed="900" 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" clientId="3" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="800" 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" clientId="4" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="800" 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" clientId="2" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.4" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.2" sword="1.2" axe="1.2" distance="1.3" shielding="1.2" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="8" clientId="1" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
<formula meleeDamage="1.2" 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.2" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="9" clientId="1" name="Warlock" description="Warlock" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="5" 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="10" clientId="2" name="Chanter" description="Chanter" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="6" 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="11" clientId="3" name="Sentinel" description="Sentinel" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="50" gainmanaticks="2" gainmanaamount="50" manamultiplier="1.4" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.2" sword="1.2" axe="1.2" distance="1.3" shielding="1.2" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="12" clientId="4" name="Templar" description="Templar" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="30">
<formula meleeDamage="1.2" 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.2" fishing="1.1" experience="1.0"/>
</vocation>
</vocations>

 

local config = {
loginMessage = getConfigValue('loginMessage')
}
function onLogin(cid)
voc = getPlayerStorageValue(cid, 7123)
if voc ~= -1 then
doPlayerSetVocation(cid, voc)
end
return true
end
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "demonOakAttack")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "PythiusDead")
registerCreatureEvent(cid, "KillRank")
registerCreatureEvent(cid, "RankSystem")
registerCreatureEvent(cid, "fullmh")
registerCreatureEvent(cid, "Aura")
registerCreatureEvent(cid, "DeathList")
registerCreatureEvent(cid, "TiraBattle")
registerCreatureEvent(cid, "TempleTeleporter")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0)
end
setPlayerStorageValue(cid, 42350, 0)
setPlayerStorageValue(cid, 42352, 0)
function onLogin(cid)
if isVip(cid) == TRUE then
if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)+4)
end
elseif isVip(cid) == FALSE then
if(isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
end
end
return TRUE
end
if getPlayerStorageValue(cid, 13500) > os.time() then
if getPlayerStorageValue(cid, 122131) == 1 and isInArray({ 5, 6, 7, 8 }, getPlayerVocation(cid)) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
end
else
if isInArray({ 9, 10, 11, 12 }, getPlayerVocation(cid)) then
doPlayerSetVocation(cid, getPlayerVocation(cid)-4)
end
end
return TRUE
end
bom compro a pronmote viro a evoluçao e quando deslogo o char volta a ser elder druid alguem sabe pode me ajuda? asim que posivel dou rep+ ou para ganhar nova vocaçao so de ser vip uso o systema de vip monks storage 13500

Editado Outubro 11 por Dersinho

KilluaK
11 de outubro de 2013 às 19:34

Isso eh facil de arrumar, me diz, como faz pra pegar essa evolucao no seu server? Eh alguma action ou npc? Poste aqui o script responsavel por evoluir o player.

DersinhoD
11 de outubro de 2013 às 19:42

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Newvoc" script="data/npc/scripts/npcvip.lua" walkinterval="1000" floorchange="1">
<health now="100" max="100"/>
<look type="302" head="114" body="114" legs="200" feet="114" addons="3"/>
<parameters>
<parameter key="message_greet" value="Deseja virar nova prof? "/>
</parameters>
</npc>

 

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, 'yes') or msgcontains(msg, 'sim')) then
selfSay('Diga newvoc.', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'newvoc') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 2160) >= 100) then
doPlayerRemoveItem(cid, 2160, 100)
doPlayerSetVocation(cid, 10)
selfSay('Agora você possui a nova vocação!', cid)
else
selfSay('Você não tem dinheiro!', cid)
end
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
se ajudar uso o vip monks
KilluaK
11 de outubro de 2013 às 19:50

Nossa pelo que vi, esse seu cript transforma qualquer vocacao na vocacao 10... Mas vou me limitar a responder o seu pedido.

 

Debaixo de

doPlayerSetVocation(cid,10)

Coloque

setPlayerStorageValue(cid, 54521, 1)

No login.lua, adicione essa linha:

if getPlayerStorageValue(cid, 54521) == 1 then
doPlayerSetVocation(cid, 10)
end
DersinhoD
11 de outubro de 2013 às 19:58

nossa eu nao entendo minha vocaçao ta la em cima eu so quero que ele vire chandra e nao saia quando eu deslogo vo testa esse que vc me passo entao ...

 

so uma pergunta ali ele sempre vai vira vocaçao 10 ?

Editado Outubro 11 por Dersinho

KilluaK
11 de outubro de 2013 às 20:04

nossa eu nao entendo minha vocaçao ta la em cima eu so quero que ele vire chandra e nao saia quando eu deslogo vo testa esse que vc me passo entao ...

 

so uma pergunta ali ele sempre vai vira vocaçao 10 ?

 

Sim, ele pode ser Knight, Elite Knight, Master Sorcerer, Paladin, qualquer voc e vai se transformar na voc 10.

 

Outra coisa, vejo que vc ta tendo problema com os Quotes. Na hora de postar o script, selecione ele todo e clique em "Codigo" na barra de edicao.

DersinhoD
11 de outubro de 2013 às 20:06

vlw pela dica to querendo aprende fiquei se matando com isso hj o dia todo ...

agora o char permanece chanter mais eu quero que cada um vire sua vocaçao elevada vc poderia ageitaar esse script plx ?

KilluaK
11 de outubro de 2013 às 20:08

Sim, mas nao gosto de fazer NPCs, pode ser por action? Por exemplo, vc da use em um item e vira a vocacao nova.

DersinhoD
11 de outubro de 2013 às 20:18

akele npc ali esta funcionando so que so falta tira akele erro que vc falo

eu so quero que ele evolua a classe dele druid , elder druid , chanter ,sorcerer ,marster ,warlock

ajuda?

KilluaK
11 de outubro de 2013 às 20:38

NPC:


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, 'yes') or msgcontains(msg, 'sim')) then
selfSay('Diga newvoc.', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'newvoc') and talkState[talkUser] == 1) then
if isInArray({5,6,7,8}, getPlayerVocation(cid)) then
if(getPlayerItemCount(cid, 2160) >= 100) then
doPlayerRemoveItem(cid, 2160, 100)
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
setPlayerStorageValue(cid, 45211, 1)
selfSay('Agora você possui a nova vocação!', cid)
else
selfSay('Você não tem dinheiro!', cid)
end
else
selfSay('Voce precisa ser Master Sorcerer, Elder Druid, Royal Paladin ou Elite Kight para ganhar a vocação nova!', cid)
end
talkState[talkUser] = 0
end
return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

login.lua


if getPlayerStorageValue(cid, 45211, 1) then
    local votat = getPlayerVocation(cid)
    if votat == 1 or votat == 5 then
        doPlayerSetVocation(cid, 9)
    elseif votat == 2 or votat == 6 then
        doPlayerSetVocation(cid, 10)
    elseif votat == 3 or votat == 7 then
        doPlayerSetVocation(cid, 11)
    elseif votat == 4 or votat == 8 then
        doPlayerSetVocation(cid, 12)
    end
end

Editado Outubro 11 por amoeba13

DersinhoD
11 de outubro de 2013 às 20:56

tu e problema mesmo continue asim se eu fose abilidoso ia criarum monte, ideia e o que nao me falta ! vc esta de parabens pode mover

KilluaK
11 de outubro de 2013 às 21:03

Obrigado, reportado para moverem.

DersinhoD
11 de outubro de 2013 às 21:13

desculpa aconteceu um erro

 

eu retirei isso

 

if getPlayerStorageValue(cid, 54521) == 1 then
doPlayerSetVocation(cid, 10)
end
e agora quando deslogo mesmo sendo vip ele perde a vocaçao
KilluaK
11 de outubro de 2013 às 21:24

Sim era pra tirar isso mesmo. Eu mudei o storage, talvez seja por isso. Tente pegar a vocacao denovo com o NPC, se nao der, tente com outro char e faca o teste.

DersinhoD
11 de outubro de 2013 às 21:36
11/10/2013 21:34:42] [Error - CreatureScript Interface]

[11/10/2013 21:34:42] data/creaturescripts/scripts/login.lua:onLogin

[11/10/2013 21:34:42] Description:

[11/10/2013 21:34:42] (luaGetCreatureStorage) Creature not found

[11/10/2013 21:35:00] Pop has logged out.

[11/10/2013 21:35:00] Pop has logged in.


[11/10/2013 21:35:00] [Error - CreatureScript Interface]

[11/10/2013 21:35:00] data/creaturescripts/scripts/login.lua:onLogin

[11/10/2013 21:35:00] Description:

[11/10/2013 21:35:00] (luaGetCreatureStorage) Creature not found


fiz no char vip e tbm deu na mesma uso vip by monks storage vip 13500 se ajuda aguardando


UMA COISA DA UMA OLHADA LA NO MEU VOCAÇAO VE SE TA CERTO LA NAO E UM ERRO LA TALVES ?

nao tenho ideia de como configurar fronvoc nem client id segui uma logica la mais nao sei se ta muito certo aguardando...

Editado Outubro 11 por Dersinho