Ir para conteúdo
  • 0

Nathan96

Pergunta

Ola galerinha do xtibia hoje venho aqui pedir um sistema que funcione claro :) para distro 0.3.6

Como o titulo já diz preciso um script que faça certo local de arena, ou então que arrume o script abaixo.

[spoiler]
pvpParcent = 2,
arenaFrom = {1250, 691, 6}, -- pvp arena from x,y,z position
arenaTo = {1260, 724, 6}, -- pvp arena to x,y,z position
}
function gainExperience(cid,lastHitKiller, mostDamageKiller)
if (isPlayer(lastHitKiller) and isPlayer(mostDamageKiller)) and (lastHitKiller ~= mostDamageKiller) then
	doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
	doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
	doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
	doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
elseif (isPlayer(lastHitKiller) and not(isPlayer(mostDamageKiller))) then
	doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
	doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
elseif (not(isPlayer(lastHitKiller)) and isPlayer(mostDamageKiller)) then  
	doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
	doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
end
end
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local playerPos = getPlayerPosition(cid)
local killerPos = getPlayerPosition(lastHitKiller)
if isPlayer(cid) then
	if (playerPos.x >= config.arenaFrom[1] and playerPos.x <= config.arenaTo[1]) and (playerPos.y >= config.arenaFrom[2] and playerPos.y <= config.arenaTo[2]) and (playerPos.z >= config.arenaFrom[3] and playerPos.z <= config.arenaTo[3]) then
		if (killerPos.x >= config.arenaFrom[1] and killerPos.x <= config.arenaTo[1]) and (killerPos.y >= config.arenaFrom[2] and killerPos.y <= config.arenaTo[2]) and (killerPos.z >= config.arenaFrom[3] and killerPos.z <= config.arenaTo[3]) then
			gainExperience(cid,lastHitKiller, mostDamageKiller)
		end
	end
end
	return TRUE
end

 

Erro

[spoiler]
[29/07/2012 16:36:35] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/pvparena.lua:2: unexpected symbol near '='
[29/07/2012 16:36:35] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/pvparena.lua)
[29/07/2012 16:36:35] data/creaturescripts/scripts/pvparena.lua:2: unexpected symbol near '='

Editado por Nathan96
Link para o comentário
Compartilhar em outros sites

12 respostass a esta questão

Posts Recomendados

  • 0
local config = {
       pvpParcent = 2,
       arenaFrom = {1250, 691, 6}, -- pvp arena from x,y,z position
       arenaTo = {1260, 724, 6}, -- pvp arena to x,y,z position
}
function gainExperience(cid,lastHitKiller, mostDamageKiller)
       if (isPlayer(lastHitKiller) and isPlayer(mostDamageKiller)) and (lastHitKiller ~= mostDamageKiller) then
               doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
               doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
               doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
               doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
       elseif (isPlayer(lastHitKiller) and not(isPlayer(mostDamageKiller))) then
               doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
               doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
       elseif (not(isPlayer(lastHitKiller)) and isPlayer(mostDamageKiller)) then  
               doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
               doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
       end
end
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
       local playerPos = getPlayerPosition(cid)
       local killerPos = getPlayerPosition(lastHitKiller)
       if isPlayer(cid) then
               if (playerPos.x >= config.arenaFrom[1] and playerPos.x <= config.arenaTo[1]) and (playerPos.y >= config.arenaFrom[2] and playerPos.y <= config.arenaTo[2]) and (playerPos.z >= config.arenaFrom[3] and playerPos.z <= config.arenaTo[3]) then
                       if (killerPos.x >= config.arenaFrom[1] and killerPos.x <= config.arenaTo[1]) and (killerPos.y >= config.arenaFrom[2] and killerPos.y <= config.arenaTo[2]) and (killerPos.z >= config.arenaFrom[3] and killerPos.z <= config.arenaTo[3]) then
                               gainExperience(cid,lastHitKiller, mostDamageKiller)
                       end
               end
       end
               return TRUE
end

Link para o comentário
Compartilhar em outros sites

  • 0

o thiago ta dando o seguinte erro i o player chega no 0 de hp i não morre

[spoiler]

[29/07/2012 17:18:53] [Error - CreatureScript Interface] 
[29/07/2012 17:18:53] data/creaturescripts/scripts/pvparena.lua:onPrepareDeath
[29/07/2012 17:18:53] Description: 
[29/07/2012 17:18:53] (luaGetThingPosition) Thing not found

[29/07/2012 17:18:53] [Error - CreatureScript Interface] 
[29/07/2012 17:18:53] data/creaturescripts/scripts/pvparena.lua:onPrepareDeath
[29/07/2012 17:18:53] Description: 
[29/07/2012 17:18:53] data/creaturescripts/scripts/pvparena.lua:25: attempt to index local 'killerPos' (a boolean value)
[29/07/2012 17:18:53] stack traceback:
[29/07/2012 17:18:53]  data/creaturescripts/scripts/pvparena.lua:25: in function <data/creaturescripts/scripts/pvparena.lua:20>

[29/07/2012 17:18:54] [Error - CreatureScript Interface] 
[29/07/2012 17:18:54] data/creaturescripts/scripts/pvparena.lua:onPrepareDeath
[29/07/2012 17:18:54] Description: 
[29/07/2012 17:18:54] (luaGetThingPosition) Thing not found

[29/07/2012 17:18:54] [Error - CreatureScript Interface] 
[29/07/2012 17:18:55] data/creaturescripts/scripts/pvparena.lua:onPrepareDeath
[29/07/2012 17:18:55] Description: 
[29/07/2012 17:18:55] data/creaturescripts/scripts/pvparena.lua:25: attempt to index local 'killerPos' (a boolean value)
[29/07/2012 17:18:55] stack traceback:
[29/07/2012 17:18:55]  data/creaturescripts/scripts/pvparena.lua:25: in function <data/creaturescripts/scripts/pvparena.lua:20>

Editado por Nathan96
Link para o comentário
Compartilhar em outros sites

  • 0

eu só tinha arrumado o script

 

na verdade não se usa mais lastHitKiller, se usa deathList[1]

 

oque eu não entendi é oq essa arena faz, me explica

Link para o comentário
Compartilhar em outros sites

  • 0

Kara eu quero exatamente o que a script acima faz só que ela não esta funcionando ;s

 

@Vodkart

È so pra quem morrer nesta aria ai perder skill,level, i etc, porque com o pz tool quando chega a 0 de hp é teletransportado para o templo i volta com full health and full mana

Editado por Nathan96
Link para o comentário
Compartilhar em outros sites

  • 0

para não contar Frags e perder o loot, skill, level tal como vc quer:

 

function onKill(cid, target)
local from,to = {x = 186, y = 54, z = 7},{x = 192, y = 60, z = 7}
if isPlayer(cid) and isPlayer(target) and isInRange(getCreaturePosition(cid), from, to) then
doCreatureSetSkullType(target, 3)
addEvent(doCreatureSetSkullType, 100, cid, 0)
end
return true
end

 

 

OBS: N PODE SER EM PVP TOOL

Editado por Vodkart
Link para o comentário
Compartilhar em outros sites

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