Ir para conteúdo

Featured Replies

Postado

Estou com o seguinte problema na minha Guild House na imagem 1 mostrar que eu não pertenço a Guild -1 mas ela nunca foi dominada nem nada

 

SERVIDOR 8.6

TFS: 0.4

 

 

1413374376_guild1.thumb.png.55bec42f908266295eabad62838f0c70.png

 

 

Na segunda fala que eu já domino sem ter dominado

 

 

 1983096578_guild2.thumb.png.bb9bd39c342252d3c493a8e662176c1d.png

 

 

Meu código movements

 

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, "CoH", math.random(1, 255))
  else
   doSendMagicEffect(getThingPos(cid), 2)
      doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não pertence á 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
          doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
       setGlobalStorageValue(COH_PREPARE1, -1)
       setGlobalStorageValue(COH_PREPARE2, -1)
       setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
       doCastleRemoveEnemies()
    doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
      end
     else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não 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, "CoH", math.random(1, 255))
   if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
    setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
    doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
   end
  else
   doSendMagicEffect(pos, 2)  
   doTeleportThing(cid, fromPosition, false)
   doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")   
   return true
  end   
 end
 
 if item.actionid == 16201 then
  if not isPlayer(cid) then
      return true
  end
  doSendAnimatedText(pos, "CoH", math.random(1, 255))
  if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
   setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
   doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
  end
 end
 return true
end

 

Meu código actions

 

Spoiler

--alavanca para o sistema de guerra de gh

function onUse(cid, item, frompos, item2, topos)

    if item.uid == 7375 then
        local gh = 1
    
        if item.itemid == 9825 then

            local isGuard = getCreatureByName('Dol Elite Guard')
            
            if isGuard ~= nil then
                doPlayerSendTextMessage(cid,22,"Vocês tem que matar os guardas primeiro.")
                return true
            end
            
            local guild_id = getPlayerGuildId(cid)
            
            if guild_id > 0 then
                if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
                    
                    local hora = tonumber(os.date("%H"))
                    
                    if hora < 14 or hora > 21 then
                        doPlayerSendTextMessage(cid,22,"A Guild House só pode ser invadida entre as 14 e 22 horas.")
                        return true
                    end
                    
                    local world_id = getConfigValue('worldId')
                    
                    db.executeQuery("UPDATE `guilds` set `gh` = 0 WHERE `gh` = "..gh.." AND `world_id` = "..world_id..";")
                    db.executeQuery("UPDATE `guilds` set `gh` = "..gh.." WHERE `id` = "..guild_id..";")
                    getGlobalStorageValue(COH_STATUS)(COH_STATUS)
                    
                    --expulsa todos da GH
                    
                    local x_start = 1238
                    local x_end = 1274
                    local y_start = 689
                    local y_end = 718
                    local z_start = 6
                    local z_end = 7
                    
                    local x = x_start
                    local y = y_start
                    local z = z_start
                    
                    while z <= z_end do
                        while y <= y_end do
                            while x <= x_end do
                                local verificaPos = {x = x , y = y, z = z, stackpos = 253}
                                verifica = getThingfromPos(verificaPos,false)
                                
                                if isCreature(verifica.uid) == true then
                                    if verifica.uid < 1000000000 then
                                        if getPlayerGuildId(verifica.uid) ~= guild_id then
                                            local xr = math.random(1258,1265)
                                            local yr = math.random(749,755)
                                            local tp = {x=xr,y=yr,z=7}
                                            doTeleportThing(verifica.uid,tp)
                                            print('player tep: '..getPlayerName(verifica.uid))
                                        end
                                    end
                                end
                                x=x+1
                            end
                            x = x_start
                            y=y+1
                        end
                        z=z+1
                    end
                    
                    -- Limpa todas as casas
                    local house_start = 570
                    local house_end = 584
                    
                    local hid = house_start
                    
                    while hid <= house_end do
                        setHouseOwner(hid, 0, true)
                        hid=hid+1
                    end
                    
                    doTransformItem(item.uid,item.itemid+1)
                    doBroadcastMessage("A guild "..getPlayerGuildName(cid).." acaba de dominar a Guild House de Dol\'Guldur!")
                    return true
                else
                    doPlayerSendTextMessage(cid,22,"Você já domina esta GH.")
                    --print('mesma guildc')
                    return true
                end
            else
                doPlayerSendTextMessage(cid,22,"Você precisa ter uma guild para dominar a GH.")
                --print('sem guild')
                return true
            end
            
            return true
            
        elseif item.itemid == 9826 then
            --doTransformItem(item.uid,item.itemid-1)
            
            if getPlayerAccess(cid) <= 2 then
                doPlayerSendTextMessage(cid,22,"Esta GH já foi invadida hoje, tente novamente amanhã.")
            else
                doTransformItem(item.uid,item.itemid-1)
            end
            return true
        end
    end
    
    return true
    
end
 

 

 

Percebi no meu mysql que na tabela Guilds não tem nada relacionado a gh

 

 

 

260472946_guild3.thumb.png.c02ff417bce83833a3436e895dab4fbe.png

 

Se alguém poder ajudar desde já agradeço!!

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo