Ir para conteúdo

Featured Replies

Postado

Script 1

function onUse(cid, item, item2, topos, frompos) 
local config = {
    time = 59,       -- Tempo em minutos para usar novamente
    level = 2,      -- Level minimo para dar USE 
    storage = 42007, -- Storagevalue do tempo para usar novamente
	item1 = 0000,	--arma que precisa dar use
	item2 = 0000,	--arma que vai se transformar
    efeito = 28      -- Efeito que vai fazer qndo a quest for feita
} 

    if getPlayerLevel(cid) <= config.level then 
        return doPlayerSendCancel(cid, "You do not have enough level to use this.") 
    end

    if getPlayerStorageValue(cid, config.storage) > os.time() then 
	local minutes = (math.ceil((getPlayerStorageValue(cid, config.storage) - os.time())/60))
	local s = (math.ceil(((getPlayerStorageValue(cid, config.storage) - os.time())/60)) == 1 and "" or "s")
       return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. minutes .." minute".. s .." to use again.") 
    end

    pos = getThingPos(cid) 
    if getPlayerItem(cid, item1) >= 1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You changed weapon.")
      	doPlayerRemoveItem(cid, item1, 1)
        doSendMagicEffect(pos, config.efeito)
        setPlayerStorageValue(cid, config.storage, config.time * 60 + os.time())
        doPlayerAddItem(cid, item2, 1)
     else
     	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You no have this item.") 
   return true
     end
end

TAG em action.xml

<action actionid="ID_DO_ITEM" event="script" value="LOCAL_DO_ARQUIVO.lua"/>

 

Agora vai em items.xml, lá na Tag do item que você quer q ele se transforme e adicione as seguintes tags nele:

<attribute key="decayTo" value="XXXXX"/>
<attribute key="duration" value="300"/>

DecayTO = XXXX (id do item que ele irá voltar após certo tempo

duration = duração em segundos

 

fazendo isso, é a melhor maneira para não dar erros.

 

 

--------------------------------------------------------------------------------------------------------------------

Script 2

 

Em items.xml vai na tag do crossbow, remove tudo, deixando apenas o nome e o peso do mesmo e adiciona isso:

		<attribute key="weaponType" value="distance"/>
		<attribute key="attack" value="72"/>
		<attribute key="maxHitChance" value="91"/>
		<attribute key="slotType" value="two-handed"/>
		<attribute key="shootType" value="holy"/>
		<attribute key="range" value="7"/>

Bem, algumas versões 860 não possui type: Holy ou nenhuma outra que seja parecida.

Caso acuse algum erro primeiramente troque o ShootType, pode ser death ou earth por exemplo, faça o teste.

 

 

--------------------------------------------------------------------------------------------------------------------

Script 3

 

Em data/weapons/scripts crie um arquivo .lua e adicione:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

 

Configure

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

os 2 primeiros 1, 0 = ml

os 2 ultimos 1, 0 = level

 

vai configurando e testando até achar que ficou bom a jogabilidade de seu servidor.

 

Agora em weapon.xml procure pelo ID do crossbow que você vai usar e altere apenas o local

de:

value="default">

para o local do arquivo EXEMPLO:

value="xxxx.lua">

 

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

  • Respostas 7
  • Visualizações 994
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
6 horas atrás, Weslley Kiyo disse:

Script 1


function onUse(cid, item, item2, topos, frompos) 
local config = {
    time = 59,       -- Tempo em minutos para usar novamente
    level = 2,      -- Level minimo para dar USE 
    storage = 42007, -- Storagevalue do tempo para usar novamente
	item1 = 0000,	--arma que precisa dar use
	item2 = 0000,	--arma que vai se transformar
    efeito = 28      -- Efeito que vai fazer qndo a quest for feita
} 

    if getPlayerLevel(cid) <= config.level then 
        return doPlayerSendCancel(cid, "You do not have enough level to use this.") 
    end

    if getPlayerStorageValue(cid, config.storage) > os.time() then 
	local minutes = (math.ceil((getPlayerStorageValue(cid, config.storage) - os.time())/60))
	local s = (math.ceil(((getPlayerStorageValue(cid, config.storage) - os.time())/60)) == 1 and "" or "s")
       return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. minutes .." minute".. s .." to use again.") 
    end

    pos = getThingPos(cid) 
    if getPlayerItem(cid, item1) >= 1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You changed weapon.")
      	doPlayerRemoveItem(cid, item1, 1)
        doSendMagicEffect(pos, config.efeito)
        setPlayerStorageValue(cid, config.storage, config.time * 60 + os.time())
        doPlayerAddItem(cid, item2, 1)
     else
     	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You no have this item.") 
   return true
     end
end

TAG em action.xml


<action actionid="ID_DO_ITEM" event="script" value="LOCAL_DO_ARQUIVO.lua"/>

 

Agora vai em items.xml, lá na Tag do item que você quer q ele se transforme e adicione as seguintes tags nele:


<attribute key="decayTo" value="XXXXX"/>
<attribute key="duration" value="300"/>

DecayTO = XXXX (id do item que ele irá voltar após certo tempo

duration = duração em segundos

 

fazendo isso, é a melhor maneira para não dar erros.

 

 

--------------------------------------------------------------------------------------------------------------------

Script 2

 

Em items.xml vai na tag do crossbow, remove tudo, deixando apenas o nome e o peso do mesmo e adiciona isso:


		<attribute key="weaponType" value="distance"/>
		<attribute key="attack" value="72"/>
		<attribute key="maxHitChance" value="91"/>
		<attribute key="slotType" value="two-handed"/>
		<attribute key="shootType" value="holy"/>
		<attribute key="range" value="7"/>

Bem, algumas versões 860 não possui type: Holy ou nenhuma outra que seja parecida.

Caso acuse algum erro primeiramente troque o ShootType, pode ser death ou earth por exemplo, faça o teste.

 

 

--------------------------------------------------------------------------------------------------------------------

Script 3

 

Em data/weapons/scripts crie um arquivo .lua e adicione:


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

 

Configure

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

os 2 primeiros 1, 0 = ml

os 2 ultimos 1, 0 = level

 

vai configurando e testando até achar que ficou bom a jogabilidade de seu servidor.

 

Agora em weapon.xml procure pelo ID do crossbow que você vai usar e altere apenas o local

de:


value="default">

para o local do arquivo EXEMPLO:


value="xxxx.lua">

 

 

 

 

Pow.. botei tudo no servidor, dai ele fica alguns segundos on e depois fecha sozinho..

O primeiro script não funcionou, o segundo chegou a funcionar mas ele não deixa o poison de Holy ;-; e o terceiro ele ataca normalmente mas só ataca o bicho que eu mirei pra ele atacar..

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