Ir para conteúdo

juhkinha

Membro
  • Registro em

  • Última visita

  1. juhkinha postou uma resposta no tópico em Suporte Tibia OTServer
    ninguem pode ajudar?
  2. juhkinha postou uma resposta no tópico em Suporte Tibia OTServer
    Lua Script Error: [GlobalEvent Interface] data/globalevents/scripts/others/shop.lua:onThink data/globalevents/scripts/others/shop.lua:8: attempt to call field 'getResult' (a nil value) stack traceback: [C]: in function 'getResult' data/globalevents/scripts/others/shop.lua:8: in function [Error - GlobalEvents::think] Failed to execute event: Shop
  3. se conseguir explicar como fazer isso, muitas pessoas vão gostar...
  4. juhkinha postou uma resposta no tópico em Suporte Tibia OTServer
    Não aparece no store inbox, o personagem não recebe nada nem mensagem
  5. No global um exemplo o grim reaper não passa por fire a menos se for atacado, no meu servidor ele passa por todos os field mesmo sem atacar. Como deixar igual global? <?xml version="1.0" encoding="UTF-8"?> <monster name="Grim Reaper" nameDescription="a grim reaper" race="undead" experience="5500" speed="320" manacost="0"> <health now="3900" max="3900" /> <look type="300" corpse="8955" /> <targetchange interval="3000" chance="20" /> <strategy attack="100" defense="0" /> <flags> <flag summonable="0" /> <flag attackable="1" /> <flag hostile="1" /> <flag illusionable="0" /> <flag convinceable="0" /> <flag pushable="0" /> <flag isblockable="0" /> <flag canpushitems="1" /> <flag canpushcreatures="0" /> <flag targetdistance="1" /> <flag staticattack="90" /> <flag runonhealth="0" /> </flags> <attacks> <attack name="melee" interval="2000" skill="70" attack="80" /> <attack name="melee" interval="2000" chance="2" skill="153" attack="100" /> <attack name="physical" interval="2000" chance="14" range="7" target="1" min="0" max="-165"> <attribute key="shootEffect" value="death" /> <attribute key="areaEffect" value="mortarea" /> </attack> <attack name="death" interval="2000" chance="12" length="8" spread="0" min="-350" max="-720"> <attribute key="areaEffect" value="redspark" /> </attack> <attack name="death" interval="2000" chance="13" radius="4" target="0" min="-225" max="-275"> <attribute key="areaEffect" value="redspark" /> </attack> <attack name="physical" interval="2000" chance="9" length="8" spread="3" min="-0" max="-300"> <attribute key="areaEffect" value="explosionarea" /> </attack> </attacks> <defenses armor="30" defense="30"> <defense name="healing" interval="2000" chance="16" min="130" max="205"> <attribute key="areaEffect" value="redshimmer" /> </defense> <defense name="effect" interval="2000" chance="9"> <attribute key="areaEffect" value="greenshimmer" /> </defense> <defense name="effect" interval="2000" chance="10"> <attribute key="areaEffect" value="redspark" /> </defense> <defense name="speed" interval="2000" chance="12" speedchange="532" duration="4000"> <attribute key="areaEffect" value="redshimmer" /> </defense> </defenses> <elements> <element energyPercent="-10" /> <element earthPercent="40" /> <element physicalPercent="20" /> <element icePercent="65" /> <element holyPercent="-10" /> <element deathPercent="80" /> <element firePercent="-10" /> </elements> <immunities> <immunity fire="0"/> <immunity lifedrain="1" /> <immunity paralyze="1" /> <immunity invisible="1" /> </immunities> <voices interval="2000" chance="5"> <voice sentence="Death!" yell="1"/> <voice sentence="Come a little closer!" yell="1"/> <voice sentence="The end is near!" yell="1"/> </voices> <loot> <item id="6558" chance="35760" /><!-- concentrated demonic blood --> <item id="6500" chance="10720" /><!-- demonic essence --> <item id="10577" chance="5170" /><!-- mystical hourglass --> <item id="2148" countmax="271" chance="99020" /><!-- gold coin --> <item id="2152" countmax="4" chance="5230" /><!-- platinum coin --> <item id="8473" chance="9550" /><!-- ultimate health potion --> <item id="7590" chance="10070" /><!-- great mana potion --> <item id="2162" chance="4840" /><!-- magic lightwand --> <item id="2521" chance="2940" /><!-- dark shield --> <item id="7418" chance="920" /><!-- nightmare blade --> <item id="2550" chance="9050" /><!-- scythe --> <item id="8910" chance="860" /><!-- underworld rod --> <item id="7896" chance="350" /><!-- glacier kilt --> <item id="9810" chance="2610" /><!-- rusty armor --> <item id="5022" countmax="4" chance="1400" /><!-- orichalcum pearl --> <item id="8889" chance="280" /><!-- skullcracker armor --> <item id="6300" chance="350" /><!-- death ring --> </loot> </monster>
  6. juhkinha postou uma resposta no tópico em Suporte Tibia OTServer
    quando compro outfit ou motaria shopsystem recebo normalmente no ingame mas quando compro algum item store não recebo nada shop.lua -- ### CONFIG ### -- message to player "type", if delivery of item debugs client, it can be because of undefinied type (type that does not exist in your server LUA) SHOP_MSG_TYPE = MESSAGE_EVENT_ADVANCE -- ### END OF CONFIG ### function onThink(interval) local resultId = db.storeQuery("SELECT * FROM z_ots_comunication") if resultId ~= false then repeat local transactionId = tonumber(result.getDataInt(resultId, "id")) local player = Player(result.getDataString(resultId, "name")) if player then local itemId = result.getDataInt(resultId, "param1") local itemCount = result.getDataInt(resultId, "param2") local containerId = result.getDataInt(resultId, "param3") local containerItemsInsideCount = result.getDataInt(resultId, "param4") local shopOfferType = result.getDataString(resultId, "param5") local shopOfferName = result.getDataString(resultId, "param6") -- DELIVER ITEM if shopOfferType == 'item' then local newItemUID = doCreateItemEx(itemId, itemCount) -- item does not exist, wrong id OR count if not newItemUID then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot create item - invalid item ID OR count - ITEM ID: ' .. itemId .. ', ITEM COUNT: ' .. itemCount) return true end -- change item UniqueID to object of class Item local newItem = Item(newItemUID) doItemSetAttribute(newItem, "description", 'Bought by ' .. player:getName() .. '.') -- get player store inbox as container, so we can add item to it local playerStoreInbox = player:getSlotItem(CONST_SLOT_STORE_INBOX) -- cannot open Store Inbox, report problem if not playerStoreInbox then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot open player "Store Inbox" - it is not supported in your server OR variable "CONST_SLOT_STORE_INBOX" is not definied in LUA') return true end -- add container with items to Store Inbox doItemSetAttribute(newItem, "description", 'Bought by ' .. player:getName() .. '.') receivedItemStatus = playerStoreInbox:addItemEx(newItem) if type(receivedItemStatus) == "number" and receivedItemStatus == RETURNVALUE_NOERROR then player:sendTextMessage(SHOP_MSG_TYPE, 'You received ' .. shopOfferName .. ' from Website Shop. You can find your item in STORE INBOX (under EQ).') db.asyncQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. transactionId) db.asyncQuery("UPDATE `z_shop_history_item` SET `trans_state`= 'realized', `trans_real`=" .. os.time() .. " WHERE `id` = " .. transactionId) else player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot add item to STORE INBOX - unknown reason, is it\'s size limited and it is full? - ITEM ID: ' .. itemId .. ', ITEM COUNT: ' .. itemCount) end -- DELIVER CONTAINER elseif shopOfferType == 'container' then -- create empty container local newContainerUID = doCreateItemEx(containerId, 1) -- container item does not exist OR item is not Container if not newContainerUID or not Container(newContainerUID) then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot create container - invalid container ID - CONTAINER ID:' .. containerId) return true end -- change container UniqueID to object of class Container local newContainer = Container(newContainerUID) -- add items to container for i = 1, containerItemsInsideCount do -- create new item local newItemUID = doCreateItemEx(itemId, itemCount) -- item does not exist, wrong id OR count if not newItemUID then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot create item - invalid item ID OR count - ITEM ID: ' .. itemId .. ', ITEM COUNT: ' .. itemCount) return true end -- change item UniqueID to object of class Item local newItem = Item(newItemUID) -- add item to container local addItemToContainerResult = newContainer:addItemEx(newItem) -- report error if it's not possible to add item to container if type(addItemToContainerResult) ~= "number" or addItemToContainerResult ~= RETURNVALUE_NOERROR then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot add item to container - item is not pickable OR variable "RETURNVALUE_NOERROR" is not definied in LUA - ITEM ID: ' .. itemId .. ', ITEM COUNT: ' .. itemCount) return true end end -- get player store inbox as container, so we can add item to it local playerStoreInbox = player:getSlotItem(CONST_SLOT_STORE_INBOX) -- cannot open Store Inbox, report problem if not playerStoreInbox then player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot open player "Store Inbox" - it is not supported in your server OR variable "CONST_SLOT_STORE_INBOX" is not definied in LUA') return true end -- add container with items to Store Inbox doItemSetAttribute(newContainer, "description", 'Bought by ' .. player:getName() .. '.') receivedItemStatus = playerStoreInbox:addItemEx(newContainer) if type(receivedItemStatus) == "number" and receivedItemStatus == RETURNVALUE_NOERROR then player:sendTextMessage(SHOP_MSG_TYPE, 'You received ' .. shopOfferName .. ' from Website Shop. You can find your item in STORE INBOX (under EQ).') db.asyncQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. transactionId) db.asyncQuery("UPDATE `z_shop_history_item` SET `trans_state`= 'realized', `trans_real`=" .. os.time() .. " WHERE `id` = " .. transactionId) else player:sendTextMessage(SHOP_MSG_TYPE, 'Website Shop bugged. Contact with administrator! Error is visible in server console.') print('ERROR! Website Shop (' .. player:getName() .. ') - cannot add container with items to STORE INBOX - unknown reason, is it\'s size limited and it is full? - ITEM ID: ' .. itemId .. ', ITEM COUNT: ' .. itemCount .. ', CONTAINER ID:' .. containerId .. ', ITEMS IN CONTAINER COUNT:' .. containerItemsInsideCount) end -- DELIVER YOUR CUSTOM THINGS elseif shopOfferType == 'mount' then -- addon, mount etc. player:addMount(itemId) player:setStorageValue(itemId,1) player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE) player:sendTextMessage(SHOP_MSG_TYPE, 'You received ' .. shopOfferName .. ' from Website Shop.') db.asyncQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. transactionId) db.asyncQuery("UPDATE `z_shop_history_item` SET `trans_state`= 'realized', `trans_real`=" .. os.time() .. " WHERE `id` = " .. transactionId) elseif shopOfferType == 'addon' then player:addOutfit(itemId) player:addOutfitAddon(itemId, 3) player:setStorageValue(itemId,1) player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE) player:sendTextMessage(SHOP_MSG_TYPE, 'You received ' .. shopOfferName .. ' from Website Shop.') db.asyncQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. transactionId) db.asyncQuery("UPDATE `z_shop_history_item` SET `trans_state`= 'realized', `trans_real`=" .. os.time() .. " WHERE `id` = " .. transactionId) end end until not result.next(resultId) result.free(resultId) end return true end

Informação Importante

Confirmação de Termo