Histórico de Curtidas
-
DigoleraZica deu reputação a L3K0T em Não jogar itens pelo teleportes C++precisa ter um moveitem instalado no seu servidor
OU Tente algo como isso
void Teleport::__addThing(Creature* actor, int32_t, Thing* thing) { if (!thing || thing->isRemoved()) return; Tile* destTile = g_game.getTile(destination); if (!destTile) return; if (Creature* creature = thing->getCreature()) { g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); creature->getTile()->moveCreature(actor, creature, destTile); g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); } else { Player* player = dynamic_cast<Player*>(actor); if (player) { player->sendTextMessage(MSG_STATUS_SMALL, "You cannot teleport items."); } return; } } obg, bem simples e util
-
DigoleraZica recebeu reputação de L3K0T em Não jogar itens pelo teleportes C++Bom dia,
Teria como colocar para bloquear de jogar o item em cima de teleports com storage ?
E esse seu em vez de remover o item teria como bloquear também?
-
DigoleraZica deu reputação a L3K0T em (Resolvido)Erro Deletar Guild Inativafunction onStartup() local result_guilds = db.getResult("SELECT `id`, `creationdata` FROM `guilds` ORDER by `creationdata` ASC;") local days = 30 * 3600 * 24 local nowtime = os.time() if (result_guilds and result_guilds:getID() ~= -1) then while (true) do local id = result_guilds:getDataInt("id") local date = result_guilds:getDataInt("creationdata") local time = nowtime - date local duedate = time - days if duedate >= 0 then local columnExists = db.isColumn("players", "guild_id") if columnExists then local result_countplayersguild = db.getResult("SELECT COUNT(*) AS player_count FROM `players` WHERE `guild_id` = " .. id .. ";") if (result_countplayersguild) then local manyplayers = result_countplayersguild:getDataInt("player_count") result_countplayersguild:free() if manyplayers < 10 then db.executeQuery("DELETE FROM `guild_invite` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_kills` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_ranks` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_storage` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_wars` WHERE `guild_id` = " .. id .. ";") end end end end if not (result_guilds:next()) then break end end result_guilds:free() end end
-
DigoleraZica deu reputação a L3K0T em (Resolvido)-=[TFS]=- 0.4 8.60 Eu tenho esse script porem eu quero que quando acaba vip 3 dias ou mais o player seja kikado pro templo mesmo se ele desloga e loga denovo achando que tem bug login é area vip queria uma storageNa verdade pra ele ser kikado vc deverá por no login.lua pra verificar se o playeré Premium ou não, se ele logar e não for vip seja lá aonde ele estiver, ele vai pro templo da cidade principal
<event type="login" name="LoginScriptVip" script="loginVip.lua"/>
local TEMPLE_POSITION = {x = 100, y = 200, z = 7} -- Coordenadas do templo
function onLogin(cid)
local vip = getPlayerPremiumDays(cid)
if vip == 0 then
-- Teleporta o jogador para o templo
doTeleportThing(cid, TEMPLE_POSITION, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu VIP acabou. Você foi teleportado para o templo.")
setPlayerStorageValue(cid, 18956, -1) -- Define a storage 18956 como -1
return false -- Evita que o jogador execute outras ações após o login
end
return true
end
*configure pra onde o player vai quando o vip acabar
Vc mandou um Use item e mandou aonde o player entra pra acessar a área vip, mais pra mandar o player pra área free depois que acabar o vip é outro script, mandei um exemplo acima, testa ai
-
DigoleraZica deu reputação a L3K0T em (Resolvido)erro no script ao relogarlocal tab = {
[4] = 10, -- [vocationID] = número da cor do texto animado
[5] = 30,
[6] = 50,
[7] = 70
}
function ariseText(cid)
local texts = {"' . ,", ". ' ,", "' . ,", ", ' ."}
local playerVocation = getPlayerVocation(cid)
if playerVocation and tab[playerVocation] then
doSendAnimatedText(getCreaturePosition(cid), texts[math.random(1, #texts)], tab[playerVocation])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Efeito mágico adicionado
end
if isPlayer(cid) then
addEvent(ariseText, 1000, cid)
end
return true
end
function onLogin(cid)
if tab[getPlayerVocation(cid)] then
ariseText(cid)
end
return true
end
-
DigoleraZica deu reputação a luanluciano93 em (Resolvido)[AJUDA] ERRO REWARD CHESTTenta substituir essa parte:
local pontos = getPlayerStorageValue(players[i], boss.storage) if i == 1 then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.sempre, tabela_reward, true) elseif i >= 2 and pontos >= math.ceil((porcentagem * 0.8)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.muito_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.8)) and pontos >= math.ceil((porcentagem * 0.6)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.6)) and pontos >= math.ceil((porcentagem * 0.4)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.4)) and pontos >= math.ceil((porcentagem * 0.1)) then addLoot(boss.comum, tabela_reward, false) end addRewardLoot(players[i], bossName, tabela_reward) por:
local pontos = getPlayerStorageValue(players[i], boss.storage) if pontos then if i == 1 then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.sempre, tabela_reward, true) elseif i >= 2 and pontos >= math.ceil((porcentagem * 0.8)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) addLoot(boss.muito_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.8)) and pontos >= math.ceil((porcentagem * 0.6)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) addLoot(boss.raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.6)) and pontos >= math.ceil((porcentagem * 0.4)) then addLoot(boss.comum, tabela_reward, false) addLoot(boss.semi_raro, tabela_reward, false) elseif pontos < math.ceil((porcentagem * 0.4)) and pontos >= math.ceil((porcentagem * 0.1)) then addLoot(boss.comum, tabela_reward, false) end addRewardLoot(players[i], bossName, tabela_reward) end
-
DigoleraZica deu reputação a L3K0T em (Resolvido)[AJUDA] ERRO REWARD CHESTA parte que o Luciano disse, fiz alteração
local pontos = getPlayerStorageValue(players[i], boss.storage)
if pontos ~= nil then
if i == 1 then
addLoot(boss.comum, tabela_reward, false)
addLoot(boss.semi_raro, tabela_reward, false)
addLoot(boss.raro, tabela_reward, false)
addLoot(boss.sempre, tabela_reward, true)
elseif i >= 2 and pontos >= math.ceil((porcentagem * 0.8)) then
addLoot(boss.comum, tabela_reward, false)
addLoot(boss.semi_raro, tabela_reward, false)
addLoot(boss.raro, tabela_reward, false)
addLoot(boss.muito_raro, tabela_reward, false)
elseif pontos < math.ceil((porcentagem * 0.8)) and pontos >= math.ceil((porcentagem * 0.6)) then
addLoot(boss.comum, tabela_reward, false)
addLoot(boss.semi_raro, tabela_reward, false)
addLoot(boss.raro, tabela_reward, false)
elseif pontos < math.ceil((porcentagem * 0.6)) and pontos >= math.ceil((porcentagem * 0.4)) then
addLoot(boss.comum, tabela_reward, false)
addLoot(boss.semi_raro, tabela_reward, false)
elseif pontos < math.ceil((porcentagem * 0.4)) and pontos >= math.ceil((porcentagem * 0.1)) then
addLoot(boss.comum, tabela_reward, false)
end
addRewardLoot(players[i], bossName, tabela_reward)
end
Esse erro que vc citou é porque alguém ficou desconectado durante a batalha e deslogo causando o erro, vc disse que de vez enquando aparece, então é isso foi adicionado no script if pontos ~= nil then
-
DigoleraZica deu reputação a L3K0T em [AJUDA] Kills no mesmo IP<event type="death" name="onDeath" script="avoidSameIPKill.lua"/>
function onDeath(cid, corpse, killer)
local playerIp = getPlayerIp(cid)
local killerIp = getPlayerIp(killer)
-- Verifica se o jogador morto e o jogador que matou têm o mesmo IP
if playerIp == killerIp then
return false -- Evita registrar a kill
end
-- Resto da lógica para contabilizar as kills normalmente
return true
end
-
DigoleraZica deu reputação a Aksz em [AJUDA] Query Count GuildOlá, bom dia!
Então, no select que você fez, você pediu pra puxar somente a coluna guild_id, onde a guild_id for maior que 0.
Se você puxar todos dados da tabela, troca o select `guild_id` por select * a condição where se quiser pegar somente de uma guild especifica, seria where guild_id = id_guild
-
DigoleraZica deu reputação a GamerGoiano em [AJUDA] Potion ExpOpção 1:
local function getPlayerData(guid) if not expPotions.playerData[guid] then expPotions.playerData[guid] = {} for itemId in pairs(potions) do expPotions.playerData[guid][itemId] = {rate = 0, duration = 0} end end return expPotions.playerData[guid] end function expPotions:onUse(cid, item, fromPosition, itemEx, toPosition) local itemId = item.itemid local potion = potions[itemId] if not potion then return false end if getPlayerLevel(cid) < potion.needLevel then doPlayerSendCancel(cid, ('Você precisa ser level %d+ para usar esta potion.'):format(potion.needLevel)) return true end local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) local expData = playerData[itemId] local now = os.time() if expData.duration > now then doCreatureSay(cid, 'Aguarde o bônus atual acabar para usar novamente.', TALKTYPE_ORANGE_1, false, cid) return true end expData.rate = expData.rate + potion.rate expData.duration = potion.duration + now doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Agora você tem +%d%% de experiência por %s.'):format( potion.rate * 100, string.diff(potion.duration, true) )) doRemoveItem(item.uid, 1) return true end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) getPlayerData(guid) return true end
Opção 2:
local function getPlayerData(guid) if not expPotions.playerData[guid] then expPotions.playerData[guid] = {} for itemId in pairs(potions) do expPotions.playerData[guid][itemId] = {rate = 0, duration = 0} end end return expPotions.playerData[guid] end function expPotions:onUse(cid, item, fromPosition, itemEx, toPosition) local itemId = item.itemid local potion = potions[itemId] if not potion then return false end if getPlayerLevel(cid) < potion.needLevel then doPlayerSendCancel(cid, ('Você precisa ser level %d+ para usar esta potion.'):format(potion.needLevel)) return true end local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) local expData = playerData[itemId] local now = os.time() if expData.duration > now then doCreatureSay(cid, 'Aguarde o bônus atual acabar para usar novamente.', TALKTYPE_ORANGE_1, false, cid) return true end expData.rate = expData.rate + potion.rate expData.duration = potion.duration + now doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Agora você tem +%d%% de experiência por %s.'):format( potion.rate * 100, string.diff(potion.duration, true) )) doRemoveItem(item.uid, 1) -- Salvar as informações na storage Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_rate', expData.rate) Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_duration', expData.duration) return true end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) -- Restaurar as informações da storage for itemId in pairs(potions) do local rate = Game.getStorageValue(cid, 'expPotion_' .. itemId .. '_rate') local duration = Game.getStorageValue(cid, 'expPotion_' .. itemId .. '_duration') if rate ~= nil and duration ~= nil then playerData[itemId].rate = rate playerData[itemId].duration = duration end end return true end function expPotions:onDeath(cid, corpse, killer) -- Limpar as informações das poções ativas ao morrer local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) for itemId in pairs(potions) do playerData[itemId].rate = 0 playerData[itemId].duration = 0 Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_rate', nil) Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_duration', nil) end return true end function expPotions:onSay(cid, words, param) local str = 'Experience Potion Combos:\n' local playerData = self.playerData[getPlayerGUID(cid)] if playerData then for itemId, expData in pairs(playerData) do str = str .. ('\n%s - %d%%'):format(getItemInfo(itemId).name, expData.rate * 100) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str) return true end function expPotions:getCombo(cid) local playerData = self.playerData[getPlayerGUID(cid)] local potionsCombo = 1 if playerData then for itemId, expData in pairs(playerData) do potionsCombo = potionsCombo + expData.rate end end return potionsCombo end function expPotions:onLook(cid, thing, position, lookDistance) if not isPlayer(thing) then return false end local combo = self:getCombo(thing) if combo > 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Combo de Experiência: +%d%%'):format((combo - 1) * 100)) end return false end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) self.playerData[guid] = {} for itemId in pairs(potions) do self.playerData[guid][itemId] = {rate = 0, duration = 0} end return true end function expPotions:onLogout(cid) local guid = getPlayerGUID(cid) self.playerData[guid] = nil return true end function expPotions:onDeath(cid, corpse, killer) local guid = getPlayerGUID(cid) self.playerData[guid] = nil return true end
-
DigoleraZica recebeu reputação de FeeTads em (Resolvido)[AJUDA] Adicionar 2 storage ao usar itemEstranho dupliquei aqui e parece que não está adicionando está nova storage tem outro modo?
EDIT ~~
FUNCIONOU MUITO OBRIGADO
-
DigoleraZica deu reputação a FeeTads em (Resolvido)[AJUDA] Adicionar 2 storage ao usar itemmeio que vc ja solucionou o seu problema kkkkkk
vc quer que ele de a storage 91475 e disse que ele ja está ganhando a 90594
então basicamente vc precisa duplicar a linha e colocar a nova storage
setPlayerStorageValue(cid, 90594, 1) setPlayerStorageValue(cid, 91475, 1)
setPlayerStorageVaue significa = setar no jogador a storage
ou seja
cid = creature Id do jogador que está executando a ação}
91745 = numero da storage (aqui pode ser qualquer numero vc decide)
1 = valor da storage (aqui pode ser oq vc precisar tipo os.time(), ou guardar qualquer coisa)
-
DigoleraZica deu reputação a Apache em [AJUDA] BUG EXAUSTEDdata/talkactions/lib/talkactions.lua function checkExhausted(cid, storage, seconds) local v = exhaustion.get(cid, storage) if(not v) then exhaustion.set(cid, storage, seconds) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Please wait " .. v .. " seconds before trying this command again.") return false end return true end data/lib/034-exhaustion.lua get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getCreatureStorage(cid, storage) if(exhaust > 0) then local left = exhaust - os.time() if(left >= 0) then return left end end return false end,
-
DigoleraZica deu reputação a Myalitth em [AJUDA] PORTA BUGADA NAO ABREO problema esta na talkaction !buyhouse, tenta alterar ela por outras compativeis com seu distro.
-
DigoleraZica deu reputação a Under em [AJUDA] Item ganha SpellAssim que for aprovado esta aqui o sistema.
-
DigoleraZica deu reputação a Vodkart em (Resolvido)[AJUDA] Aceitar outra vocaçãolocal magias = { [1] = "zesshou hachimon", [2] = "jukai kousan", [3] = "mugen shiki", [4] = "yahumuki", [5] = "zesshou hachimon", [6] = "jukai kousan", [7] = "mugen shiki", [8] = "yahumuki", [9] = "zesshou hachimon", [10] = "jukai kousan", [11] = "mugen shiki", [12] = "yahumuki" } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerGroupId(cid) > 2 and getPlayerGroupId(cid) < 5 then return true end local voc = getPlayerVocation(cid) local gem = gems.id[voc] if item.itemid == gem then if getPlayerLevel(cid) < 350 then doCreatureSay(cid,"É necessário level 350 ou maior para absorver uma gema espiritual!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true elseif getPlayerStorageValue(cid,21202) > 0 then doCreatureSay(cid,"Você ainda possui uma gema espiritual absorvida!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true end setPlayerStorageValue(cid, 21202,1) setPlayerStorageValue(cid, gems.storage[voc], 1) doUseGem(cid, item) doCreatureSay(cid,"Você absorveu uma gema espiritual ("..magias[voc]..")!",TALKTYPE_ORANGE_1) doSendMagicEffect(getPlayerPosition(cid),65) return true else doCreatureSay(cid,"Ops!! Crystal errado, procure da sua vocação!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true end return true end
-
DigoleraZica deu reputação a So volto tarde em [AJUDA] Adicionar Exaust ao Usar Item
-
DigoleraZica deu reputação a Kenshiin em (Resolvido)[AJUDA] Delay Itemfunction onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, 987979) >= os.time()) then
doPlayerSendCancel(cid, "Aguarde "..(getPlayerStorageValue(cid, 987979) - os.time()).." segundos para usar esse item novamente.")
doSendMagicEffect(getCreaturePosition(cid),CONST_ME_POFF)
return true
end
local foodID = {2672} -- IDs da comida que o jogador irá receber
local food_final = foodID[math.random(#foodID)]
if getPlayerFreeCap(cid) >= getItemWeightById(food_final) then
if doPlayerAddItem(cid, food_final, 1, false) then
doSendAnimatedText(getCreaturePosition(cid), 'FOOD!', math.random(255))
setPlayerStorageValue(cid,987979,os.time()+10) -- Tempo de Espera 10 segundos
doSendMagicEffect(getPlayerPosition(cid), 35)
else
doCreatureSay(cid, "Você não tem espaço suficiente!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doCreatureSay(cid, "É muito pesado libera sua cap!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return true
end
-
DigoleraZica deu reputação a Vodkart em [AJUDA] Adicionar Item ao Lider da Guildfunction getGuildLeaderName(GuildName) -- function by vodkart local leader = db.getResult("SELECT `players`.`name` FROM `players` WHERE `players`.`id` = (SELECT `guilds`.`ownerid` FROM `guilds` WHERE `guilds`.`name` = ".. db.escapeString(GuildName) .. ")") if(leader:getID() ~= -1) then return leader:getDataString("name") end return nil end if not RealCastle then RealCastle = { itemid = 10091, openStorage = 722374, guildStorage = 722375, dateStorages = {722376,722377,722378} } function RealCastle:isInside(cid) local thingPos = getThingPos(cid) local areas = { {{x = 1921, y = 484, z = 6}, {x = 2098, y = 607, z = 6}}, {{x = 2187, y = 396, z = 6}, {x = 2264, y = 511, z = 6}}, {{x = 2442, y = 416, z = 4}, {x = 2604, y = 521, z = 4}}, {{x = 2446, y = 391, z = 5}, {x = 2619, y = 543, z = 5}}, {{x = 2091, y = 449, z = 6}, {x = 2166, y = 508, z = 6}}, {{x = 1907, y = 606, z = 6}, {x = 2099, y = 735, z = 6}}, {{x = 2653, y = 442, z = 6}, {x = 2741, y = 559, z = 6}}, {{x = 2653, y = 442, z = 5}, {x = 2741, y = 559, z = 5}}, {{x = 2653, y = 442, z = 4}, {x = 2741, y = 559, z = 5}}, {{x = 2277, y = 613, z = 7}, {x = 2462, y = 716, z = 7}}, {{x = 2277, y = 613, z = 6}, {x = 2462, y = 716, z = 6}}, {{x = 2277, y = 613, z = 5}, {x = 2462, y = 716, z = 5}}, {{x = 2277, y = 613, z = 4}, {x = 2462, y = 716, z = 4}}, {{x = 2242, y = 723, z = 6}, {x = 2442, y = 894, z = 6}}, {{x = 2255, y = 804, z = 7}, {x = 2282, y = 832, z = 7}}, {{x = 2103, y = 638, z = 6}, {x = 2262, y = 740, z = 6}}, {{x = 2103, y = 638, z = 7}, {x = 2262, y = 740, z = 7}}, {{x = 1899, y = 590, z = 7}, {x = 2102, y = 730, z = 7}}, {{x = 2130, y = 781, z = 7}, {x = 2210, y = 923, z = 7}}, {{x = 2240, y = 835, z = 7}, {x = 2304, y = 916, z = 7}}, {{x = 1927, y = 739, z = 5}, {x = 2043, y = 927, z = 5}} } for _, area in next, areas do if isInRange(thingPos, area[1], area[2]) then return true end end if (thingPos.x >= 2288 and thingPos.x <= 2364 and thingPos.y >= 433 and thingPos.y <= 509) or (thingPos.x >= 2148 and thingPos.x <= 2189 and thingPos.y >= 641 and thingPos.y <= 679) or (thingPos.x >= 2229 and thingPos.x <= 622 and thingPos.y >= 2320 and thingPos.y <= 704) then return true end return false end function RealCastle:getAllPlayers() local players = {} for _, pid in next, getPlayersOnline() do if self:isInside(pid) then table.insert(players, pid) end end return players end function RealCastle:removePlayers(messageType, message) local players = self:getAllPlayers() for _, pid in next, players do doPlayerSetPzLocked(pid, false) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) if type(messageType) == "string" and messageType == "popup" then doPlayerPopupFYI(pid, message) else doPlayerSendTextMessage(pid, messageType, message) end end end function RealCastle:open() setGlobalStorageValue(self.openStorage, 1) setGlobalStorageValue(self.guildStorage, EMPTY_STORAGE) self:removePlayers("popup", "[War Castle] O domínio de sua guild pelo castelo acabou e você foi trazido a seu Templo.") end function RealCastle:close() setGlobalStorageValue(self.openStorage, EMPTY_STORAGE) local tomorrow = getTomorrowsDate() local tomorrowString = tomorrow[1].."/"..tomorrow[2].."/"..tomorrow[3] for i = 1, 3 do setGlobalStorageValue(self.dateStorages[i], tomorrow[i]) end local guild_id = getGlobalStorageValue(self.guildStorage) local guild_name = "" if guild_id ~= EMPTY_STORAGE then guild_name = getGuildNameByID(guild_id) self:removePlayers(MESSAGE_STATUS_CONSOLE_ORANGE, "[War Castle] A batalha pelo domínio do castelo se encerrou com vitória da guild "..guild_name.." e você foi trazido a seu Templo.") doBroadcastMessage("[War Castle] A batalha terminou e a guild vencedora foi "..guild_name.."! Todos os jogadores dessa guild agora podem aproveitar o castelo até amanhã às 19:00!") local leader = getGuildLeaderName(guild_name) local parcel = doCreateItemEx(ITEM_PARCEL) doAddContainerItem(parcel, RealCastle.itemid, 1) doPlayerSendMailByName(leader, parcel) else guild_name = "Castelo LIVRE" self:removePlayers(MESSAGE_STATUS_CONSOLE_ORANGE, "[War Castle] A batalha pelo domínio do castelo se encerrou e "..guild_name.." ficou com o domínio. Você foi trazido a seu Templo.") doBroadcastMessage("[War Castle] A batalha terminou e nenhuma guild conseguiu dominar o castelo! Amanhã às 19:00 haverá uma nova batalha!") end db.query("DELETE FROM real_castle WHERE world_id = '"..getWorldId().."'") db.query("INSERT INTO real_castle (guild_name, guild_id, tomorrow, world_id) VALUES ('"..guild_name.."', '"..guild_id.."', '"..tomorrowString.."', '"..getWorldId().."')") doSaveServer() end function RealCastle:broadcast(message) for _, pid in next, self:getAllPlayers() do doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, message) end end function RealCastle:domain(cid) setGlobalStorageValue(self.guildStorage, getPlayerGuildId(cid)) self:broadcast("[War Castle] O jogador ["..getPlayerName(cid).."] da guild ["..getPlayerGuildName(cid).."] dominou o castelo! As outras guilds têm até às 20:00 para conseguir tirar o domínio deles, não desistam!") end function RealCastle:isDominating(cid) return getPlayerGuildId(cid) == getGlobalStorageValue(self.guildStorage) end function RealCastle:isOpen() return getGlobalStorageValue(self.openStorage) ~= EMPTY_STORAGE end function RealCastle:checkLogin(cid) if self:isInside(cid) then if not self:isDominating(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerPopupFYI(cid, "[War Castle] Você foi removido do castelo pois ele não pertence mais a sua guild.") end end return true end function RealCastle:announce(message, times) if times == 0 then return true end doBroadcastMessage(message) addEvent(self.announce, 5*60000 , self, message, (times - 1)) end function RealCastle:checkOnTime() if self:isOpen() then self:close() else self:open() self:announce("[War Castle] O acesso à área de dominar do castelo está liberado até às 20:00. Boa sorte a todas as guilds!", 11) for i = 1, 4 do addEvent(doBroadcastMessage, 60000 * i, "[War Castle] O acesso à área de dominar do castelo está liberado até as 20:00. Boa sorte a todas as guilds!") end end return true end function RealCastle:checkOnUse(cid, item, frompos, item2, topos) if item.uid == 61466 then local guild_id = getGlobalStorageValue(self.guildStorage) local guild = guild_id > 1 and "a guild "..getGuildNameByID(guild_id).." possui o domínio" or "nenhuma guild possui o domínio do castelo" local time = getGlobalStorageValue(self.dateStorages[1]).."/"..getGlobalStorageValue(self.dateStorages[2]).."/"..getGlobalStorageValue(self.dateStorages[3]) local domain = self:isOpen() and "as guilds estão batalhando pelo domínio do castelo" or guild local msg = " ----------[War Castle]---------\n\n\nAtualmente "..domain..".\n\nPróxima batalha: "..time.." às 19:00." doShowTextDialog(cid,8977,msg) return true end if not self:isOpen() then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) return true end if not self:isDominating(cid) then self:domain(cid) doSendMagicEffect(getThingPos(cid), CONST_ME_CRAPS) else doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSay(cid,"[War Castle] Sua guild já está com o domínio do castelo!", TALKTYPE_ORANGE_1) end return true end function RealCastle:checkStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if item.actionid == 61465 then if self:isOpen() then if getPlayerGuildId(cid) > 0 then if getPlayerLevel(cid) >= 200 then doSendMagicEffect(getThingPos(cid), 13) return true else doTeleportThing(cid, fromPosition) doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSay(cid,"[War Castle] Somente jogadores com level 200 ou mais podem batalhar pelo castelo!", TALKTYPE_ORANGE_1) end else doTeleportThing(cid, fromPosition) doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSay(cid,"[War Castle] Somente jogadores com guild podem batalhar pelo castelo!", TALKTYPE_ORANGE_1) end else doTeleportThing(cid, fromPosition) doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSay(cid,"[War Castle] O castelo não está aberto para invasões!", TALKTYPE_ORANGE_1) end elseif item.actionid == 61466 then if self:isDominating(cid) then doSendMagicEffect(getThingPos(cid), 14) doPlayerSay(cid,"Bem vindo ao War Castle!", TALKTYPE_ORANGE_1) return true end if self:isOpen() then doTeleportThing(cid, fromPosition) doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSay(cid,"[War Castle] Não é permitido entrar no castelo enquanto as guilds estão batalhando pelo seu domínio.", TALKTYPE_ORANGE_1) else local guild_id = getGlobalStorageValue(self.guildStorage) doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 2, z = toPosition.z}) doSendMagicEffect({x = toPosition.x, y = toPosition.y + 2, z = toPosition.z}, CONST_ME_FIREAREA) doPlayerSay(cid, guild_id ~= EMPTY_STORAGE and "[War Castle] Somente membros da guild ["..getGuildNameByID(guild_id).."] podem entrar." or "[War Castle] Somente membros da guild dominante podem entrar.", TALKTYPE_ORANGE_1) end end return true end end
-
DigoleraZica deu reputação a lordzetros em [Erro] No EventoExecute esses dois códigos na sua database:
CREATE TABLE IF NOT EXISTS `dtt_players` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` bigint(20) NOT NULL, `team` int(5) NOT NULL, `ip` bigint(50) NOT NULL, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Segundo:
CREATE TABLE IF NOT EXISTS `dtt_results` ( `id` int(11) NOT NULL AUTO_INCREMENT, `frags_blue` int(11) NOT NULL, `frags_red` int(11) NOT NULL, `towers_blue` int(11) NOT NULL, `towers_red` int(11) NOT NULL, `data` varchar(255) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL, `hora` varchar(255) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Caso acuse que já exista, salve a database antes da modificação, depois delete as tabelas com nome dtt_results e dtt_players de sua database, e depois execute os mesmos.
-
DigoleraZica deu reputação a luangop em (Resolvido)[BUG] Teleporte AutomáticoTente assim:
local config = { pos = {x=753, y=1544, z=6}, topos = {x=892, y=2659, z=7}, time = 5, -- tempo que o teleport ira sumir em minutos msg_open = "O Portal para a Quest Diaria Vai se Abrir. E Tente Ganhar Blue Tokens. Corra para a sala de Quests, Voce tem 5 Minutos!", msg_close = "O Portal para Quest Diaria se Fechou. Tente Amanha no mesmo Horario!" } local function DelTp() local t = getTileItemById(config.pos, 1387) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(config.pos, CONST_ME_POFF) end end function onTime() if (os.date("%A") == "Monday" or "Tuesday" or "Wednesday" or "Thursday" or "Friday" or "Sunday") then doCreateTeleport(1387, config.topos, config.pos) doBroadcastMessage(config.msg_open) addEvent(DelTp, config.time*60*1000) addEvent(doBroadcastMessage, config.time*60*1000, config.msg_close) end return true end
-
DigoleraZica deu reputação a Toony em FAÇA SUA LOGO!Malz chegado, estive ausente, mas ja está ai, irei fazendo os outros e atualizando o post!
@DigoleraZica
@xMateuss
@ZikaLord
-
DigoleraZica deu reputação a Radamanthys Wov em [Pedido] Tibia Logo Artwork Top !Acho que ningúem vai animar fazer do jeito que você falou kki.
fiz isso ai agora.
-
DigoleraZica deu reputação a Rusherzin em (Resolvido)Background Bugado !Tentei arrumar, testa com esse arquivo. (botei em anexo porque ele tem 900+ linhas e fica difícil de copiar)
layout.php
-
DigoleraZica deu reputação a grafit em (Resolvido)Bug Site n Atualiza para HTDOCS recenteJá tentou Control+F5?