Ir para conteúdo

Posts Recomendados

Só não consegui adicionar no 'login.lua':

-- ordered as in creaturescripts.xml
local events = {
	'TutorialCockroach',
	'ElementalSpheresOverlords',
	'BigfootBurdenVersperoth',
	'BigfootBurdenWarzone',
	'BigfootBurdenWeeper',
	'BigfootBurdenWiggler',
	'SvargrondArenaKill',
	'NewFrontierShardOfCorruption',
	'NewFrontierTirecz',
	'ServiceOfYalaharDiseasedTrio',
	'ServiceOfYalaharAzerus',
	'ServiceOfYalaharQuaraLeaders',
	'InquisitionBosses',
	'InquisitionUngreez',
	'KillingInTheNameOfKills',
	'MastersVoiceServants',
	'SecretServiceBlackKnight',
	'ThievesGuildNomad',
	'WotELizardMagistratus',
	'WotELizardNoble',
	'WotEKeeper',
	'WotEBosses',
	'WotEZalamon',
	'PlayerDeath',
	'AdvanceSave',
	'AdvanceRookgaard',
	'PythiusTheRotten',
	'DropLoot',
	'CriticalSystem'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
	local player = Player(cid)
	if not player then
		return true
	end

	local playerPosition = player:getPosition()
	if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
		player:setStorageValue(Storage.combatProtectionStorage, 0)
		return true
	end

	addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
	local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
	if player:getLastLoginSaved() <= 0 then
		loginStr = loginStr .. ' Please choose your outfit.'
		player:sendTutorial(1)
	else
		if loginStr ~= '' then
			player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
		end

		loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
	end
	player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

	local playerId = player.uid

	-- Stamina
	Game.getStorageValue("stamina")[playerId] = 0

	-- Promotion
	local vocation = player:getVocation()
	local promoted = player:isPromoted()
	if player:isPremium() then
		local value = player:getStorageValue(Storage.Promotion)
		if promoted and value ~= 1 then
			player:setStorageValue(Storage.Promotion, 1)
		elseif not promoted and value == 1 then
			player:setVocation(vocation:getPromotion())
		end
	elseif promoted then
		player:setVocation(vocation:getDemotion())
	end

	-- Events
	for i = 1, #events do
		player:registerEvent(events[i])
	end

	if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
		player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
		onMovementRemoveProtection(playerId, player:getPosition(), 10)
	end
	return true
end

  Em 06/06/2015 em 17:46, Fawz disse:

Tu instalou a lib certinho?

SIm, como vou saber se ta dando critical?

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654702
Compartilhar em outros sites

  Em 06/06/2015 em 18:04, curruwilliam disse:


-- ordered as in creaturescripts.xml

local events = {

'TutorialCockroach',

'ElementalSpheresOverlords',

'BigfootBurdenVersperoth',

'BigfootBurdenWarzone',

'BigfootBurdenWeeper',

'BigfootBurdenWiggler',

'SvargrondArenaKill',

'NewFrontierShardOfCorruption',

'NewFrontierTirecz',

'ServiceOfYalaharDiseasedTrio',

'ServiceOfYalaharAzerus',

'ServiceOfYalaharQuaraLeaders',

'InquisitionBosses',

'InquisitionUngreez',

'KillingInTheNameOfKills',

'MastersVoiceServants',

'SecretServiceBlackKnight',

'ThievesGuildNomad',

'WotELizardMagistratus',

'WotELizardNoble',

'WotEKeeper',

'WotEBosses',

'WotEZalamon',

'PlayerDeath',

'AdvanceSave',

'AdvanceRookgaard',

'PythiusTheRotten',

'DropLoot',

'CriticalSystem'

}

 

local function onMovementRemoveProtection(cid, oldPosition, time)

local player = Player(cid)

if not player then

return true

end

 

local playerPosition = player:getPosition()

if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then

player:setStorageValue(Storage.combatProtectionStorage, 0)

return true

end

 

addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)

end

 

function onLogin(player)

local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'

if player:getLastLoginSaved() <= 0 then

loginStr = loginStr .. ' Please choose your outfit.'

player:sendTutorial(1)

else

if loginStr ~= '' then

player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

end

 

loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))

end

player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

 

local playerId = player.uid

 

-- Stamina

Game.getStorageValue("stamina")[playerId] = 0

 

-- Promotion

local vocation = player:getVocation()

local promoted = player:isPromoted()

if player:isPremium() then

local value = player:getStorageValue(Storage.Promotion)

if promoted and value ~= 1 then

player:setStorageValue(Storage.Promotion, 1)

elseif not promoted and value == 1 then

player:setVocation(vocation:getPromotion())

end

elseif promoted then

player:setVocation(vocation:getDemotion())

end

 

-- Events

for i = 1, #events do

player:registerEvent(events)

end

 

if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then

player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)

onMovementRemoveProtection(playerId, player:getPosition(), 10)

end

 

-- Critical System

if player:getCriticalLevel() == -1 then

player:setCriticalLevel(0)

end

return true

end

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654706
Compartilhar em outros sites

Beleza, descobri.. acho que agora está tudo certo rep + :D

Tava chupando manga aqui, e tava colocando depois do return...


Acho que tem algo com problema, os players não leva dano de bixo nenhum.

 

@Edit

Aquela lib faz com que os player não leve dano de monstros..

Editado por curruwilliam
Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654708
Compartilhar em outros sites

  Em 06/06/2015 em 18:23, curruwilliam disse:

Beleza, descobri.. acho que agora está tudo certo rep + :D

Tava chupando manga aqui, e tava colocando depois do return...

Acho que tem algo com problema, os players não leva dano de bixo nenhum.

 

@Edit

Aquela lib faz com que os player não leve dano de monstros..

A mesma lib pertence a outro sistema,

O Dodge System que defende metade dos hits enquanto o Critical aumenta.

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654734
Compartilhar em outros sites

  Em 07/06/2015 em 01:02, Super Sonic disse:

deu erro aq tfs parou de funcionar

Tfs parou de funcionar não é um erro do script, para de funcionar quando você faz exatamente o que?

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654764
Compartilhar em outros sites

  Em 07/06/2015 em 12:57, shept disse:

amigo, deu um erro estranho.. tipo.. meus chares novos não recebem nenhum tipo de dano de monstros

eles são atacados, mas não recebem dano

Você ta usando no tfs 1.1 ou 1.2?

Você fez alguma alteração?

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654846
Compartilhar em outros sites

1.2, sem alterações que podem influenciar, minhas alterações na source são só de canal de loot e tal, não tem ligação... eu removi o creaturescript do seu sistema e meus chares voltarão a levar danos.

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654848
Compartilhar em outros sites

  Em 07/06/2015 em 14:26, shept disse:

1.2, sem alterações que podem influenciar, minhas alterações na source são só de canal de loot e tal, não tem ligação... eu removi o creaturescript do seu sistema e meus chares voltarão a levar danos.

Mas o creaturescript é o script em si.

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654849
Compartilhar em outros sites

  Em 07/06/2015 em 14:56, Bruno Minervino disse:

Mas o creaturescript é o script em si.

sim eu sei, mas eu removi pra ver se o bug era o seu script ou a minha source... e também desbugar meus chares pra mim fazer outras coisas

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654851
Compartilhar em outros sites

  Em 07/06/2015 em 15:06, shept disse:

sim eu sei, mas eu removi pra ver se o bug era o seu script ou a minha source... e também desbugar meus chares pra mim fazer outras coisas

Sim, eu entendo.

Gera algum erro no console ao usar o script?

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654854
Compartilhar em outros sites

  Em 06/06/2015 em 23:50, Bruno Minervino disse:

A mesma lib pertence a outro sistema,

O Dodge System que defende metade dos hits enquanto o Critical aumenta.

Então tenho que usar o outro sistema tbm ?

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654868
Compartilhar em outros sites

  Em 07/06/2015 em 16:26, curruwilliam disse:

Então tenho que usar o outro sistema tbm ?

Não...

Eu quis dizer que com a mesma lib você consegue usar o sistema Dodge também!

Ela serve para ambos.

Link para o comentário
https://xtibia.com/forum/topic/234508-tfs-1x-critical-system/page/2/#findComment-1654883
Compartilhar em outros sites

×
×
  • Criar Novo...