Jump to content
Close

Gabrieldsadaxas

Member
  • Content Count

    34
  • Joined

  • Last visited

About Gabrieldsadaxas

  • Rank
    Craftsman

Profile Information

  • Gender
    Masculino
  • Localization
    São Paulo
  • I am
    OT-Admin
  • Favorite OTServ
    unclearot.com.br
  • Bot preferred
    ElfBot

Recent Profile Visitors

654 profile views
  1. refiz tudo do 0 e agora continua aparecendo a msg de que tenho mais de 1 char no sistema mas os 2 ainda recebem o loot
  2. agr nenhum dos 2 ganham premios, erro no console: [15:1:01.683] [Error - CreatureScript Interface] [15:1:01.695] In a timer event called from: [15:1:01.696] data/creaturescripts/scripts/rewardchest_boss.lua:onDeath [15:1:01.698] Description: [15:1:01.699] (LuaInterface::luaGetCreatureStorage) Creature not found [15:1:01.712] [Error - CreatureScript Interface] [15:1:01.714] In a timer event called from: [15:1:01.715] data/creaturescripts/scripts/rewardchest_boss.lua:onDeath [15:1:01.716] Description: [15:1:01.718] data/creaturescripts/scripts/rewardchest_boss.lua:71: bad argument #1 to 'ceil' (number expected, got boolean) [15:1:01.791] stack traceback: [15:1:01.793] [C]: in function 'ceil' [15:1:01.794] data/creaturescripts/scripts/rewardchest_boss.lua:71: in function <data/creaturescripts/scripts/rewardchest_boss.lua:57>
  3. @luanluciano93 fiquei recebendo a mensagem de que eu já tinha um personagem participando do boss e tal mas os 2 receberam loot anyway, nenhum erro no console
  4. @luanluciano93 sabe como eu posso bloquear mcs de receber também? ou pelo menos limitar o loot do mc
  5. assim que eu testar aviso aqui, vlw man @Vodkart se liga o que acontece quando uma torre chega a 75% de hp e aqui 50 o mesmo com 25 o que vc fez solucionou, agora tem que matar as 3 torres o problema é que, realmente, esta sendo executado varias vezes a mesma função/linha
  6. @Vodkart acredito só ter mudado algumas mensagens e os premios, segue o script e as tags tags: <event type="kill" name="KillGerador" event="script" value="dota_system.lua"/> <event type="login" name="DotaLogin" event="script" value="dota_system.lua"/> <event type="PrepareDeath" name="DeathDota" event="script" value="dota_system.lua"/> <event type="combat" name="DotaAttack" event="script" value="dota_system.lua"/> <event type="statschange" name="TowerStats" event="script" value="dota_system.lua"/> <event type="death" name="JungleDeath" event="script" value="dota_system.lua"/> dota_system.lua: function onPrepareDeath(cid, deathList) if isPlayer(cid) and getPlayerStorageValue(cid, dota_config.storages[1]) > 0 then local strings = {""} local j, position, corpse = 1, 1, 0 for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" j = j + 1 else strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" j = j + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end desc = "You recognize " desc = desc .. "" .. getCreatureName(cid) .. ". He was killed by " .. str end if(getPlayerSex(cid) == 1) then corpse = doCreateItem(3058, getCreaturePosition(cid)) else corpse = doCreateItem(3065, getCreaturePosition(cid)) end doItemSetAttribute(corpse, "description", desc) doCreatureSetNoMove(cid, true) setPlayerStorageValue(cid, dota_config.storages[6], 1) noMoveAfterDeath(cid, dota_config.DeathDelay) setPlayerStorageValue(cid, 878756, 0) -- special kill doRemoveConditions(cid, false) doAddCondition(cid, getPlayerStorageValue(cid, dota_config.storages[3]) > 0 and conditionDotaBlue or conditionDotaRed) if isPlayer(deathList[1]) then dotaBroadSpecialKills(deathList[1], cid) end end return true end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then local var, jungle = DotaTowers_Lib[getCreatureName(target)],Monsters_Dota[getCreatureName(target)] if var then -- towers and nexus if var.winners == nil then local storage = isInArray({"Mid Tower Blue","Bot Tower Blue","Top Tower Blue"}, getCreatureName(target)) and dota_config.storages[5] or dota_config.storages[6] setGlobalStorageValue(storage, getGlobalStorageValue(storage)+1) if getGlobalStorageValue(storage) <= 2 then broadcastMessage("[Evento Dota] A "..getCreatureName(target).." Foi Destruida! ["..getGlobalStorageValue(storage).."/3]", MESSAGE_EVENT_ADVANCE) elseif getGlobalStorageValue(storage) == 3 then local ret = isInArray({"Mid Tower Blue","Bot Tower Blue","Top Tower Blue"}, getCreatureName(target)) and "Blue Nexus" or "Red Nexus" broadcastMessage("[Evento Dota] A última Torre "..getCreatureName(target).." Foi Destruido! O "..ret.." Surgiu!", MESSAGE_EVENT_ADVANCE) createNexus(ret) end else broadcastMessage("[Evento Dota] "..getCreatureName(target).." Foi Destruido! Time "..(getCreatureName(target) == "Blue Nexus" and "Vermelho" or "Azul").." foi o Vencedor desta Rodada do Evento Dota!", MESSAGE_EVENT_ADVANCE) getDotaWinners(var.winners) OpenorClosedPortoes() RemoveAllTowers() removeDotaConditions() ZerarStorDota() end end end return true end function onLogin(cid) registerCreatureEvent(cid, "DotaAttack") registerCreatureEvent(cid, "KillGerador") registerCreatureEvent(cid, "DeathDota") registerCreatureEvent(cid, "TowerStats") if getPlayerStorageValue(cid, dota_config.storages[1]) > 0 or getPlayerStorageValue(cid, dota_config.storages[4]) > 0 or getPlayerStorageValue(cid, dota_config.storages[4]) > 0 then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end setPlayerStorageValue(cid, dota_config.storages[3], 0) setPlayerStorageValue(cid, dota_config.storages[4], 0) setPlayerStorageValue(cid, dota_config.storages[1], 0) setPlayerStorageValue(cid, dota_config.storages[6], 0) return true end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and isMonster(cid) then local tower = DotaTowers_Lib[getCreatureName(cid)] if type == STATSCHANGE_HEALTHLOSS and tower then local TowerPercent = 100/(getCreatureMaxHealth(cid)/getCreatureHealth(cid)) if TowerPercent <= 75 and TowerPercent >= 74 then sendMsgPlayersDota(getCreatureName(cid) .. " está com 75% de Vida, Corra para proteger!!", MESSAGE_STATUS_CONSOLE_RED) elseif TowerPercent <= 50 and TowerPercent >= 49 then sendMsgPlayersDota(getCreatureName(cid) .. " está com 50% de Vida!! Corra para proteger!!", MESSAGE_STATUS_CONSOLE_RED) elseif TowerPercent <= 25 and TowerPercent >= 24 then sendMsgPlayersDota(getCreatureName(cid) .. " está com 25% de Vida!! Corra para proteger!!", MESSAGE_STATUS_CONSOLE_RED) end end end return true end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) and getPlayerStorageValue(cid, dota_config.storages[3]) > 0 and getPlayerStorageValue(target, dota_config.storages[3]) > 0 or getPlayerStorageValue(cid, dota_config.storages[4]) > 0 and getPlayerStorageValue(target, dota_config.storages[4]) > 0 or getPlayerStorageValue(cid, dota_config.storages[6]) > 0 or getPlayerStorageValue(target, dota_config.storages[6]) > 0 then doPlayerSendCancel(cid, "You may not attack this player.") return false elseif isPlayer(cid) and isMonster(target) and getPlayerStorageValue(cid, dota_config.storages[3]) > 0 and isInArray({"Mid Tower Blue","Bot Tower Blue","Top Tower Blue","Blue Nexus"}, getCreatureName(target)) or getPlayerStorageValue(cid, dota_config.storages[4]) > 0 and isInArray({"Top Tower Red","Bot Tower Red","Mid Tower Red","Red Nexus"}, getCreatureName(target)) then doPlayerSendCancel(cid, "You may not attack this.") return false end return true end function onDeath(cid, corpse, deathList) if isPlayer(cid) or not Monsters_Dota[getCreatureName(cid)] then return true end local killer, jungle = deathList[1], Monsters_Dota[getCreatureName(cid)] if isPlayer(killer) and jungle then local conditions = getCreatureName(cid) == "Spider Of Jungle" and {condition_ps,dota_speed} or {condition_kd, dota_speed} local storage = getPlayerStorageValue(killer, dota_config.storages[3]) > 0 and dota_config.storages[3] or dota_config.storages[4] for _, pid in ipairs(deathList) do if isPlayer(pid) then doRemoveConditions(pid, CONDITION_PARALYZE) end end doBuffPlayer(conditions, storage, jungle.vocs) addEvent(doSpawnJungleMobs, jungle.respaw*1000*60, getCreatureName(cid), jungle.pos) end return true end
  7. to usando o dota system do vodkart, devo ter feito alguma configuração errada ou sei lá, eu chequei e nao encontrei o erro basicamente, quando maat uma unica torre do outro tibe ja libera o nexus, sendo que deveria ter q matar as 3 torres antes de liberar o nexus, ao matar qualquer torre tambem sao enviados 2 broadcasts em vez de 1, realmente contando como se tivesse matado as 3 torres. Uso tfs 0.4 data/lib/dota_system dota_config = { storages = {172200, 172201, 963220, 963221, 963222, 963223, 963224}, -- count, talk, team blue, team red, tower blue, tower red, move players = {min = 8, max = 30}, -- min e max TeamBlue = {name = "Blue Assassins", town = 10}, TeamRed = {name = "Red Barbarians", town = 11}, rewards = {{70,9971,10}}, timeToStartEvent = 10, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento teleport = {x=167, y=51, z=7}, -- position do tp onde aparece 167 51 7 minLevel = 15000, room = {x=1509, y=1870, z=7}, -- 1509 1870 7 sala de espera block_mc = true, DeathDelay = 7 } dota_days = { ["Monday"] = {"15:40"}, ["Tuesday"] = {"15:40"}, ["Wednesday"] = {"15:40"}, ["Thursday"] = {"15:40"}, ["Friday"] = {"15:40"}, ["Saturday"] = {"15:40"}, ["Sunday"] = {"15:40"} } DotaTowers_Lib = { ["Mid Tower Blue"] = { pos = {x=1530, y=1846, z=7}-- position towers blue 1530 1846 7 }, ["Bot Tower Blue"] = { pos = {x=1542, y=1847, z=7}-- position towers blue 1542 1847 7 }, ["Top Tower Blue"] = { pos = {x=1518, y=1847, z=7}-- position towers blue 1518 1847 7 }, ["Blue Nexus"] = { pos = {x=1542, y=1841, z=7}, -- position nexus blue 1542 1841 7 winners = dota_config.storages[4] }, ["Top Tower Red"] = { pos = {x=1494, y=1847, z=7}-- position towers 1494 1847 7 }, ["Bot Tower Red"] = { pos = {x=1470, y=1847, z=7}-- position towers 1470 1847 7 }, ["Mid Tower Red"] = { pos = {x=1482, y=1846, z=7}-- position towers 1482 1846 7 }, ["Red Nexus"] = { pos = {x=1470, y=1841, z=7}, -- position nexus 1470 1840 7 winners = dota_config.storages[3] } } dota_portoes = { {1355,{x = 1464, y = 1845, z = 7, stackpos = 1}}, -- 1464 1845 7 {1355,{x = 1464, y = 1846, z = 7, stackpos = 1}}, {1355,{x = 1464, y = 1847, z = 7, stackpos = 1}}, {1355,{x = 1464, y = 1848, z = 7, stackpos = 1}}, {1355,{x = 1464, y = 1849, z = 7, stackpos = 1}}, -- fim primeiros portoes {1354,{x = 1548, y = 1845, z = 7, stackpos = 1}}, -- começo azul 1548 1845 7 {1354,{x = 1548, y = 1846, z = 7, stackpos = 1}}, {1354,{x = 1548, y = 1847, z = 7, stackpos = 1}}, {1354,{x = 1548, y = 1848, z = 7, stackpos = 1}}, {1354,{x = 1548, y = 1849, z = 7, stackpos = 1}} -- fim primeiro azul } Monsters_Dota = { ["Spider Of Jungle"] = {vocs = {2,3,6,7}, respaw = 6, pos = {x=1505, y=1857, z=7}}, -- 1505 1857 7 ["Serpent Of Jungle"] = {vocs = {1,4,5,8}, respaw = 6, pos = {x=1504, y=1835, z=7}} -- 1504 1835 7 } ---------------------> END CONFIG <-------------------------- conditionDotaBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionDotaBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionDotaBlue, {lookType = 128, lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88}) conditionDotaRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionDotaRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionDotaRed, {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) condition_kd = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition_kd, CONDITION_PARAM_TICKS, 5*60*1000) setConditionParam(condition_kd, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 115) setConditionParam(condition_kd, CONDITION_PARAM_STAT_MAXMANAPERCENT, 110) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_MELEE, 10) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_FIST, 10) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_CLUB, 10) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_SWORD, 10) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_AXE, 10) setConditionParam(condition_kd, CONDITION_PARAM_SKILL_SHIELD, 10) setConditionParam(condition_kd, CONDITION_PARAM_STAT_MAGICLEVEL, 10) setConditionParam(condition_kd, CONDITION_PARAM_BUFF, true) dota_speed = createConditionObject(CONDITION_HASTE) setConditionParam(dota_speed, CONDITION_PARAM_BUFF, true) setConditionParam(dota_speed, CONDITION_PARAM_TICKS, 5*60*1000) setConditionParam(dota_speed, CONDITION_PARAM_SPEED, 40) condition_ps = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition_ps, CONDITION_PARAM_TICKS, 5*60*1000) setConditionParam(condition_ps, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 110) setConditionParam(condition_ps, CONDITION_PARAM_STAT_MAXMANAPERCENT, 115) setConditionParam(condition_ps, CONDITION_PARAM_SKILL_DISTANCE, 10) setConditionParam(condition_ps, CONDITION_PARAM_STAT_MAGICLEVEL, 10) setConditionParam(condition_ps, CONDITION_PARAM_SKILL_SHIELD, 10) setConditionParam(condition_ps, CONDITION_PARAM_BUFF, true) function prepareDota() RemoveAllTowers() if getTileItemById(dota_portoes[1][2], dota_portoes[1][1]).uid == 0 then OpenorClosedPortoes() end end function startDota() OpenorClosedPortoes() createTower() sendMsgPlayersDota("The Dota Event Has Started!! Destroy the enemy towers and defend yours!", MESSAGE_STATUS_CONSOLE_RED) end function ZerarStorDota() for _, storages in pairs(dota_config.storages) do setGlobalStorageValue(storages, 0) end end function getPlayerInDota() local t = {} for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, dota_config.storages[1]) > 0 then t[#t+1] = cid end end return t end function sendMsgPlayersDota(msg, type) for _, pid in pairs(getPlayerInDota()) do doPlayerSendTextMessage(pid, type, msg) end end function getMcEvent(cid) local t = {} for _, pid in pairs(getPlayerInDota()) do if getPlayerIp(cid) == getPlayerIp(pid) then t[#t+1] = pid end end return t end function OpenorClosedPortoes() for i = 1, #dota_portoes do if getTileItemById(dota_portoes[i][2], dota_portoes[i][1]).uid == 0 then doCreateItem(dota_portoes[i][1], 1, dota_portoes[i][2]) else doRemoveItem(getThingfromPos(dota_portoes[i][2]).uid,1) doSendMagicEffect(dota_portoes[i][2], CONST_ME_POFF) end end end function RemoveAllTowers() for n, _ in pairs(DotaTowers_Lib) do -- towers and nexus local creature = getCreatureByName(n) if creature ~= nil and not isPlayer(creature) then doRemoveCreature(getTopCreature(getCreaturePosition(creature)).uid) end end for m, _ in pairs(Monsters_Dota) do -- jungle mobs local jungle = getCreatureByName(m) if jungle ~= nil and not isPlayer(jungle) then doRemoveCreature(getTopCreature(getCreaturePosition(jungle)).uid) end end end function createTower() for n, t in pairs(DotaTowers_Lib) do if not isInArray({"Blue Nexus","Red Nexus"}, n) then doSummonCreature(n, t.pos) end end for v, k in pairs(Monsters_Dota) do doSummonCreature(v, k.pos) end end function createNexus(name) return doSummonCreature(name, DotaTowers_Lib[name].pos) end function getDotaRewards(cid, items) local backpack = doPlayerAddItem(cid, 11115, 1) -- backpackID {1,8981,1},{1,8299,1},{1,8310,1},{1,10138,1} for _, i_i in ipairs(items) do local chance, item, amount = i_i[1],i_i[2],i_i[3] if chance >= math.random(1, 100) then if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) doPlayerAddItem(cid, 8981, 1) -- 10558 doPlayerAddItem(cid, 8299, 1) doPlayerAddItem(cid, 8310, 1) doPlayerAddItem(cid, 10558, 80) doPlayerAddItem(cid, 10138, 1) else for i = 1, amount do doAddContainerItem(backpack, item, 1) doPlayerAddItem(cid, 8981, 1) doPlayerAddItem(cid, 8299, 1) doPlayerAddItem(cid, 8310, 1) doPlayerAddItem(cid, 10138, 1) end end end end end function noMoveAfterDeath(cid, delay) if not isCreature(cid) or getPlayerStorageValue(cid, dota_config.storages[1]) <= 0 then return LUA_ERROR end if delay > 0 then doPlayerSendTextMessage(cid, 26, delay) addEvent(noMoveAfterDeath, 1000, cid, delay-1) elseif delay == 0 then doPlayerSendTextMessage(cid,26, "GO GO GO") doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, dota_config.storages[6], 0) end end function getDotaWinners(storage) for _, cid in pairs(getPlayerInDota()) do if getPlayerStorageValue(cid, storage) > 0 then getDotaRewards(cid, dota_config.rewards) end end end function doBuffPlayer(buffs, team, vocations) for _, cid in pairs(getPlayerInDota()) do if getPlayerStorageValue(cid, team) > 0 and isInArray(vocations, getPlayerVocation(cid)) then for i = 1, #buffs do doAddCondition(cid, buffs[i]) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Dota Event] You just received a 5 minuts buff by killing jungle monsters!") doSendMagicEffect(getPlayerPosition(cid), 28) end end end function randomTeam() for _, cid in pairs(getPlayerInDota()) do local getMyTeam = getGlobalStorageValue(dota_config.storages[3]) < getGlobalStorageValue(dota_config.storages[4]) and {dota_config.storages[3],dota_config.TeamBlue.town,dota_config.TeamBlue.name,conditionDotaBlue} or {dota_config.storages[4],dota_config.TeamRed.town,dota_config.TeamRed.name,conditionDotaRed} doAddCondition(cid, getMyTeam[4]) setPlayerStorageValue(cid, getMyTeam[1], 1) setGlobalStorageValue(getMyTeam[1], getGlobalStorageValue(getMyTeam[1])+1) doPlayerSetTown(cid, getMyTeam[2]) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the team " .. getMyTeam[3] .. "!") end end function dotaBroadSpecialKills(cid, target) local storages,type = {878756,878757},{"","Double Kill","Triple Kill","Quadra Kill","Penta Kill"} if getPlayerStorageValue(cid, storages[1]) - os.time() <= 0 then setPlayerStorageValue(cid, storages[1], os.time()+120) setPlayerStorageValue(cid, storages[2], 1) else setPlayerStorageValue(cid, storages[2], getPlayerStorageValue(cid, storages[2])+1) if getPlayerStorageValue(cid, storages[2]) < 6 then sendMsgPlayersDota(getPlayerName(cid) .. " fez " .. type[getPlayerStorageValue(cid, storages[2])] .. " em ".. getPlayerName(target) .. "!", MESSAGE_STATUS_CONSOLE_RED) elseif getPlayerStorageValue(cid, storages[2]) > 5 then sendMsgPlayersDota(getPlayerName(cid) .. " is Legendary!!", MESSAGE_STATUS_CONSOLE_RED) end end end function removeDotaConditions() for _, cid in pairs(getPlayerInDota()) do doRemoveConditions(cid, false) doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, dota_config.storages[3], 0) setPlayerStorageValue(cid, dota_config.storages[4], 0) setPlayerStorageValue(cid, dota_config.storages[1], 0) setPlayerStorageValue(cid, dota_config.storages[6], 0) end end function removeDotaTp() local t = getTileItemById(dota_config.teleport, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(dota_config.teleport, CONST_ME_POFF) end function CheckDotaEvent(delay) if getGlobalStorageValue(dota_config.storages[1]) ~= (dota_config.players.max+1) then if delay > 0 and getGlobalStorageValue(dota_config.storages[1]) < dota_config.players.max then doBroadcastMessage("[Dota Event] Starting in " .. delay .. " minutes! The teleport will be closed once the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(dota_config.storages[1]) < dota_config.players.min then removeDotaConditions() removeDotaTp() doBroadcastMessage("The Dota Event could not start because not enough players were participating.\n At least " .. dota_config.players.min .. " players are needed!", MESSAGE_STATUS_WARNING) ZerarStorDota() elseif delay == 0 and getGlobalStorageValue(dota_config.storages[1]) >= dota_config.players.min then removeDotaTp() randomTeam() doBroadcastMessage("Good Lucky! The event will start in "..dota_config.timeToStartEvent.." seconds. get ready!") addEvent(startDota, dota_config.timeToStartEvent*1000) end addEvent(CheckDotaEvent, 60000, delay-1) end end function doSpawnJungleMobs(name, pos) if getGlobalStorageValue(dota_config.storages[1]) > 0 then doSummonCreature(name, pos) sendMsgPlayersDota("[Dota] ".. name .. " Has Spawned", MESSAGE_STATUS_CONSOLE_RED) end end
  8. não troca mesmo tendo o item no nivel certinho, acho que o comando ta procurando por uma "star wand 16" e nao uma "star wand +16"
  9. Olá, estou usando tfs 0.4 e eu estou precisando checar o nome do item na hora de fazer uma troca (via talkactions), o negocio é que eu uso um refine system e o nivel do item é definido pelo nome, entao um item +1 é nomedoitem +1, tipo Giant Sword +1. Preciso checar se o nome do item é, por exemplo, Giant Sword +16 na hora de fazer a troca local item = 12609 local nome1 = getItemName(itemid.uid) local nome2 = "Star wand" if param == "wand" then if nome1 == nome2 then doPlayerSendTextMessage(cid, 22, "Você fez uma troca de items!") --doPlayerRemoveItem(cid, 12609) doPlayerRemoveItem(cid, table["wand"].id, 1) doPlayerAddItem(cid, table["wand"].toid, 1) else doPlayerSendCancel(cid, "Você não tem o item necessário!") end return true end to tentando usar ai a funcao getItemName(uid) e tentei de tudo que é jeito já, o script de rima ta retornando isso no console: [9:42:12.421] [Error - TalkAction Interface] [9:42:12.423] data/talkactions/scripts/trocaritems.lua:onSay [9:42:12.426] Description: [9:42:12.427] data/talkactions/scripts/trocaritems.lua:9: attempt to index global 'itemid' (a nil value) [9:42:12.428] stack traceback: [9:42:12.428] data/talkactions/scripts/trocaritems.lua:9: in function <data/talkactions/scripts/trocaritems.lua:1> script completo (só editei a parte da wand) function onSay(cid, words, param) local money = 500 local table = { ["wand"] = {id = 12609, toid = 7754}, ["sword"] = {id = 2408, toid = 7391}, } local item = 12609 local nome1 = getItemName(itemid.uid) local nome2 = "Star wand" if param == "wand" then if nome1 == nome2 then doPlayerSendTextMessage(cid, 22, "Você fez uma troca de items!") --doPlayerRemoveItem(cid, 12609) doPlayerRemoveItem(cid, table["wand"].id, 1) doPlayerAddItem(cid, table["wand"].toid, 1) else doPlayerSendCancel(cid, "Você não tem o item necessário!") end return true end if param == "sword" then if getPlayerItemCount(cid, table["sword"].id) >= 1 then if getPlayerMoney(cid) >= 500 then doPlayerSendTextMessage(cid, 22, "Você fez uma troca de items!") doPlayerRemoveMoney(cid, 500) doPlayerRemoveItem(cid, table["sword"].id, 1) doPlayerAddItem(cid, table["sword"].toid, 1) else doPlayerSendCancel(cid, " Você não tem dinheiro suficiente!") end else doPlayerSendCancel(cid, " Você não tem o item necessário!") end end return true end edit: consegui fazer funcionar com o codigo local slotitem = getPlayerSlotItem(cid, CONST_SLOT_LEFT) -- edite o slot local nomeitem = getItemNameById(slotitem.itemid) -- tipo isso local slotitem2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT) -- edite o slot local nomeitem2 = getItemNameById(slotitem.itemid) -- tipo isso local nome2 = "Star wand +16" if param == "wand" then if nomeitem == nome2 or slotitem2 == nome2 then doPlayerSendTextMessage(cid, 22, "Você fez uma troca de items!") --doPlayerRemoveItem(cid, 12609) doPlayerRemoveItem(cid, table["wand"].id, 1) doPlayerAddItem(cid, table["wand"].toid, 1) else doPlayerSendCancel(cid, "Você não tem o item necessário!") end return true end mas ainda nao troca o item mesmo tendo a wad +16 edit: to pegando o nome padrao e nao o nome atual do item dai ta sempre retornando star wand em vez do star wand +16,, alguma ideia?
  10. Olá, utilizo tfs 0.4 e ultimamente estou tendo o seguinte erro impresso no console diversas vezes até o server crashara Creature::updateTileCache out of range tem um erro de updatemap tambem mas to sem ele no ctrl+v creature.cpp tem as as funcoes que chamam esses erros, aqui o codigo da parte do updateTileCache out of range void Creature::updateTileCache(const Tile* tile) { if(isMapLoaded && tile->getPosition().z == getPosition().z) updateTileCache(tile, tile->getPosition()); } void Creature::updateTileCache(const Tile* tile, int32_t dx, int32_t dy) { if((std::abs(dx) <= (mapWalkWidth - 1) / 2) && (std::abs(dy) <= (mapWalkHeight - 1) / 2)) { int32_t x = (mapWalkWidth - 1) / 2 + dx, y = (mapWalkHeight - 1) / 2 + dy; localMapCache[y][x] = (tile && tile->__queryAdd(0, this, 1, FLAG_PATHFINDING | FLAG_IGNOREFIELDDAMAGE) == RET_NOERROR); } #ifdef [B]DEBUG[/B] else std::clog << "Creature::updateTileCache out of range." << std::endl; #endif } }

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia partindo do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer publicidade para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução! A publicação do seu anuncio é instantânea!

×
×
  • Create New...