Ir para conteúdo

Featured Replies

Postado

tirei essas 3 linhas e o cast funciona na mesma e as magias voltaram a funcionar!

 

<event type="attack" name="castAttack" event="script" value="castSys.lua"/>
    <event type="statschange" name="castHits" event="script" value="castSys.lua"/>
    <event type="logout" name="castLogout" event="script" value="castSys.lua"/>

10 minutos atrás, Storm disse:

@bellatrikz Manda essa script de castHits aqui

 

o cast funciona porem se eu remover essas 3 linhas o espectador consegue atacar o player

 

<event type="attack" name="castAttack" event="script" value="castSys.lua"/>
    <event type="statschange" name="castHits" event="script" value="castSys.lua"/>
    <event type="logout" name="castLogout" event="script" value="castSys.lua"/>

 

ESSE E O SCRIPT QUE USO

 

--[[ Perfect Cast System 1.0 by Roksas ]]--

function onSay(cid, words, param)
local player = getPlayerByName(param)


if not isInArray({"list", "exit", "off", "on"}, param) and not param or param == "" then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "Enter the name of the player, which you want to cast in parameters.")
return true
end

if param == "on" then
if getPlayerStorageValue(cid, 10359) >= 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "Your Cast System is already running ONLINE!")
return true
end

castOn(cid)
doSendMagicEffect(getThingPos(cid), 39)
doPlayerSendTextMessage(cid, 20, "You have activated your Cast System, now others can cast you, to disable this feature, use the parameter '!cast off'.")
return true
end

if param == "off" then
if getPlayerStorageValue(cid, 10359) < 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "Your Cast System is already OFFLINE!")
return true
end

castOff(cid)
doSendMagicEffect(getThingPos(cid), 39)
doPlayerSendTextMessage(cid, 20, "You have disabled your Cast System, from now on no one can watch you, unless you turn on the Cast, using the parameter '!cast on'.")
return true
end

if param == "exit" then
if getPlayerStorageValue(cid, 12269) < 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "You no are casting players.")
return true
end

cancelCast(cid)
doSendMagicEffect(getThingPos(cid), 39)
doPlayerSendTextMessage(cid, 20, "You stopped casting, use the parameter '!cast list' to see who can be casted.")
return true
end

if param == "list" then

if #whoCasted() < 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "At this time, no player can be casted, try again later.")
return true
end

doPlayerSendTextMessage(cid, 20, "Players can be casteds:\n\n")
for k, v in ipairs(whoCasted()) do
doPlayerSendTextMessage(cid, 20, " - "..getCreatureName(v).."")
end            

return true
end

if not isPlayer(player) then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "This player is offline or does not exist. Use the parameter '!cast list' to see who can be casted.")
return true
end

if getPlayerStorageValue(player, 10359) < 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "You can only cast one person with the Cast System is activated, use the parameter '!cast list' to see who can be assisted.")
return true
end

if getPlayerStorageValue(cid, 10359) >= 1 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendTextMessage(cid, 20, "To cast a player, you must first disable your Cast System using the parameter '!cast off'.")
return true
end

if not getTileInfo(getThingPos(cid)).protection then
return doPlayerSendTextMessage(cid, 20, "You need enter in Protection Zone to use the Cast System.") and true
end

setPlayerStorageValue(cid, 12269, 1)
castPlayer(cid, player)
doSendMagicEffect(getThingPos(cid), 39)
doPlayerSendTextMessage(cid, 20, "You are casting the player "..getCreatureName(player)..", to exit just use the command '!cast exit'.")
doPlayerSendTextMessage(player, 20, "You are casted by "..getCreatureName(cid).." player to disable your Cast, simply use the parameter '!cast off'.")
return true
end

function cancelCast(uid)

mayNotMove(uid, false)
doCreatureSetHideHealth(uid, false)
setPlayerStorageValue(uid, 12269, -1)
doRemoveCondition(uid, CONDITION_OUTFIT)                                                
return doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) or doTeleportThing(uid, getPlayerMasterPos(uid)) and true
end

function castOn(uid)
return setPlayerStorageValue(uid, 10359, 1) and true
end

function castOff(uid)
return setPlayerStorageValue(uid, 10359, -1) and true
end

function castPlayer(uid, player)
if not isPlayer(player) then
cancelCast(uid)
return true
end

if getPlayerStorageValue(player, 10359) < 1 then
cancelCast(uid)
return true
end

if getPlayerStorageValue(uid, 12269) < 1 then
cancelCast(uid)
return true
end

mayNotMove(uid, true)
doSetItemOutfit(uid, 1934, -1)
doCreatureSetHideHealth(uid, true)
doTeleportThing(uid, getThingPos(player))
return addEvent(castPlayer, 1 * 1000, uid, player) and true
end

function whoCasted()
local casteds = {}

for _, pid in ipairs(getPlayersOnline()) do
if getPlayerStorageValue(pid, 10359) >= 1 then
table.insert(casteds, pid)
end
end

return #casteds > 0 and casteds or {}
end

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

  • Respostas 18
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

@bellatrikz NÃO recomendo que você use esse sistema, ele é cheio de bugs e de falhas, que vão prejudicar e não será pouco seu servidor. Mas de qualquer forma, eu tentei arrumar essa parte das spells de healing. Só mudar na script do creaturescripts:

function onLogout(cid)	
	if getPlayerStorageValue(cid, 12269) > 0 then
		doPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.")
		return false
	end
	
	setPlayerStorageValue(cid, 10359, -1)
	return true
end

function onStatsChange(cid, attacker, type, combat, value)	
	if getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) then
		return false
	end	
	return true
end

function onAttack(cid, target)	
	if not isPlayer(cid) or not isPlayer(target) then
		return true
	end	
	if getPlayerStorageValue(cid, 12269) > 0 then
		doRemoveCondition(cid, CONDITION_INFIGHT)
		return false
	end
	
	return true
end

 

De toda forma, recomendo você usar a TFS 0.4 que já tem um cast system implantado no servidor, melhor que essa gambiarra de sistema.

 

Postado
15 minutos atrás, Storm disse:

@bellatrikz NÃO recomendo que você use esse sistema, ele é cheio de bugs e de falhas, que vão prejudicar e não será pouco seu servidor. Mas de qualquer forma, eu tentei arrumar essa parte das spells de healing. Só mudar na script do creaturescripts:


function onLogout(cid)	
	if getPlayerStorageValue(cid, 12269) > 0 then
		doPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.")
		return false
	end
	
	setPlayerStorageValue(cid, 10359, -1)
	return true
end

function onStatsChange(cid, attacker, type, combat, value)	
	if getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) then
		return false
	end	
	return true
end

function onAttack(cid, target)	
	if not isPlayer(cid) or not isPlayer(target) then
		return true
	end	
	if getPlayerStorageValue(cid, 12269) > 0 then
		doRemoveCondition(cid, CONDITION_INFIGHT)
		return false
	end
	
	return true
end

 

De toda forma, recomendo você usar a TFS 0.4 que já tem um cast system implantado no servidor, melhor que essa gambiarra de sistema.

 

 

sabe como posso implementar esse sistema de cast da TFS 0.4 no meu servidor passo a passo?

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.6k

Informação Importante

Confirmação de Termo