Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

trunk.r3884

Qual o motivo deste tópico? 

ao morrer ou deslogar char perde vocação!

uso esse script para mudar a vocação

Citar

local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
-- Goku
[1] = { 30, 2, 69, 32}, 
[2] = { 50, 4, 37, 32},
[4] = { 75, 5, 18, 32},
[5] = { 100, 6, 71, 32}
[6] = { 150, 8, 70, 32},
[8] = { 180, 9, 367, 32},
[9] = { 200, 10, 366, 32},

}
function onSay(cid, words, param, channel)
local voc = config[getPlayerVocation(cid)]
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!")
doCreatureSay(cid, "Transformar", 19)
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
end
else
doPlayerSendCancel(cid, "Nao é possível se transformar.")
end
return true
end

esse é meu vocation.xml

Citar

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="None" needpremium="0" gaincap="0" gainhp="350" gainmana="500" gainhpticks="1" gainhpamount="1000" gainmanaticks="1" gainmanaamount="1000" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="1" fromvoc="0" attackable="no">
    <formula meleeDamage="1000.0" distDamage="1000.0" wandDamage="1.0" magDamage="100.0" magHealingDamage="100.0" defense="100.0" magDefense="100.0" armor="100.0"/>
    <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    
<!-- Goku -->
    <vocation id="1" name="Goku" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2"  gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15"  fromvoc="1">
        <formula meleeDamage="0.1" distDamage="0.1" wandDamage="0.1" magDamage="0.8" magHealingDamage="0.5" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Goku Teen" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.1" distDamage="0.2" wandDamage="0.2" magDamage="0.9" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Goku Kaioken" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.2" distDamage="0.2" wandDamage="0.2" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Goku SSJ" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.3" distDamage="0.3" wandDamage="0.3" magDamage="1.2" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Goku USSJ" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.4" distDamage="0.4" wandDamage="0.4" magDamage="1.3" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Goku SSJ2" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.5" distDamage="0.5" wandDamage="0.5" magDamage="1.4" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Gogeta [Goku]" description="Gogeta" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.5" distDamage="0.5" wandDamage="0.5" magDamage="1.5" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Goku SSJ3" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.6" distDamage="0.6" wandDamage="0.6" magDamage="1.6" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Goku Final Z" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.7" distDamage="0.6" wandDamage="0.6" magDamage="1.7" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Goku SSJ Final Z" description="Goku" needpremium="0" gaincap="100" gainhp="200" gainmana="300" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="100" manamultiplier="1.1" attackspeed="1200" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="0.8" distDamage="0.7" wandDamage="0.7" magDamage="1.8" 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.1" shielding="1.1" fishing="1.0" experience="1.0"/>
    </vocation>
</vocations>

 

Editado por Ryzek (veja o histórico de edições)

  • Respostas 5
  • Visualizações 649
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vodkart esse comando com storage eu tentei mas não funcionou pra mim, mas resolvi de outra maneira, no fromvoc do vocations.xml eu deixei todas com seus respectivos ID's porém agora o acc manager apar

Postado
  • Autor
Citar

local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

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) .. "."
        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, "SkullCheck")
    registerCreatureEvent(cid, "NoPartyAttack")
    registerCreatureEvent(cid, "TiraBattle")
    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
    registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "Reward")
    end
    registerCreatureEvent(cid, "FullHpMana")
    registerCreatureEvent(cid, "AdvanceSave")
    registerCreatureEvent(cid, "ZombieAttack")
    registerCreatureEvent(cid, "BlessCheck")
    registerCreatureEvent(cid, "advance")
    registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "Outfit")
    registerCreatureEvent(cid, "Voc")
    registerCreatureEvent(cid, "FragReward")
    registerCreatureEvent(cid, "Niwdeath")
    registerCreatureEvent(cid, "AdvanceSave")
    registerCreatureEvent(cid, "LevelRecompense")
    registerCreatureEvent(cid, "BoasVindas")
    registerCreatureEvent(cid, "BroadDeath")
    registerCreatureEvent(cid, "SaveStamina")
    registerCreatureEvent(cid, "AmoebaTask")
    registerCreatureEvent(cid, "killboss")
    registerCreatureEvent(cid, "Busque")
    registerCreatureEvent(cid, "BlessedPlayer")
    --------- SHOP ---------
    --registerCreatureEvent(cid, "VocGoku")
    --registerCreatureEvent(cid, "VocShenron")
    --registerCreatureEvent(cid, "VocVegetto")
    --registerCreatureEvent(cid, "VocTapion")
    --registerCreatureEvent(cid, "VocKame")
    --registerCreatureEvent(cid, "VocKagome")
    --registerCreatureEvent(cid, "VocKingVegeta")
    --registerCreatureEvent(cid, "VocZaiko")
    --registerCreatureEvent(cid, "VocChilled")
    --registerCreatureEvent(cid, "VocBills")
    --registerCreatureEvent(cid, "NoPartyAttack")
    registerCreatureEvent(cid, "RemovedorDeFrags")
    --------------- REFLECT ----------------
    registerCreatureEvent(cid, "Reflect")
    if getPlayerStorageValue(cid, 3482101) ~= 0 then
    setPlayerStorageValue(cid, 3482101, 0) 
    end
return true
end

 

Postado

talk

 

local config = {
	--[vocation id] = { level, nova voc, looktype, efeito}
	-- Goku
	[1] = { 30, 2, 69, 32}, 
	[2] = { 50, 4, 37, 32},
	[4] = { 75, 5, 18, 32},
	[5] = { 100, 6, 71, 32}
	[6] = { 150, 8, 70, 32},
	[8] = { 180, 9, 367, 32},
	[9] = { 200, 10, 366, 32},
	
}
function onSay(cid, words, param, channel)
	local voc = config[getPlayerVocation(cid)]
	if voc then
		if getPlayerLevel(cid) >= voc[1] then
			doPlayerSetVocation(cid, voc[2])
			setPlayerStorageValue(cid, 787548, voc[2])
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!")
			doCreatureSay(cid, "Transformar", 19)
			local outfit = {lookType = voc[3]}
			doCreatureChangeOutfit(cid, outfit)
			doSendMagicEffect(getCreaturePosition(cid), voc[4])
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
		end
	else
		doPlayerSendCancel(cid, "Nao é possível se transformar.")
	end
	return true
end

 

 

 

Login.lua

 

local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

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) .. "."
		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, "SkullCheck")
	registerCreatureEvent(cid, "NoPartyAttack")
	registerCreatureEvent(cid, "TiraBattle")
	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
		registerCreatureEvent(cid, "Reward")
	end
	registerCreatureEvent(cid, "FullHpMana")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "ZombieAttack")
	registerCreatureEvent(cid, "BlessCheck")
	registerCreatureEvent(cid, "advance")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "Outfit")
	registerCreatureEvent(cid, "Voc")
	registerCreatureEvent(cid, "FragReward")
	registerCreatureEvent(cid, "Niwdeath")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "LevelRecompense")
	registerCreatureEvent(cid, "BoasVindas")
	registerCreatureEvent(cid, "BroadDeath")
	registerCreatureEvent(cid, "SaveStamina")
	registerCreatureEvent(cid, "AmoebaTask")
	registerCreatureEvent(cid, "killboss")
	registerCreatureEvent(cid, "Busque")
	registerCreatureEvent(cid, "BlessedPlayer")
	--------- SHOP ---------
	--registerCreatureEvent(cid, "VocGoku")
	--registerCreatureEvent(cid, "VocShenron")
	--registerCreatureEvent(cid, "VocVegetto")
	--registerCreatureEvent(cid, "VocTapion")
	--registerCreatureEvent(cid, "VocKame")
	--registerCreatureEvent(cid, "VocKagome")
	--registerCreatureEvent(cid, "VocKingVegeta")
	--registerCreatureEvent(cid, "VocZaiko")
	--registerCreatureEvent(cid, "VocChilled")
	--registerCreatureEvent(cid, "VocBills")
	--registerCreatureEvent(cid, "NoPartyAttack")
	registerCreatureEvent(cid, "RemovedorDeFrags")
	--------------- REFLECT ----------------
	registerCreatureEvent(cid, "Reflect")
	if getPlayerStorageValue(cid, 3482101) ~= 0 then
		setPlayerStorageValue(cid, 3482101, 0) 
	end
	if getPlayerStorageValue(cid, 787548) > 0 then
		doPlayerSetVocation(cid, getPlayerStorageValue(cid, 787548))
	end
	return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

Vodkart esse comando com storage eu tentei mas não funcionou pra mim, mas resolvi de outra maneira, no fromvoc do vocations.xml eu deixei todas com seus respectivos ID's porém agora o acc manager aparece as vocações duplicadas, então entrei nas sources e removi ao dar look o nome da vocação e add nas proximas vocações o nome das outras vocações para que o acc manager possa oferecer as vocações corretas... Obrigado pela ajuda.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo