Ir para conteúdo

Marcelo m santos

Membro
  • Registro em

  • Última visita

Tudo que Marcelo m santos postou

  1. adicione isso em seu banco de dados CREATE TABLE IF NOT EXISTS `z_otskill_comunication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1567 ;
  2. local conf = { ["level"] = { -- [item_level] = {successPercent= CHANCE TO UPGRADE ITEM, downgradeLevel = ITEM GETS THIS LEVEL IF UPGRADE FAILS} [1] = {successPercent = 85, downgradeLevel = 0}, [2] = {successPercent = 80, downgradeLevel = 1}, [3] = {successPercent = 75, downgradeLevel = 2}, [4] = {successPercent = 70, downgradeLevel = 3}, [5] = {successPercent = 65, downgradeLevel = 4}, [6] = {successPercent = 60, downgradeLevel = 5}, [7] = {successPercent = 55, downgradeLevel = 6}, [8] = {successPercent = 50, downgradeLevel = 7}, [9] = {successPercent = 45, downgradeLevel = 0} }, ["upgrade"] = { -- how many percent attributes are rised? attack = 1, -- attack % defense = 1, -- defense % extraDefense = 2, -- extra defense % armor = 1, -- armor % hitChance = 1, -- hit chance % } } -- // do not touch // -- -- Upgrading system by Azi [Ersiu] -- -- Edited for TFS 1.1 by Zbizu -- local upgrading = { upValue = function (value, level, percent) if value < 0 then return 0 end if level == 0 then return value end local nVal = value for i = 1, level do nVal = nVal + (math.ceil((nVal/100*percent))) end return nVal > 0 and nVal or value end, getLevel = function (item) local name = Item(item):getName():split('+') if (#name == 1) then return 0 end return math.abs(name[2]) end, } function onUse(cid, item, fromPosition, itemEx, toPosition) local it = ItemType(itemEx.itemid) if((it:getWeaponType() > 0 or getItemAttribute(itemEx.uid, ITEM_ATTRIBUTE_ARMOR) > 0) and not isItemStackable(itemEx.itemid))then local level = upgrading.getLevel(itemEx.uid) if(level < #conf["level"])then local nLevel = (conf["level"][(level+1)].successPercent >= math.random(1,100)) and (level+1) or conf["level"][level].downgradeLevel if(nLevel > level)then doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Upgrade to level " .. nLevel .. " successful!") else doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Upgrade failed. Your " .. it:getName() .. " is now on level " .. nLevel .. "") end doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_NAME, it:getName()..((nLevel>0) and "+"..nLevel or "")) doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_ATTACK, upgrading.upValue(it:getAttack(), nLevel, conf["upgrade"].attack)) doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_DEFENSE, upgrading.upValue(it:getDefense(), nLevel, conf["upgrade"].defense)) doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_EXTRADEFENSE, upgrading.upValue(it:getExtraDefense(), nLevel, conf["upgrade"].extraDefense)) doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_ARMOR, upgrading.upValue(it:getArmor(), nLevel, conf["upgrade"].armor)) doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_HITCHANCE, upgrading.upValue(it:getHitChance(), nLevel, conf["upgrade"].hitChance)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your " .. it:getName() .. " is on max level alredy.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot upgrade this item.") end end tenta esse no meu esta perfeito
  3. Muito bom
  4. Marcelo m santos postou uma resposta no tópico em Suporte Tibia OTServer
    alguem pode me ajudar com esse erro no store os items não aparecem e sempre que entro na store pelo jogo da esse erro [Error - mysql_store_result] Query: SELECT `id`, `coins`, `description`, `timestamp` FROM `store_history` WHERE `account_id` = 2887 ORDER BY `timestamp` DESC LIMIT 17 OFFSET 0 e quando dou exit na store [Error - mysql_real_query] Query: SELECT `id`, `coins`, `description`, `timestamp` FROM `store_history` WHERE `account_id` = 2887 ORDER BY `timestamp` DESC LIMIT 17 OFFSET 0 não sei se é o distro mas já procurei em todos os lugares que possa imaginar ajudem por favor alguém pra me ajudar por favor não entendo essa parte da store_history e no phpmyadmim a tabela store_history esta bloqueada não da pra alterar
  5. Marcelo m santos postou uma resposta no tópico em Suporte Tibia OTServer
    Ola galera do tk gostaria de saber se alguem pode solucionar esse scripts por que gostaria de colocar em horarios certos de 1 em 1 hora , Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. raids.xml <!-- Bosses --> <raid name="Mega Exp Boss" file="bosses/mega exp boss.xml" interval2="230" margin="60" /> <raid name="Mega Baiak Boss" file="bosses/mega baiak boss.xml" interval2="230" margin="60" /> <raid name="Dragonling" file="bosses/dragonling.xml" interval2="230" margin="60" /> <raid name="Draptor" file="bosses/draptor.xml" interval2="230" margin="60" /> <raid name="GazHaragoth" file="bosses/Gaz'Haragoth.xml" interval2="230" margin="60" /> <raid name="glooth fairy" file="bosses/glooth fairy.xml" interval2="230" margin="60" /> <raid name="gnomo" file="bosses/gnomo.xml" interval2="230" margin="60" /> <raid name="Groam" file="bosses/Groam.xml" interval2="230" margin="60" /> <raid name="Hephaetus" file="bosses/Hephaetus.xml" interval2="230" margin="60" /> <raid name="infernatil" file="bosses/infernatil.xml" interval2="230" margin="60" /> <raid name="mage" file="bosses/magefull.xml" interval2="230" margin="60" /> <raid name="mazoran" file="bosses/mazoran.xml" interval2="230" margin="60" /> <raid name="Mega Demodras" file="bosses/Mega Demodras.xml" interval2="230" margin="60" /> <raid name="Necropharus" file="bosses/Necropharus.xml" interval2="230" margin="60" /> <raid name="Gonka" file="bosses/Gonka.xml" interval2="230" margin="60" /> <raid name="omrafir" file="bosses/omrafir.xml" interval2="230" margin="60" /> <raid name="plagirath" file="bosses/plagirath.xml" interval2="230" margin="60" /> <raid name="razzagorn" file="bosses/razzagorn.xml" interval2="230" margin="60" /> <raid name="shulgrax" file="bosses/shulgrax.xml" interval2="230" margin="60" /> <raid name="Sky Tower" file="bosses/Sky Tower.xml" interval2="230" margin="60" /> <raid name="slags" file="bosses/slags.xml" interval2="230" margin="60" /> <raid name="sky warrior" file="bosses/sky warrior.xml" interval2="230" margin="60" /> <raid name="tarbaz" file="bosses/tarbaz.xml" interval2="230" margin="60" /> <raid name="The Horned Fox" file="bosses/The Horned Fox.xml" interval2="230" margin="60" /> <raid name="Triple Medusa" file="bosses/Triple Medusa.xml" interval2="230" margin="60" /> <raid name="undead" file="bosses/undead.xml" interval2="230" margin="60" /> <raid name="Vampire Sky" file="bosses/Vampire Sky.xml" interval2="230" margin="60" /> <raid name="zamulosh" file="bosses/zamulosh.xml" interval2="230" margin="60" /> <raid name="zarifgoth" file="bosses/zarifgoth.xml" interval2="230" margin="60" /> <raid name="exp tower" file="bosses/exp tower.xml" interval2="230" margin="60" /> <raid name="ragiaz" file="bosses/ragiaz.xml" interval2="230" margin="60" /> </raids> esses são os boss
  6. gostaria de colocar vendas de players pelo site alguem pod me ajudar?
  7. Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 1.3; Base: Qual erro está surgindo/O que você procura? Ola halera do TK estou temdo problemas com Shop offer esta dando os seguintes erros se alguem puder ajudar agradeço Error occured! Error ID: ObjectData::getCustomField - Field kill_points does not exist in data / is not loaded.More info: File: /var/www/html/classes/objectdata.php Line: 52File: /var/www/html/pages/shopkill.php Line: 10File: /var/www/html/system/load.page.php Line: 7File: /var/www/html/index.php Line: 37 Você tem o código disponível? Se tiver publique-o aqui: Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  8. Vodkard estou com um erro no meu servidor pois o rewardchest só esta abrindo quando eu sumono um monstro quando ele nasce nolmalmente ele não da loot eo rewardchest não abre . voce poderia me dar uma ajuda pois já procurei em todos os scripts e nã achei nada function onCreatureAppear(self, creature) if self == creature then if self:getType():isRewardBoss() then self:setReward(true) end end end local function pushSeparated(buffer, sep, ...) local argv = {...} local argc = #argv for k, v in ipairs(argv) do table.insert(buffer, v) if k < argc and sep then table.insert(buffer, sep) end end end local function insertItems(buffer, info, parent, items) local start = info.running for _, item in ipairs(items) do if _ ~= 1 or parent > 100 then table.insert(buffer, ",") end info.running = info.running + 1 table.insert(buffer, "(") pushSeparated(buffer, ",", info.playerGuid, parent, info.running, item:getId(), item:getSubType(), db.escapeBlob(item:serializeAttributes())) table.insert(buffer, ")") if item:isContainer() then local size = item:getSize() if size > 0 then local subItems = {} for i = 1, size do table.insert(subItems, item:getItem(i - 1)) end insertItems(buffer, info, info.running, subItems) end end end return info.running - start end local function insertRewardItems(playerGuid, timestamp, itemList) db.asyncStoreQuery('SELECT `pid`, `sid` FROM `player_rewards` WHERE player_id = ' .. playerGuid .. ' ORDER BY `sid` ASC;', function(query) local lastReward = 0 local lastStoreId if query then repeat local sid = result.getDataInt(query, 'sid') local pid = result.getDataInt(query, 'pid') if pid < 100 then lastReward = pid end lastStoreId = sid until not result.next(query) end local buffer = {'INSERT INTO `player_rewards` (`player_id`, `pid`, `sid`, `itemtype`, `count`, `attributes`) VALUES'} --reward bag local info = { playerGuid = playerGuid, running = lastStoreId or 100 } local bag = Game.createItem(ITEM_REWARD_CONTAINER) bag:setAttribute(ITEM_ATTRIBUTE_DATE, timestamp) if itemList then for _, item in ipairs(itemList) do bag:addItem(item[1], item[2]) end end local total = insertItems(buffer, info, lastReward + 1, {bag}) table.insert(buffer, ";") if total ~= 0 then db.query(table.concat(buffer)) end end ) end local function getPlayerStats(bossId, playerGuid, autocreate) local ret = globalBosses[bossId][playerGuid] if not ret and autocreate then ret = { bossId = bossId, damageIn = 0, -- damage taken from the boss healing = 0, -- healing (other players) done } globalBosses[bossId][playerGuid] = ret return ret end return ret end function onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified) local monsterType = creature:getType() if monsterType:isRewardBoss() then -- Make sure it is a boss local bossId = creature:getId() local timestamp = os.time() local totalDamageOut, totalDamageIn, totalHealing = 0.1, 0.1, 0.1 -- avoid dividing by zero local scores = {} local info = globalBosses[bossId] local damageMap = creature:getDamageMap() for guid, stats in pairs(info) do local player = Player(stats.playerId) local part = damageMap[stats.playerId] local damageOut, damageIn, healing = (stats.damageOut or 0) + (part and part.total or 0), stats.damageIn or 0, stats.healing or 0 totalDamageOut = totalDamageOut + damageOut totalDamageIn = totalDamageIn + damageIn totalHealing = totalHealing + healing table.insert(scores, { player = player, guid = guid, damageOut = damageOut, damageIn = damageIn, healing = healing, }) end local participants = 0 for _, con in ipairs(scores) do local score = (con.damageOut / totalDamageOut) + (con.damageIn / totalDamageIn) + (con.healing / totalHealing) con.score = score / 3 -- normalize to 0-1 if score ~= 0 then participants = participants + 1 end end table.sort(scores, function(a, b) return a.score > b.score end) local expectedScore = 1 / participants for _, con in ipairs(scores) do local reward, stamina -- ignoring stamina for now because I heard you receive rewards even when it's depleted if con.player then reward = con.player:getReward(timestamp, true) stamina = con.player:getStamina() else stamina = con.stamina or 0 end local playerLoot if --[[stamina > 840 and]] con.score ~= 0 then local lootFactor = 1 lootFactor = lootFactor / participants ^ (1 / 3) -- tone down the loot a notch if there are many participants lootFactor = lootFactor * (1 + lootFactor) ^ (con.score / expectedScore) -- increase the loot multiplicatively by how many times the player surpassed the expected score playerLoot = monsterType:getBossReward(lootFactor, _ == 1) if con.player then for _, p in ipairs(playerLoot) do reward:addItem(p[1], p[2]) end end end if con.player then local lootMessage = {"The following items are available in your reward chest: "} if --[[stamina > 840]]true then reward:getContentDescription(lootMessage) else table.insert(lootMessage, 'nothing (due to low stamina)') end table.insert(lootMessage, ".") con.player:sendTextMessage(MESSAGE_EVENT_ADVANCE, table.concat(lootMessage)) else insertRewardItems(con.guid, timestamp, playerLoot) end end globalBosses[bossId] = nil end return true end function onThink(creature, interval) local bossId = creature:getId() local info = globalBosses[bossId] -- Reset all players' status for _, player in pairs(info) do player.active = true end -- Set all players in boss' target list as active in the fight local targets = creature:getTargetList() for _, target in ipairs(targets) do if target:isPlayer() then local stats = getPlayerStats(bossId, target:getGuid(), true) stats.playerId = target:getId() -- Update player id stats.active = true end end end function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if not next(globalBosses) then return primaryDamage, primaryType, secondaryDamage, secondaryType end if not creature or not attacker then return primaryDamage, primaryType, secondaryDamage, secondaryType end local stats = creature:inBossFight() if not stats then return primaryDamage, primaryType, secondaryDamage, secondaryType end local creatureId, attackerId = creature:getId(), attacker:getId() stats.playerId = creatureId -- Update player id -- Account for healing of others active in the boss fight if primaryType == COMBAT_HEALING and attacker:isPlayer() and attackerId ~= creatureId then local healerStats = getPlayerStats(stats.bossId, attacker:getGuid(), true) healerStats.active = true healerStats.playerId = attackerId -- Update player id healerStats.healing = healerStats.healing + primaryDamage elseif stats.bossId == attackerId then -- Account for damage taken from the boss stats.damageIn = stats.damageIn + primaryDamage end return primaryDamage, primaryType, secondaryDamage, secondaryType end CREATURESCRIPTS/SCRIPTS
  9. já coloquei mas não deu certo ta do mesmo jeito amigo agora sim deu certo muito obrigado pela ajuda ficou 100%
  10. TFS 1.3 já procurei em todos os scripts creaturescripts.scriprs, actions movements e não achei o erro , quando o mnstro é sumonado por mom (ADM) O loot cai no reward chest normalmente mas quando adiciono ele no mapa os monstros não dão loot nem os monstros da invasões se alguem poder ajudar pois não achei em nem um topico a resposta pra isso e creio que mutos tambem tem essa duvida
  11. Ola galera do tibiaking a muito tempo estou tentando arrumar o rewardloot dos bosses sendo que quando sumonado funciona legal mas quando coloco automatico (eventos,quests) não funciona gostaria de seber se alguem podeira dar un jeito nisso não achei o erro function onCreatureAppear(self, creature) if self == creature then if self:getType():isRewardBoss() then self:setReward(true) end end end local function pushSeparated(buffer, sep, ...) local argv = {...} local argc = #argv for k, v in ipairs(argv) do table.insert(buffer, v) if k < argc and sep then table.insert(buffer, sep) end end end local function insertItems(buffer, info, parent, items) local start = info.running for _, item in ipairs(items) do if _ ~= 1 or parent > 100 then table.insert(buffer, ",") end info.running = info.running + 1 table.insert(buffer, "(") pushSeparated(buffer, ",", info.playerGuid, parent, info.running, item:getId(), item:getSubType(), db.escapeBlob(item:serializeAttributes())) table.insert(buffer, ")") if item:isContainer() then local size = item:getSize() if size > 0 then local subItems = {} for i = 1, size do table.insert(subItems, item:getItem(i - 1)) end insertItems(buffer, info, info.running, subItems) end end end return info.running - start end local function insertRewardItems(playerGuid, timestamp, itemList) db.asyncStoreQuery('SELECT `pid`, `sid` FROM `player_rewards` WHERE player_id = ' .. playerGuid .. ' ORDER BY `sid` ASC;', function(query) local lastReward = 0 local lastStoreId if query then repeat local sid = result.getDataInt(query, 'sid') local pid = result.getDataInt(query, 'pid') if pid < 100 then lastReward = pid end lastStoreId = sid until not result.next(query) end local buffer = {'INSERT INTO `player_rewards` (`player_id`, `pid`, `sid`, `itemtype`, `count`, `attributes`) VALUES'} --reward bag local info = { playerGuid = playerGuid, running = lastStoreId or 100 } local bag = Game.createItem(ITEM_REWARD_CONTAINER) bag:setAttribute(ITEM_ATTRIBUTE_DATE, timestamp) if itemList then for _, item in ipairs(itemList) do bag:addItem(item[1], item[2]) end end local total = insertItems(buffer, info, lastReward + 1, {bag}) table.insert(buffer, ";") if total ~= 0 then db.query(table.concat(buffer)) end end ) end local function getPlayerStats(bossId, playerGuid, autocreate) local ret = globalBosses[bossId][playerGuid] if not ret and autocreate then ret = { bossId = bossId, damageIn = 0, -- damage taken from the boss healing = 0, -- healing (other players) done } globalBosses[bossId][playerGuid] = ret return ret end return ret end function onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified) local monsterType = creature:getType() if monsterType:isRewardBoss() then -- Make sure it is a boss local bossId = creature:getId() local timestamp = os.time() local totalDamageOut, totalDamageIn, totalHealing = 0.1, 0.1, 0.1 -- avoid dividing by zero local scores = {} local info = globalBosses[bossId] local damageMap = creature:getDamageMap() for guid, stats in pairs(info) do local player = Player(stats.playerId) local part = damageMap[stats.playerId] local damageOut, damageIn, healing = (stats.damageOut or 0) + (part and part.total or 0), stats.damageIn or 0, stats.healing or 0 totalDamageOut = totalDamageOut + damageOut totalDamageIn = totalDamageIn + damageIn totalHealing = totalHealing + healing table.insert(scores, { player = player, guid = guid, damageOut = damageOut, damageIn = damageIn, healing = healing, }) end local participants = 0 for _, con in ipairs(scores) do local score = (con.damageOut / totalDamageOut) + (con.damageIn / totalDamageIn) + (con.healing / totalHealing) con.score = score / 3 -- normalize to 0-1 if score ~= 0 then participants = participants + 1 end end table.sort(scores, function(a, b) return a.score > b.score end) local expectedScore = 1 / participants for _, con in ipairs(scores) do local reward, stamina -- ignoring stamina for now because I heard you receive rewards even when it's depleted if con.player then reward = con.player:getReward(timestamp, true) stamina = con.player:getStamina() else stamina = con.stamina or 0 end local playerLoot if --[[stamina > 840 and]] con.score ~= 0 then local lootFactor = 1 lootFactor = lootFactor / participants ^ (1 / 3) -- tone down the loot a notch if there are many participants lootFactor = lootFactor * (1 + lootFactor) ^ (con.score / expectedScore) -- increase the loot multiplicatively by how many times the player surpassed the expected score playerLoot = monsterType:getBossReward(lootFactor, _ == 1) if con.player then for _, p in ipairs(playerLoot) do reward:addItem(p[1], p[2]) end end end if con.player then local lootMessage = {"The following items are available in your reward chest: "} if --[[stamina > 840]]true then reward:getContentDescription(lootMessage) else table.insert(lootMessage, 'nothing (due to low stamina)') end table.insert(lootMessage, ".") con.player:sendTextMessage(MESSAGE_EVENT_ADVANCE, table.concat(lootMessage)) else insertRewardItems(con.guid, timestamp, playerLoot) end end globalBosses[bossId] = nil end return true end function onThink(creature, interval) local bossId = creature:getId() local info = globalBosses[bossId] -- Reset all players' status for _, player in pairs(info) do player.active = true end -- Set all players in boss' target list as active in the fight local targets = creature:getTargetList() for _, target in ipairs(targets) do if target:isPlayer() then local stats = getPlayerStats(bossId, target:getGuid(), true) stats.playerId = target:getId() -- Update player id stats.active = true end end end function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if not next(globalBosses) then return primaryDamage, primaryType, secondaryDamage, secondaryType end if not creature or not attacker then return primaryDamage, primaryType, secondaryDamage, secondaryType end local stats = creature:inBossFight() if not stats then return primaryDamage, primaryType, secondaryDamage, secondaryType end local creatureId, attackerId = creature:getId(), attacker:getId() stats.playerId = creatureId -- Update player id -- Account for healing of others active in the boss fight if primaryType == COMBAT_HEALING and attacker:isPlayer() and attackerId ~= creatureId then local healerStats = getPlayerStats(stats.bossId, attacker:getGuid(), true) healerStats.active = true healerStats.playerId = attackerId -- Update player id healerStats.healing = healerStats.healing + primaryDamage elseif stats.bossId == attackerId then -- Account for damage taken from the boss stats.damageIn = stats.damageIn + primaryDamage end return primaryDamage, primaryType, secondaryDamage, secondaryType end alguem pra ajudar estou precisando muito
  12. Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 1.3; Base: Qual erro está surgindo/O que você procura? estou querendo adicionar store ,inbox pra fazer compras diretamente pelo jogo mas estou totalmente perdido alguem pode me ajudar por onde começar Você tem o código disponível? Se tiver publique-o aqui: Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

Informação Importante

Confirmação de Termo