Jump to content

Scripting Castle não esta salvando guild dominante


Go to solution Solved by FlameArcixt,

Recommended Posts

Estou usando OTX.

Fala galera,

Estou com um probleminha em meu servidor, sobre o castle, não esta salvando a guild dominante.
Ja verifiquei o config.lua e sim esta como "true" saveGlobalStorage=true.
Se alguem conseguir dar uma ajuda.

 

Link to post
Share on other sites

Cade o codigo do castle?

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

1 minuto atrás, FlameArcixt disse:

Cade o codigo do castle?

Acabei esquecendo de colocar, sorry :/
data/movements/scripts/COH.lua

Spoiler


function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..tostring(getGlobalStorageValue(COH_STATUS)).."] !")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild "..getGlobalStorageValue(COH_STATUS)..".")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
       setGlobalStorageValue(COH_PREPARE1, -1)
       setGlobalStorageValue(COH_PREPARE2, -1)
       setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..tostring(getGlobalStorageValue(COH_STATUS)).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
    setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
  if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
   setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
   doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta muito proxima do dominio!")
  end
 end
 return true
end

 

Link to post
Share on other sites

Tenta assim

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == getPlayerGuildName(cid) then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..tostring(getGlobalStorageValue("COH_STATUS")).."] !")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild "..getGlobalStorageValue("COH_STATUS")..".")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS") ~= getPlayerGuildName(cid)) then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..tostring(getGlobalStorageValue("COH_STATUS")).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1") ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid))) then
    setGlobalStorageValue("COH_PREPARE1", getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
  if (getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid)) then
   setGlobalStorageValue("COH_PREPARE2", getPlayerGuildName(cid))
   doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta muito proxima do dominio!")
  end
 end
 return true
end

 

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

13 minutos atrás, FlameArcixt disse:

Tenta assim


function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == getPlayerGuildName(cid) then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..tostring(getGlobalStorageValue("COH_STATUS")).."] !")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild "..getGlobalStorageValue("COH_STATUS")..".")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS") ~= getPlayerGuildName(cid)) then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..tostring(getGlobalStorageValue("COH_STATUS")).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1") ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid))) then
    setGlobalStorageValue("COH_PREPARE1", getPlayerGuildName(cid))
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
  if (getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid)) then
   setGlobalStorageValue("COH_PREPARE2", getPlayerGuildName(cid))
   doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta muito proxima do dominio!")
  end
 end
 return true
end

 

9iqqaOr.png
Ao reiniciar o servidor ainda permanece o mesmo erro, como segue a imagem.

Link to post
Share on other sites

1 minuto atrás, knepperzik disse:

9iqqaOr.png
Ao reiniciar o servidor ainda permanece o mesmo erro, como segue a imagem.

O erro é que vc ta setando valor de texto em storage, ja vou corrigir aqui 

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS") ~= -1 then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", 1)
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1") ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

10 minutos atrás, FlameArcixt disse:

O erro é que vc ta setando valor de texto em storage, ja vou corrigir aqui 


function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS") ~= -1 then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", 1)
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1") ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

JwSeOcq.png
Coloquei a script, e ocorreu o seguinte erro, não deixa nem passar em cima da tile.

Link to post
Share on other sites

11 minutos atrás, knepperzik disse:

JwSeOcq.png
Coloquei a script, e ocorreu o seguinte erro, não deixa nem passar em cima da tile.

Erro meu, deixei alguns parenteses abertos.

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS")) ~= -1 then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", 1)
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

Posted (edited)
15 minutos atrás, FlameArcixt disse:

Erro meu, deixei alguns parenteses abertos.



function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS")) ~= -1 then
       setGlobalStorageValue("COH_PREPARE1", -1)
       setGlobalStorageValue("COH_PREPARE2", -1)
       setGlobalStorageValue("COH_STATUS", 1)
    doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
       doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

Ao passar no tile que domina o castle, não esta ativando a action. "16202"

Edited by knepperzik (see edit history)
Link to post
Share on other sites

4 minutos atrás, knepperzik disse:

Ao passar no tile que domina o castle, não esta ativando a action. "16202"

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS")) == -1 then
		setGlobalStorageValue("COH_PREPARE1", -1)
		setGlobalStorageValue("COH_PREPARE2", -1)
		setGlobalStorageValue("COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
    end
    else
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

5 minutos atrás, FlameArcixt disse:

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getGlobalStorageValue("COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getGlobalStorageValue("COH_STATUS")) == -1 then
		setGlobalStorageValue("COH_PREPARE1", -1)
		setGlobalStorageValue("COH_PREPARE2", -1)
		setGlobalStorageValue("COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
    end
    else
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then
    setGlobalStorageValue("COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

Deu certo, deu para dominar, após reiniciar o servidor o mesmo erro conforme a imagem.
bUk2WoU.png
Será que pode ser alguma coisa relacionada com a source?

Link to post
Share on other sites

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getPlayerStorageValue(cd,"COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getPlayerStorageValue(cd,"COH_STATUS")) == -1 then
		setPlayerStorageValue(cid,"COH_PREPARE1", -1)
		setPlayerStorageValue(cid,"COH_PREPARE2", -1)
		setPlayerStorageValue(cid,"COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
    end
    else
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getPlayerStorageValue(cd,"COH_PREPARE1")) ~= 0 then
    setPlayerStorageValue(cid,"COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

Você ta setando valor do servidor e nao do player, ele ta checando se o servidor tem a storage, se o servidor tiver entao o player entra, ou seja, os enemigos também entram, botei pra setar valor nos players, testa agora

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

8 minutos atrás, FlameArcixt disse:

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getPlayerStorageValue(cd,"COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if getPlayerGuildId(cid) > 0 then
   if (getPlayerStorageValue(cd,"COH_STATUS")) == -1 then
		setPlayerStorageValue(cid,"COH_PREPARE1", -1)
		setPlayerStorageValue(cid,"COH_PREPARE2", -1)
		setPlayerStorageValue(cid,"COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")
    end
    else
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getPlayerStorageValue(cd,"COH_PREPARE1")) ~= 0 then
    setPlayerStorageValue(cid,"COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

Você ta setando valor do servidor e nao do player, ele ta checando se o servidor tem a storage, se o servidor tiver entao o player entra, ou seja, os enemigos também entram, botei pra setar valor nos players, testa agora

deu o mesmo problema ali de cima, o player passa em cima do tile que domina, porem a action "16202" não ativa.

Link to post
Share on other sites

2 minutos atrás, knepperzik disse:

deu o mesmo problema ali de cima, o player passa em cima do tile que domina, porem a action "16202" não ativa.

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getPlayerStorageValue(cd,"COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if not getPlayerGuildId(cid) then
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
  end
   if (getPlayerStorageValue(cd,"COH_STATUS")) == -1 then
		setPlayerStorageValue(cid,"COH_PREPARE1", -1)
		setPlayerStorageValue(cid,"COH_PREPARE2", -1)
		setPlayerStorageValue(cid,"COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")	
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getPlayerStorageValue(cd,"COH_PREPARE1")) ~= 0 then
    setPlayerStorageValue(cid,"COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

3 minutos atrás, FlameArcixt disse:

function onStepIn(cid, item, pos, fromPosition)
 local pos = getThingPos(cid)
 
 if item.actionid == 16203 then 
  if not isPlayer(cid) then
      return true
  end 
  if getPlayerStorageValue(cd,"COH_STATUS") == 1 then
   doSendMagicEffect(getThingPos(cid), 14)
   doSendAnimatedText(pos, "", math.random(1, 255))
  doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!")
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.")
  end
  return true
 end

    if item.actionid == 16202 then
     if not isPlayer(cid) then
      return true
  end
  
  if not getPlayerGuildId(cid) then
		doSendMagicEffect(pos, 2)  
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
  end
   if (getPlayerStorageValue(cd,"COH_STATUS")) == -1 then
		setPlayerStorageValue(cid,"COH_PREPARE1", -1)
		setPlayerStorageValue(cid,"COH_PREPARE2", -1)
		setPlayerStorageValue(cid,"COH_STATUS", 1)
		doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
		doCastleRemoveEnemies()
		doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !")	
   end
      return true
 end
 
    if item.actionid == 16200 then
  if not isPlayer(cid) then
      return true
  end
  if getPlayerGuildId(cid) > 0 then
   doSendAnimatedText(pos, "", math.random(1, 255))
   if (getPlayerStorageValue(cd,"COH_PREPARE1")) ~= 0 then
    setPlayerStorageValue(cid,"COH_PREPARE1", 1)
    doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, " Você nao possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "", math.random(1, 255))
 end
 return true
end

 

ainda não foi 

Link to post
Share on other sites

  • Solution
Agora, knepperzik disse:

ainda não foi 

chama no discord, nao posso acompanhar oq vc ta fazendo a cada 5 minutos de resposta no tk Arcixt#1329

Topico finalizado, resolvido no Discord.

arcixt.png.013e2ae477e2a550a7d99a71e2ca6758.png

Arcixt Mapping Build

Interessado(a) em Freelance de mapping? 5 anos na área trabalhando com todos os versões de otservers

Interested in Freelance mapping? 5 years in the field working with all versions from otservers

91_Discord_logo_logos-512.png.fb621298e5bfd4a911090b3363387c16.png  Discord: Arcixt#1329 

facebook-512.png.890e3fc2724e38221ca419deb6f3416a.png  Facebook Page: www.facebook.com/ArcixtMapping  

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By jenison06
      .Qual servidor ou website você utiliza como base? 
      pokestorm
      Qual o motivo deste tópico? 
      Ajuda com Adaptação
       
      Salve Galera queria saber se é possivel fazer com que o npc troca o item pelo pokemon como abaixo e apenas aceitar a troca se setar o Nick no pokemon
       
      Você tem o código disponível? Se tiver publique-o aqui: 
      Abaixo Npc que troca Item por poke
      local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local questSt = 6650 local checkQuest = getPlayerStorageValue(cid,questSt) local playerPos = getCreaturePosition(cid) local playerLevel = getPlayerLevel(cid) local questLevel = 100 local tab = { [1] = {fName = "Dome Fossil", fId = 8776, pName = "Kabuto"}, [2] = {fName = "Helix Fossil", fId = 8777, pName = "Omanyte"}, [3] = {fName = "Ancient Fossil", fId = 8775, pName = "Aerodactyl"}, } if(msgcontains(msg, 'Harry')) then if checkQuest < 1 then -- Quer saber mais selfSay('Sorry, but I have nothing to talk to you.', cid) elseif checkQuest >= 1 and checkQuest <= 3 then -- Quer saber mais mas já fez a Parte 1. selfSay('Oh! How is my husband? Is he fine? There are two years since I last seen him! By the way, are you here to give me {something}?', cid) talkState[talkUser] = 1 else -- Quer saber mais mas já fez a Parte Final. selfSay('How are you doing with your ancient pokémon?', cid) end elseif(msgcontains(msg, 'Something') and talkState[talkUser] == 1) then -- Tem algo pra dar talkState[talkUser] = 2 selfSay('Yes, as I expected. Let me check one thing.', cid) selfSay('As I see, Harry has given you the '..tab[checkQuest].fName..'. After many years of study and dedication, I discovered a method to bring fossils back to life. Do you want me to transform your '..tab[checkQuest].fName..' into '..tab[checkQuest].pName..'? Just say {yes} or {no}.', cid) elseif talkState[talkUser] == 2 then if msgcontains(msg, 'Yes') then -- Quer transformar o fossil if getPlayerItemCount(cid, tab[checkQuest].fId) >= 1 then selfSay('Fine then! There it is, your '..tab[checkQuest].fName..' has been transformed into '..tab[checkQuest].pName..'! Congratulations!', cid) if #getPlayerPokeballs(cid) >= 6 then local newpokeball = doCreatePokeball(tab[checkQuest].pName, 2469) doPlayerSendMailByName(getCreatureName(cid), newpokeball) doPlayerSendTextMessage(cid, 27, "You are holding six pokémons, your ("..tab[checkQuest].pName..") will be teleported to the Pokemon Center!") else local newpokeball = doCreatePokeball(tab[checkQuest].pName, 2470) doPlayerAddItemEx(cid, newpokeball) end doPlayerRemoveItem(cid, tab[checkQuest].fId, 1) doSendMagicEffect(playerPos, 162) doSendMagicEffect(playerPos, 28) addEvent(doSendMagicEffect, 600, playerPos, 29) addEvent(doSendMagicEffect, 1200, playerPos, 28) setPlayerStorageValue(cid, questSt, 4) else selfSay("Sorry, but you have no "..tab[checkQuest].fName.." with you.",cid) end talkState[talkUser] = 0 elseif msgcontains(msg, 'No') then -- Nao quer transformar o fossil selfSay('Right then. Then come back when you want it!', cid) talkState[talkUser] = 1 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())    
      Npc Nick que uso na Base
      local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, _type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid NickQuestStorage = 8850 NickQuestBookId = 1955 NickQuestGameBoyId = 2630 local questStatus = getPlayerStorageValue(cid, NickQuestStorage) local playerLevel = getPlayerLevel(cid) if msgcontains(msg, "nicknames") then if isPremium(cid) then if playerLevel >=50 then if questStatus == -1 then selfSay("Before I give nicknames to your pokemons, can you do some favours to me?", cid) selfSay("I need a book that I lent to Albert, because it contains so much information that I use in my job. Last time I visited Albert he was living in a little house, in the east of Viridian.", cid) setPlayerStorageValue(cid, NickQuestStorage, 0) elseif questStatus == 0 then selfSay("I need a book that I lent to Albert, because it contains so much information that I use in my job. Last time I visited Albert he was living in a little house, in the east of Viridian.", cid) elseif questStatus == 1 then if doPlayerRemoveItem(cid, NickQuestBookId, 1) then setPlayerStorageValue(cid, NickQuestStorage, 2) selfSay("Thank you! I was really missing this book. Now just one more favour, can you get my Game Boy, which is with Ralf? I left with him to fix it, his workshop is in Celadon.", cid) else selfSay("I need a book that I lent to Albert, because it contains so much information that I use in my job. Last time I visited Albert he was living in a little house, in the east of Viridian.", cid) end elseif questStatus == 2 then selfSay("Can you get my Game Boy, which is with Ralf? I left with him to fix it, his workshop is in Celadon.", cid) elseif questStatus == 3 then if doPlayerRemoveItem(cid, NickQuestGameBoyId, 1) then setPlayerStorageValue(cid, NickQuestStorage, 4) selfSay("Thank you VERY MUCH! Now my son won't cry no more and I can do my job tranquil. Do you want me to give {nicknames} to your pokemons?", cid) else selfSay("Can you get my Game Boy, which is with Ralf? I left with him to fix it, his workshop is in Celadon.", cid) end elseif questStatus >= 4 then selfSay("Oh, ok. Would you like to {give} or {remove} a nickname?", cid) talkState[talkUser] = 1 end else selfSay("Sorry, come back when you are level 50 or higher.", cid) end else selfSay("Hey, I'm so sorry, but you must be premium account to give nicknames to your pokemons", cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, "give") then selfSay("Oh, ok. Which nickname would you like to give to the pokemon in the slot?", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "remove") then selfSay("Oh, ok. You want to remove the nickname to the pokemon in the slot for 5K?", cid) talkState[talkUser] = 3 end elseif talkState[talkUser] == 2 then local msg = msg:trim() if msg:len() < 4 then selfSay("This nickname is too short.", cid) elseif msg:len() > 15 then selfSay("This nickname is too long.", cid) elseif not isValidName(msg) then selfSay("This name contains invalid symbols.", cid) elseif getMonsterPokedex(msg, false) then selfSay("You can't use other's pokemon name.", cid) else selfSay("Would you like to give the nickname \""..msg.."\" to the pokemon in the slot for 10K?", cid) talkState[talkUser] = msg end elseif talkState[talkUser] == 3 then if msgcontains(msg, "yes") then local pokeball = getPlayerSlotItem(cid, CONST_SLOT_FEET) if isPokeballOut(pokeball.itemid) then selfSay("Call your pokemon back before changing his nickname.", cid) elseif isPokeballIn(pokeball.itemid) then if doPlayerRemoveMoney(cid, 500000) then local pokeballInfo = getPokeballInfo(pokeball.uid) setPokeballDescription(pokeball.uid, pokeballInfo.name, false, pokeballInfo.health, pokeballInfo.healthmax) selfSay("Now your pokemon not have a nickname!", cid) else selfSay("Sorry, you don't have 5K.", cid) end else selfSay("There's no pokeball in the slot!", cid) end else selfSay("Ok then.", cid) end talkState[talkUser] = 0 elseif type(talkState[talkUser]) == "string" then if msgcontains(msg, "yes") then local pokeball = getPlayerSlotItem(cid, CONST_SLOT_FEET) if isPokeballOut(pokeball.itemid) then selfSay("Call your pokemon back before changing his nickname.", cid) elseif isPokeballIn(pokeball.itemid) then if doPlayerRemoveMoney(cid, 1000000) then local pokeballInfo = getPokeballInfo(pokeball.uid) setPokeballDescription(pokeball.uid, pokeballInfo.name, talkState[talkUser], pokeballInfo.health, pokeballInfo.healthmax) selfSay("Now your pokemon have a new nickname! Enjoy it :)", cid) else selfSay("Sorry, you don't have 10K.", cid) end else selfSay("There's no pokeball in the slot!", cid) end elseif msgcontains(msg, "no") then selfSay("Why not? This nickname was so good!", cid) end talkState[talkUser] = 0 else talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
    • By MIzakinha
      Olá, senhores!
       
      Estou com um script que quando o player compra a VIP no meu servidor, a conta dele vai ficar com essa VIP durante 30 dias e ele vai ganhar uma storage (que vai servir para varias coisas, mas isso não importa aqui).
       
      Bom, o problema é que quando os 30 dias de VIP acabar, o player continua com a storage.
       
      Preciso de um script que retire essa storage quando os dias de VIP acabar. Alguém pode me ajudar com isso?
       
       
    • By stauro
      .Qual servidor ou website você utiliza como base? 
       
      Qual o motivo deste tópico? 
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
      O erro é o seguinte, se usar a energy bomb no chão e o monstro passar por cima, ele não leva dano. Se vc atacar o bicho com a runa, ele levará o dano pelo target, contudo, se continuar passando por cima, não acontece nada. Não sei mais o que fazer, com a firebomb funciona perfeitamente, comparei os scripts e não vejo diferença. Energy Bomb: Não funciona local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1495) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Poison Bomb: Não funciona local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1496) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Fire Bomb: Funciona local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1492) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end  
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By stauro
      .Qual servidor ou website você utiliza como base? 
       
      Qual o motivo deste tópico? 
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
      NPC: Pino.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end -- OTServ event handling functions end -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Darashia on Darama for 40 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 40, destination = {x=33270, y=32441, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Svargrond for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32253, y=31097, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'femor hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'zao'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Zao for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'balneario camboriu'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Balneario Camboriu for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) npcHandler:addModule(FocusModule:new())  Pino.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Pino" script="data/npc/scripts/Pino.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="115" body="0" legs="67" feet="114" addons="0"/> <voices> <voice text="Feel the wind in your hair during one of my carpet rides!" interval2="120" margin="1" yell="no"/> </voices> <parameters> <parameter key="message_greet" value="Greetings, traveller |PLAYERNAME|. Where do you want me to fly you?"/> <parameter key="message_farewell" value="Good bye!"/> <parameter key="message_walkaway" value="Good bye!" /> </parameters> </npc>  
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By stauro
      .Qual servidor ou website você utiliza como base? 
       
      Qual o motivo deste tópico? 
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
       
      Você tem o código disponível? Se tiver publique-o aqui: 
      NPC: Pino.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end -- OTServ event handling functions end -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Darashia on Darama for 40 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 40, destination = {x=33270, y=32441, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to Svargrond for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32253, y=31097, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'femor hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'hills'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Femor Hills for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=32536, y=31837, z=4} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) local travelNode = keywordHandler:addKeyword({'zao'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to the Zao for 60 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 60, destination = {x=33984, y=31539, z=1} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You shouldn\'t miss the experience.'}) npcHandler:addModule(FocusModule:new()) Pino.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Pino" script="data/npc/scripts/Pino.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="115" body="0" legs="67" feet="114" addons="0"/> <voices> <voice text="Feel the wind in your hair during one of my carpet rides!" interval2="120" margin="1" yell="no"/> </voices> <parameters> <parameter key="message_greet" value="Greetings, traveller |PLAYERNAME|. Where do you want me to fly you?"/> <parameter key="message_farewell" value="Good bye!"/> <parameter key="message_walkaway" value="Good bye!" /> </parameters> </npc>  
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo