Ir para conteúdo

Muvukaa

Membro
  • Registro em

  • Última visita

Tudo que Muvukaa postou

  1. local percent = 0 -- Set this to 0 to make the monster immortal local monster = "Rotworm" function onStatsChange(cid, attacker, type, combat, value) if (type == STATSCHANGE_HEALTHLOSS) and isCreature(cid) and getCreatureName(cid) == monster then -- Prevent health loss value = 0 doTargetCombatHealth(attacker, cid, combat, -value, 255) doSendAnimatedText(getCreaturePos(cid), "Immortal", TEXTCOLOR_RED) return false end return true end
  2. [C++] CAST SYSTEM PRA TFS 0.3.6 8.60 ALGUEM PODE ME ENSINAR COMO COLOCA CAST SYSTEM NA SOURCE/DATA
  3. Como Funciona em cada 12 12 horas o console do distro é limpo clean log? por que abri esse topico eu eprcebi conforme vai se passando as horas online server fica lag por causa do log do distro eu queria um sistema que limpasse log do distro sem precisa click clean log fosse automático em 12 horas.
  4. [C++] -=[TFS]=- 0.3.6 - 8.60 - PROBLEMA ENCONTRADO FOI NO PLAYER.CPP O ITEM AGORA CAI SLOT DO PLAYER NÃO CAI MAIS NO CHÃO AQUI ESTA PROBLEMA O ITEM CAI NO SLOT DO PLAYER ELE AGRUPA ITENS EMPILHA AUTOMATICAMENTE MAIS SÓ NO SLOT ELE NAO EMPILHA NA BACKPACK Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t& flags) { if (index == 0 /* drop to capacity window */ || index == INDEX_WHEREEVER) { *destItem = NULL; const Item* item = thing->getItem(); if (!item) return this; // Tentar encontrar um slot apropriado no inventário for (int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i) { if (!inventory[i]) { if (__queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR) { index = i; return this; } } else if (inventory[i] != tradeItem) { if (Item* inventoryItem = inventory[i]) { // Tentar empilhar itens if (inventoryItem->getID() == item->getID() && inventoryItem->isStackable() && inventoryItem->getItemCount() < 100) { *destItem = inventoryItem; index = i; return this; } } } } // Tentar adicionar aos containers do inventário std::list<std::pair<Container*, int32_t> > deepList; for (int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i) { if (inventory[i] == tradeItem) continue; if (Container* container = dynamic_cast<Container*>(inventory[i])) { if (container->__queryAdd(-1, item, item->getItemCount(), 0) == RET_NOERROR) { index = INDEX_WHEREEVER; *destItem = NULL; return container; } deepList.push_back(std::make_pair(container, 0)); } } // Verificar mais profundamente nos containers int32_t deepness = g_config.getNumber(ConfigManager::PLAYER_DEEPNESS); for (std::list<std::pair<Container*, int32_t> >::iterator dit = deepList.begin(); dit != deepList.end(); ++dit) { Container* c = (*dit).first; if (!c || c->empty()) continue; int32_t level = (*dit).second; for (ItemList::const_iterator it = c->getItems(); it != c->getEnd(); ++it) { if ((*it) == tradeItem) continue; if (Container* subContainer = dynamic_cast<Container*>(*it)) { if (subContainer->__queryAdd(-1, item, item->getItemCount(), 0) == RET_NOERROR) { index = INDEX_WHEREEVER; *destItem = NULL; return subContainer; } if (deepness < 0 || level < deepness) deepList.push_back(std::make_pair(subContainer, (level + 1))); } } } // Se não encontrou lugar adequado, retorna this return this; } Thing* destThing = __getThing(index); if (destThing) *destItem = destThing->getItem(); if (Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing)) { index = INDEX_WHEREEVER; *destItem = NULL; return subCylinder; } return this; }
  5. print( aparece isso ---> Player vocation set to NPC/SCRIPT/PROMOTION.LUA local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local vocation = { [2] = 6, [3] = 7, [4] = 8 } 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 = cid msg = string.lower(msg) local requiredLevel = 717217 local vipCoinsItemId = 11192 local requiredVipCoins = 100 if isInArray({"promotion", "promot", "promo"}, msg) then selfSay('You need to have a premium account, 100 [VIP COINS], and be at level 717217!', cid) talkState[talkUser] = 1 elseif msg == "yes" and talkState[talkUser] == 1 then local playerVocation = getPlayerVocation(cid) if vocation[playerVocation] then if isPremium(cid) then if getPlayerLevel(cid) >= requiredLevel then if getPlayerItemCount(cid, vipCoinsItemId) >= requiredVipCoins then doPlayerRemoveItem(cid, vipCoinsItemId, requiredVipCoins) local newVocationId = vocation[playerVocation] doPlayerSetVocation(cid, newVocationId) doSendMagicEffect(getPlayerPosition(cid), 12) selfSay("Congratulations, you have been promoted!", cid) else selfSay("You do not have enough [VIP COINS] to be promoted.", cid) end else selfSay("Sorry, you need to be at level 717217 or higher to be promoted!", cid) end else selfSay("Sorry, you need to be a premium player to be promoted.", cid) end else selfSay("Sorry, you cannot receive promotion.", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) VOCATION.XML <?xml version="1" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="0" soulmax="255" gainsoulticks="1" basespeed="1" fromvoc="0" attackable="no"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="1"/> </vocation> <vocation id="1" name="nil" description="nil" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="4" gainmanaamount="1" manamultiplier="1" attackspeed="1500" soulmax="100" gainsoulticks="1" basespeed="100" fromvoc="nil"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="1"/> </vocation> <vocation id="2" name="Mage" description="Mage" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="1500" soulmax="100" gainsoulticks="1" basespeed="100" fromvoc="2"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1.8" axe="1" distance="1" shielding="1" fishing="1" experience="99999"/> </vocation> <vocation id="3" name="Paladin" description="Paladin" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="1500" soulmax="100" gainsoulticks="1" basespeed="100" fromvoc="3"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="99999"/> </vocation> <vocation id="4" name="Knight" description="Knight" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="1500" soulmax="100" gainsoulticks="1" basespeed="100" fromvoc="4"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="99999"/> </vocation> <vocation id="5" name="nil" description="nil" needpremium="0" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="1500" soulmax="1" gainsoulticks="1" basespeed="100" lessloss="0" fromvoc="nil"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="1"/> </vocation> <vocation id="6" name="[VIP] Mage" description="[VIP] Mage" needpremium="1" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="0" soulmax="255" gainsoulticks="1" basespeed="220" fromvoc="2" lessloss="0"> <formula mleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="100000"/> </vocation> <vocation id="7" name="[VIP] Paladin" description="[VIP] Paladin" needpremium="1" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="0" soulmax="255" gainsoulticks="1" basespeed="220" fromvoc="3" lessloss="0"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="100000"/> </vocation> <vocation id="8" name="[VIP] Knight" description="[VIP] Knight" needpremium="1" gaincap="1" gainhp="1" gainmana="1" gainhpticks="1" gainhpamount="1" gainmanaticks="1" gainmanaamount="1" manamultiplier="1" attackspeed="0" soulmax="255" gainsoulticks="1" basespeed="220" fromvoc="4" lessloss="0"> <formula meleeDamage="1" distDamage="1" wandDamage="1" magDamage="1" magHealingDamage="1" defense="1" magDefense="1" armor="1"/> <skill fist="1" club="1" sword="1" axe="1" distance="1" shielding="1" fishing="1" experience="100000"/> </vocation> </vocations> data/npc/scripts/promotion.lua:15: in function <data/npc/scripts/promotion.lua:15> [20/07/2024 08:57:34] [Error - Npc interface] [20/07/2024 08:57:34] data/npc/scripts/promotion.lua:onThink [20/07/2024 08:57:34] Description: [20/07/2024 08:57:34] (luaGetNpcDistanceTo) Thing not found [20/07/2024 08:57:34] [Error - Npc interface] [20/07/2024 08:57:35] data/npc/scripts/promotion.lua:onThink [20/07/2024 08:57:35] Description: [20/07/2024 08:57:35] (luaGetCreatureName) Creature not found [20/07/2024 08:57:35] [Error - Npc interface] [20/07/2024 08:57:35] data/npc/scripts/promotion.lua:onThink [20/07/2024 08:57:35] Description: [20/07/2024 08:57:35] data/npc/lib/npcsystem/npchandler.lua:301: bad argument #3 to 'gsub' (string/function/table expected) [20/07/2024 08:57:35] stack traceback: [20/07/2024 08:57:35] [C]: in function 'gsub' [20/07/2024 08:57:35] data/npc/lib/npcsystem/npchandler.lua:301: in function 'parseMessage' [20/07/2024 08:57:35] data/npc/lib/npcsystem/npchandler.lua:538: in function 'onWalkAway' [20/07/2024 08:57:35] data/npc/lib/npcsystem/npchandler.lua:473: in function 'onThink' [20/07/2024 08:57:35] data/npc/scripts/promotion.lua:15: in function <data/npc/scripts/promotion.lua:15>
  6. -=[TFS]=- 0.3.6 - 8.60 - Alguém Sabe o ID do Channel NPCs
  7. <talkaction words="!guildrank" event="script" value="guildrank.lua"/> TA DANDO ESSE ERRO OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such column: guild_id (SELECT level, guild_id FROM players WHERE guild_id > 0 AND level > 10 ORDER BY level DESC) function onSay(cid, words, param) local guilds = {} local guild_rank = {} -- Seleciona o level e a guild de cada jogador com guild e com level maior que 10, ordenados pelo level local query = db.getResult("SELECT level, guild_id FROM players WHERE guild_id > 0 AND level > 10 ORDER BY level DESC") -- Caso nenhum jogador seja selecionado, retorna verdadeiro if query:getID() == -1 then return true end repeat local level = query:getDataInt("level") local guild_id = query:getDataInt("guild_id") -- Cria uma tabela dentro da tabela guilds para cada guilda if not guilds[guild_id] then guilds[guild_id] = {level = level, members = 1} -- Se a tabela já existir e o número de membros for menor que 10, soma o level e +1 ao número de membros elseif guilds[guild_id].members < 10 then guilds[guild_id].level = guilds[guild_id].level + level guilds[guild_id].members = guilds[guild_id].members + 1 end -- Termina se não existirem mais resultados until not query:next() query:free() -- Passa os resultados obtidos para a tabela guild_rank, para ordená-la com table.sort for i, k in pairs(guilds) do table.insert(guild_rank, {id = i, level = k.level}) end -- Ordena a tabela guild_rank de acordo com a soma dos levels table.sort(guild_rank, function(a, b) return a.level > b.level end) local i = 0 local str = ' Guild Rank\n' -- Crie uma string com o nome das guildas em um ranking for _, info in pairs(guild_rank) do i = i + 1 str = str .. i .. ' - '.. getGuildNameById(info.id) .. ' - ' .. info.level .. '\n' if i == 10 then break end end -- Se algum erro ocorrer e o ranking não tiver informações, manda a mensagem "No Guild Information..." local ret = str ~= ' Guild Rank\n' and str or "No guild information to be displayed." doPlayerPopupFYI(cid, ret) return true end
  8. <talkaction words="!guildrank" event="script" value="guildrank.lua"/> TA DANDO ESSE ERRO OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such column: guild_id (SELECT level, guild_id FROM players WHERE guild_id > 0 AND level > 10 ORDER BY level DESC) function onSay(cid, words, param) local guilds = {} local guild_rank = {} -- Seleciona o level e a guild de cada jogador com guild e com level maior que 10, ordenados pelo level local query = db.getResult("SELECT level, guild_id FROM players WHERE guild_id > 0 AND level > 10 ORDER BY level DESC") -- Caso nenhum jogador seja selecionado, retorna verdadeiro if query:getID() == -1 then return true end repeat local level = query:getDataInt("level") local guild_id = query:getDataInt("guild_id") -- Cria uma tabela dentro da tabela guilds para cada guilda if not guilds[guild_id] then guilds[guild_id] = {level = level, members = 1} -- Se a tabela já existir e o número de membros for menor que 10, soma o level e +1 ao número de membros elseif guilds[guild_id].members < 10 then guilds[guild_id].level = guilds[guild_id].level + level guilds[guild_id].members = guilds[guild_id].members + 1 end -- Termina se não existirem mais resultados until not query:next() query:free() -- Passa os resultados obtidos para a tabela guild_rank, para ordená-la com table.sort for i, k in pairs(guilds) do table.insert(guild_rank, {id = i, level = k.level}) end -- Ordena a tabela guild_rank de acordo com a soma dos levels table.sort(guild_rank, function(a, b) return a.level > b.level end) local i = 0 local str = ' Guild Rank\n' -- Crie uma string com o nome das guildas em um ranking for _, info in pairs(guild_rank) do i = i + 1 str = str .. i .. ' - '.. getGuildNameById(info.id) .. ' - ' .. info.level .. '\n' if i == 10 then break end end -- Se algum erro ocorrer e o ranking não tiver informações, manda a mensagem "No Guild Information..." local ret = str ~= ' Guild Rank\n' and str or "No guild information to be displayed." doPlayerPopupFYI(cid, ret) return true end
  9. [SOURCE]: COMPILADOR DEV -C++ [C++] TFS 0.3.6 8.60 [RESOLVIDO] PRA QUEM ENFRENTA ESSE PROBLEMA É SÓ SUBSTITUI TILE 11059 POR 11060 E COLOCA ESSE CODIGO NA SOURCE Player.cpp e no items.xml </item> <item id="11059" name="glowing switch"> </item> <item id="11060" name="glowing switch"> <attribute key="walkStack" value="0"/> </item> PROCURE POR bool Player::canWalkthrough(const Creature* creature) const SUBSTITUI POR ESSE EM BAIXO bool Player::canWalkthrough(const Creature* creature) const { if (creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if (!player) return false; const Tile* playerTile = player->getTile(); // Verificar se a tile do jogador de destino é 11060 e não permitir atravessar if (playerTile && playerTile->ground && playerTile->ground->getID() == 11060) return false; // Permitir atravessar em áreas de proteção, exceto na tile 11060 if (playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE)) return true; if ((((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation()->isAttackable()) || (playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE)) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && playerTile->ground) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); } QUALQUER LEVEL NÃO ENTRA PODE DEIXA protectionLevel = 1 QUE LEVEL QUISER. movements tiles.lua substitua seu por esse: local config = { maxLevel = getConfigInfo('maximumDoorLevel') } local increasingItems = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11059] = 11060} local decreasingItems = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11060] = 11059} local depots = {2589, 2590, 2591, 2592} local checkCreature = {isPlayer, isMonster, isNpc} local function pushBack(cid, position, fromPosition, displayMessage) doTeleportThing(cid, fromPosition, false) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) if(displayMessage) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.") end end function onStepIn(cid, item, position, fromPosition) if(not increasingItems[item.itemid]) then return false end if(not isPlayerGhost(cid)) then doTransformItem(item.uid, increasingItems[item.itemid]) end if(item.actionid >= 194 and item.actionid <= 196) then local f = checkCreature[item.actionid - 193] if(f(cid)) then pushBack(cid, position, fromPosition, false) end return true end if(item.actionid >= 191 and item.actionid <= 193) then local f = checkCreature[item.actionid - 190] if(not f(cid)) then pushBack(cid, position, fromPosition, false) end return true end if(not isPlayer(cid)) then return true end if(item.actionid == 189 and not isPremium(cid)) then pushBack(cid, position, fromPosition, true) return true end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then if(gender ~= getPlayerSex(cid)) then pushBack(cid, position, fromPosition, true) end return true end local skull = item.actionid - 180 if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then if(skull ~= getCreatureSkullType(cid)) then pushBack(cid, position, fromPosition, true) end return true end local group = item.actionid - 150 if(group >= 0 and group < 30) then if(group > getPlayerGroupId(cid)) then pushBack(cid, position, fromPosition, true) end return true end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then pushBack(cid, position, fromPosition, true) end return true end if(item.actionid >= 1000 and item.actionid <= config.maxLevel) then if(getPlayerLevel(cid) < item.actionid - 1000) then pushBack(cid, position, fromPosition, true) end return true end if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) <= 0) then pushBack(cid, position, fromPosition, true) return true end if(getTileInfo(position).protection) then local depotPos, depot = getCreatureLookPosition(cid), {} depotPos.stackpos = STACKPOS_GROUND while(true) do if(not getTileInfo(depotPos).depot) then break end depotPos.stackpos = depotPos.stackpos + 1 depot = getThingFromPos(depotPos) if(depot.uid == 0) then break end if(isInArray(depots, depot.itemid)) then local depotItems = getPlayerDepotItems(cid, getDepotId(depot.uid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s" or "") .. ".") break end end return true end return false end function onStepOut(cid, item, position, fromPosition) if(not decreasingItems[item.itemid]) then return false end if(not isPlayerGhost(cid)) then doTransformItem(item.uid, decreasingItems[item.itemid]) return true end return false end
  10. Deu certo muito obrigado @estopa eu to com problema na source com tile 11059 os player se atravessam no depot player ta no depot player entra dentro do outro.
  11. NÃO RECEBO 1KK DO ID function onUse(cid, item, frompos, item2, topos) local requiredCapacity = 360001.42 -- Minimum inventory capacity in oz local chestUID = 1624 if item.uid == chestUID then if getPlayerStorageValue(cid, chestUID) == -1 then if getPlayerLevel(cid) >= 0 then -- Check if the player has enough space in the inventory if getPlayerFreeCap(cid) < requiredCapacity then doPlayerSendCancel(cid, "You need at least 360001.42 oz of free capacity to use this chest.") return true end -- Add backpacks with ID 10518 to the player's inventory for i = 1, 42 do if not doPlayerAddItem(cid, 10518, 1) then doPlayerSendCancel(cid, "You don't have enough space for the backpacks.") return true end end -- Add 1,000,000 coins (ID 6527) inside a backpack (ID 10518) and repeat 100 times for i = 1, 100 do local backpack = doCreateItemEx(10518, 1) if backpack ~= 0 then for j = 1, 42 do doAddContainerItem(backpack, 6527, 1000000) end doPlayerAddItemEx(cid, backpack, false) else doPlayerSendCancel(cid, "You don't have enough space for the backpacks.") return true end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have won a prize.") setPlayerStorageValue(cid, chestUID, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 0 to use this chest.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already received the bonus from this chest.") end end return true end
  12. Player.cpp ::CODE:: C++ bool Player::canWalkthrough(const Creature* creature) const { // Verificação básica para permitir travessia em casos permitidos if (creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if (!player) return false; // Verificação para o tile específico ID 11060 if (this->getTile() && this->getTile()->ground && this->getTile()->ground->getID() == 11060 && player->getTile() && player->getTile()->ground && player->getTile()->ground->getID() == 11060) { // Verifica se os jogadores estão exatamente na mesma posição if (this->getPosition() == player->getPosition()) { return false; // Impede a travessia se estiverem na mesma posição } } // Verificações adicionais para áreas de proteção e PvP if (((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation() && player->getVocation()->isAttackable()) || (player->getTile() && player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE)) || (player->getVocation() && player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile() && player->getTile()->ground && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; // Verificação se um dos jogadores é um fantasma return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }
  13. @L3K0T eu fiz adaptação porem deu certo mais ele entra dentro do player depois sai e nao da pra entra mais o problema é que ele entra dentro do player no tile id 11059 ele entra uma vez dentro depois nao entra mais Esse Script * function onCombat(cid, target) Não deu certo eu to usando CHATGPT PRA CODIGO C++ NA SOURCE TO FOCANDO AQUI NO CHATGPT: bool Player::canWalkthrough(const Creature* creature) const { if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if(!player) return false; // Verificação para o tile específico ID 11059 if(player->getTile()->ground->getID() == 11059) return false; if((((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }
  14. @L3K0T Testei todos os códigos e continua atravessando player no depot. protectionLevel = 1 quando ta 1 ele não passa através do player quando ta 2 ou 3 ele passa através do player no depot o problema ta no protectionLevel ja puis no pvp zone tool no tile nao adiantou apareceu quantos itens tenho no depot https://prnt.sc/ONinQz6oJqsK mais continua atravessando player no depot <item fromid="11059" toid="11060" name="glowing switch">
  15. Engraçado quando to level maior que protect level passa quando to com 1 protect level config lua nao passa impede de me atravessa no depot id Baiak Yurots 1
  16. https://prnt.sc/Xwk7yEW-qsXI https://prnt.sc/BsBO3dkr3y4-
  17. </item> <item fromid="11059" toid="11060" name="glowing switch"> <attribute key="walkStack" value="0"/> DEIXEI ASSIM
  18. ele entra dentro do player ele continua entrando fiz tudo certinho que se falo e nao da
  19. JA TENTEI </item> <item id="11059" name="glowing switch"> <attribute key="walkStack" value="0"/> </item> protectionLevel = 1 Player.cpp bool Player::canWalkthrough(const Creature* creature) const { if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if(!player) return false; if((((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }

Informação Importante

Confirmação de Termo