Ir para conteúdo
  • Cadastre-se

(Resolvido)Reset Look Database


Ir para solução Resolvido por Mateus Robeerto,

Posts Recomendados

Galera não consigo por Reset no Look

meu sistema de reset é por database

Spoiler

ALTER TABLE players ADD resets tinyint(11) NOT NULL;

 

meu events/player.lua

 

Spoiler

-- Players cannot throw items on teleports if set to true
local blockTeleportTrashing = true

local titles = {
    {storageID = 14960, title = " Scout"},
    {storageID = 14961, title = " Sentinel"},
    {storageID = 14962, title = " Steward"},
    {storageID = 14963, title = " Warden"},
    {storageID = 14964, title = " Squire"},
    {storageID = 14965, title = " Warrior"},
    {storageID = 14966, title = " Keeper"},
    {storageID = 14967, title = " Guardian"},
    {storageID = 14968, title = " Sage"},
    {storageID = 14969, title = " Tutor"},
    {storageID = 14970, title = " Senior Tutor"},
    {storageID = 14971, title = " King"},
}
 
local function getTitle(uid)
    local player = Player(uid)
    if not player then return false end
 
    for i = #titles, 1, -1 do
        if player:getStorageValue(titles[i].storageID) == 1 then
            return titles[i].title
        end
    end
    return false
end

function Player:onBrowseField(position)
    return true
end

local function getHours(seconds)
    return math.floor((seconds/60)/60)
end

local function getMinutes(seconds)
    return math.floor(seconds/60)
end

local function getTime(seconds)
    local hours, minutes = getHours(seconds), getMinutes(seconds)
    if (minutes > 59) then
        minutes = minutes-hours*60
    end

    if (minutes < 10) then
        minutes = "0" ..minutes
    end

    return hours..":"..minutes.. "h"
end

function Player:onLook(thing, position, distance)
    local description = 'You see '

    if thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if (itemType and itemType:getImbuingSlots() > 0) then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if (thing:getSpecialAttribute(i+3)) then
                    time = getTime(thing:getSpecialAttribute(i+3))
                end
                
                if (specialAttr) then
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", "
                    else
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")."
                    end
                else
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "Empty Slot, "
                    else
                        imbuingSlots = imbuingSlots.. "Empty Slot)."
                    end
                end
            end
            description = string.gsub(description, "It weighs", imbuingSlots.. "\nIt weighs")
        end
    else
        description = description .. thing:getDescription(distance)
    end

        --[[-- KD look 
     if thing:isCreature() and thing:isPlayer() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, thing:getStorageValue(167912)), math.max(0, thing:getStorageValue(167913)))
    end
        end--]]
    
    --[[-- MARRY 
    if LOOK_MARRIAGE_DESCR and thing:isCreature() then
        if thing:isPlayer() then
            description = description .. self:getMarriageDescription(thing)
        end
    end--]]

    if self:getGroup():getAccess() then
        if thing:isItem() then
            description = string.format('%s\nItem ID: %d', description, thing.itemid)

            local actionId = thing.actionid
            if actionId ~= 0 then
                description = string.format('%s, Action ID: %d', description, actionId)
            end

            local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID)
            if uniqueId > 0 and uniqueId < 65536 then
                description = string.format('%s, Unique ID: %d', description, uniqueId)
            end

            description = description .. '.'
            local itemType = thing:getType()

            local transformEquipId = itemType:getTransformEquipId()
            local transformDeEquipId = itemType:getTransformDeEquipId()
            if transformEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onEquip)', description, transformEquipId)
            elseif transformDeEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onDeEquip)', description, transformDeEquipId)
            end

            local decayId = itemType:getDecayId()
            if decayId ~= -1 then
                description = string.format('%s\nDecays to: %d', description, decayId)
            end
        elseif thing:isCreature() then
            local title = getTitle(thing.uid)
if title then description  = description  .. title .. " of Relembra." end
            local str = '%s\nHealth: %d / %d'
            if thing:getMaxMana() > 0 then
                str = string.format('%s, Mana: %d / %d', str, thing:getMana(), thing:getMaxMana())
            end
            description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. '.'
        end

        local position = thing:getPosition()
        description = string.format(
            '%s\nPosition: %d, %d, %d',
            description, position.x, position.y, position.z
        )

        if thing:isCreature() and thing:isPlayer() then
            description = string.format('%s\nIP: %s.', description, Game.convertIpToString(thing:getIp()))
        end
    end
    self:sendTextMessage(MESSAGE_INFO_DESCR, description)
    
end

function Player:onLookInBattleList(creature, distance)

    local description = 'You see ' .. creature:getDescription(distance)
    if self:getGroup():getAccess() then
        local str = '%s\nHealth: %d / %d'
        if creature:getMaxMana() > 0 then
            str = string.format('%s, Mana: %d / %d', str, creature:getMana(), creature:getMaxMana())
        end
        description = string.format(str, description, creature:getHealth(), creature:getMaxHealth()) .. '.'

        
    
        local position = creature:getPosition()
        description = string.format(
            '%s\nPosition: %d, %d, %d',
            description, position.x, position.y, position.z
        )

        if creature:isPlayer() then
            description = string.format('%s\nIP: %s.', description, Game.convertIpToString(creature:getIp()))
        end
    end
    
    
    --[[KD look 
     if creature:isPlayer() and creature:isCreature() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, creature:getStorageValue(167912)), math.max(0, creature:getStorageValue(167913)))
    end--]]
    
    --[[-- MARRY  
    if LOOK_MARRIAGE_DESCR and creature:isCreature() then
        if creature:isPlayer() then
            description = description .. self:getMarriageDescription(creature)
        end
    end--]]

    self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end

function Player:onLookInTrade(partner, item, distance)
    self:sendTextMessage(MESSAGE_INFO_DESCR, 'You see ' .. item:getDescription(distance))
end

function Player:onLookInShop(itemType, count)
    return true
end

function Player:onMoveCreature(creature, fromPosition, toPosition)
    return true
end

function Player:onTurn(direction)
    if self:getAccountType() >= ACCOUNT_TYPE_GOD and self:getGroup():getAccess() then
        if self:getDirection() == direction then
            local nextPosition = self:getPosition()
            nextPosition:getNextPosition(direction)

            self:teleportTo(nextPosition, true)
        end
    end
    return true
end

local function getAllItemsByAid(player, aid, item)
    local containers = {}
    local items = {}
   
    local sitem = item
    if sitem then
        if sitem.uid > 0 then
            if isContainer(sitem.uid) then
                table.insert(containers, sitem.uid)
            elseif not (aid) or aid == sitem:getActionId() then
                table.insert(items, sitem)
            end
        end
    end

    while #containers > 0 do
        for k = (Container(containers[1]):getSize() - 1), 0, -1 do
            local tmp = Container(containers[1]):getItem(k)
            if isContainer(tmp.uid) then
                table.insert(containers, tmp.uid)
            elseif not (aid) or aid == tmp:getActionId() then
                table.insert(items, tmp)
            end
        end
        table.remove(containers, 1)
    end

    return items
end

function Player:onTradeRequest(target, item)
    local tmpCont = Container(item:getUniqueId())
    if (tmpCont) then
        if (#getAllItemsByAid(self, 23095, item) > 0) then
            return false
        end
    end

    if (isInArray({1738, 1740, 1747, 1748, 1749, 8766}, item.itemid) and item.actionid > 0 or item.actionid == 5640) or
        item.itemid == 26377 or item:getActionId() == 23095 then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
    end
    return true
end

function Player:onTradeAccept(target, item, targetItem)
    return true
end

local soulCondition = Condition(CONDITION_SOUL, CONDITIONID_DEFAULT)
soulCondition:setTicks(4 * 60 * 1000)
soulCondition:setParameter(CONDITION_PARAM_SOULGAIN, 1)

function useStaminaImbuing(player, item)
    for i = 1, item:getType():getImbuingSlots() do
        if (item:isActiveImbuement(i+3)) then
            local staminaMinutes = item:getSpecialAttribute(i+3)/60
            if (staminaMinutes > 0) then
                local currentTime = os.time()
                local timePassed = currentTime - item:getSpecialAttribute(i+6)
                if timePassed > 0 then
                    if timePassed > 60 then
                        if staminaMinutes > 2 then
                            staminaMinutes = staminaMinutes - 2
                        else
                            staminaMinutes = 0
                        end

                        item:setSpecialAttribute(i+6, currentTime + 120)
                    else
                        staminaMinutes = staminaMinutes - 1
                        item:setSpecialAttribute(i+6, currentTime + 60)
                    end
                end

                item:setSpecialAttribute(i+3, staminaMinutes*60)
            end
        end
    end
end

local function useStamina(player)
    local staminaMinutes = player:getStamina()
    if staminaMinutes == 0 then
        return
    end

    local playerId = player:getId()
    local currentTime = os.time()
    local timePassed = currentTime - nextUseStaminaTime[playerId]
    if timePassed <= 0 then
        return
    end

    if timePassed > 60 then
        if staminaMinutes > 2 then
            staminaMinutes = staminaMinutes - 2
        else
            staminaMinutes = 0
        end
        nextUseStaminaTime[playerId] = currentTime + 120
    else
        staminaMinutes = staminaMinutes - 1
        nextUseStaminaTime[playerId] = currentTime + 60
    end
    player:setStamina(staminaMinutes)
end

local function useStaminaXp(player)
    local staminaMinutes = player:getExpBoostStamina()
    if staminaMinutes == 0 then
        return
    end

    local playerId = player:getId()
    local currentTime = os.time()
    local timePassed = currentTime - nextUseXpStamina[playerId]
    if timePassed <= 0 then
        return
    end

    if timePassed > 60 then
        if staminaMinutes > 2 then
            staminaMinutes = staminaMinutes - 2
        else
            staminaMinutes = 0
        end
        nextUseXpStamina[playerId] = currentTime + 120
    else
        staminaMinutes = staminaMinutes - 1
        nextUseXpStamina[playerId] = currentTime + 60
    end
    player:setExpBoostStamina(staminaMinutes)
end

local function useStaminaPrey(player, name)
    for i = 1, 3 do
        if (player:isActiveByName(i-1, name)) then
            local staminaMinutes = player:getPreyStamina(i-1)/60
            if (staminaMinutes > 0) then
                local playerId = player:getId()+i
                local currentTime = os.time()
                local timePassed = currentTime - nextUseStaminaPrey[playerId].Time

                if timePassed > 0 then
                    if timePassed > 60 then
                        if staminaMinutes > 2 then
                            staminaMinutes = staminaMinutes - 2
                        else
                            staminaMinutes = 0
                        end

                        nextUseStaminaPrey[playerId].Time = currentTime + 120
                    else
                        staminaMinutes = staminaMinutes - 1
                        nextUseStaminaPrey[playerId].Time = currentTime + 60
                    end
                end

                player:setPreyStamina(i-1, staminaMinutes*60)
                player:sendPreyTimeLeft(i-1, staminaMinutes*60)
            end
        end
    end
end

function Player:onGainExperience(source, exp, rawExp)
     if not source or source:isPlayer() then
         return exp
     end
    
    --if self:isPremium() then
    --local exp_extra = 0.8 -- 20% +
        --exp = exp * exp_extra
    --end
    
    -- Soul regeneration
    local vocation = self:getVocation()
    if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
        soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
        self:addCondition(soulCondition)
    end

    -- Apply experience stage multiplier
    exp = exp * Game.getExperienceStage(self:getLevel())

    for i = 1, 3 do
        if (self:isActive(i-1)) then
            local bonusInfo = self:getBonusInfo(i-1)
            if (bonusInfo.Type == 2 and source:getName() == bonusInfo.Name) then
                exp = exp + math.floor(exp * (bonusInfo.Value/100))
                break
            end
        end
    end

    if (self:getExpBoostStamina() <= 0 and self:getExpBoost() > 0) then
        self:setExpBoost(0) -- reset xp boost to 0
    end

    -- Mais compacto, depois da verificação de antes (reset) ele só da xp se tiver :v
    if (self:getExpBoost() > 0) then
        exp = exp + (exp * (self:getExpBoost()/100)) -- Exp Boost
    end

    local party = self:getParty()
    if (party) then
        if (party:isSharedExperienceActive() and
            party:isSharedExperienceEnabled()) then
            local tableVocs = {}
            local count = 0
            local totalCount = 0
            local leaderId = party:getLeader():getVocation():getId()
            if (leaderId) then
                tableVocs[leaderId] = 1
                count = count + 1
                totalCount = totalCount + 1
            end
            for i, v in pairs(party:getMembers()) do
                local vocId = v:getVocation():getId()
                if (tableVocs[vocId] == nil) then
                    tableVocs[vocId] = 1
                    count = count + 1
                end
                totalCount = totalCount + 1
            end

            if (totalCount <= 10 and
                count >= 4) then
                exp = exp * 2
            end
        end
    end

    -- Prey Stamina Modifier
    useStaminaPrey(self, source:getName())

    -- Exp Boost Modifier
    useStaminaXp(self)
    
    -- Stamina modifier
    if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
        useStamina(self)

        local staminaMinutes = self:getStamina()
        if staminaMinutes > 2400 and self:isPremium() then
            exp = exp * 1.5
        elseif staminaMinutes <= 840 then
            exp = exp * 0.5
        end
    end
    return exp
end

function Player:onLoseExperience(exp)
    return exp
end

function Player:onGainSkillTries(skill, tries)
    if APPLY_SKILL_MULTIPLIER == false then
        return tries
    end

    if skill == SKILL_MAGLEVEL then
        return tries * configManager.getNumber(configKeys.RATE_MAGIC)
    end
    return tries * configManager.getNumber(configKeys.RATE_SKILL)
end

function Player:onUseWeapon(normalDamage, elementType, elementDamage)
    --[[if (self:getAccountType() < ACCOUNT_TYPE_GOD) then
        return normalDamage, elementType, elementDamage
    end]]--
    
    local weaponSlot = self:getSlotItem(CONST_SLOT_LEFT)
    if (weaponSlot and weaponSlot:getType():getImbuingSlots() > 0) then
        for i = 1, 3 do
            local slotEnchant = weaponSlot:getSpecialAttribute(i)
            if (slotEnchant) then
                local percentDamage, enchantPercent = 0, weaponSlot:getImbuementPercent(slotEnchant)
                local typeEnchant = weaponSlot:getImbuementType(i) or ""
                if (typeEnchant ~= "") then
                    useStaminaImbuing(self, weaponSlot)

                end

                if (typeEnchant ~= "hitpointsleech" and typeEnchant ~= "manapointsleech" and typeEnchant ~= "criticalhit") then
                    percentDamage = normalDamage*(enchantPercent/100)
                    normalDamage = normalDamage - percentDamage
                    elementDamage = weaponSlot:getType():getAttack()*(enchantPercent/100)
                end

                if (typeEnchant == "firedamage") then
                    elementType = COMBAT_FIREDAMAGE
                elseif (typeEnchant == "earthdamage") then
                    elementType = COMBAT_EARTHDAMAGE
                elseif (typeEnchant == "icedamage") then
                    elementType = COMBAT_ICEDAMAGE
                elseif (typeEnchant == "energydamage") then
                    elementType = COMBAT_ENERGYDAMAGE
                elseif (typeEnchant == "deathdamage") then
                    elementType = COMBAT_DEATHDAMAGE
                end
            end
        end
    end

    return normalDamage, elementType, elementDamage
end

function Player:onCombatSpell(normalDamage, elementDamage, elementType)
    --[[normalDamage = normalDamage/2
    elementDamage = 22
    elementType = COMBAT_FIREDAMAGE--]]
    return normalDamage, elementType, elementDamage
end

local exhaust = { } -- SSA exhaust

local function distanceBetween(pos1, pos2)
    return math.abs(pos1-pos2)
end

function Player:onMoveItem(item, count, fromPosition, toPosition)
    local containerIdFrom = fromPosition.y - 64
    local containerFrom = self:getContainerById(containerIdFrom)
    if (containerFrom) then
        if (containerFrom:getId() == 26052 and
            toPosition.y >= 1 and
            toPosition.y <= 11 and
            toPosition.y ~= 3) then
            self:sendCancelMessage("You need to move the item for your backpack first.")
            return false
        end
        
        if item:getId() == 27595 then
        self:sendCancelMessage('You cannot move this object.')
        return false
    end

        if (item:getId() == 26377 and containerFrom:getId() == 26052) then
            self:sendCancelMessage("You can't move this item from Store Inbox.")
            return false
        end
    end

    if (toPosition.y == CONST_SLOT_FEET) then
        local feetItem = self:getSlotItem(CONST_SLOT_FEET)
        if (feetItem and feetItem:getActionId() == 23095) then
            return false
        end
    end

    if (item:isContainer()) then
        local vipItems = getAllItemsByAid(self, 23095, item)
        if (#vipItems > 0) then
            return false
        end
    end

    if (toPosition.y > 1000 and item:getActionId() == 23095) then
        return false
    end

    local containerTo = self:getContainerById(toPosition.y-64)
    if (containerTo) then
        -- VIP Boots guild in Ground bp
        if (item:getActionId() == 23095) then
            if (containerTo:getId() == 2594 or
                containerTo:getId() >= 25453 and
                containerTo:getId() <= 25469) then
                return false
            end

            local tileCont = Tile(containerTo:getPosition())
            if (tileCont) then
                for i, v in pairs(tileCont:getItems()) do
                    if (v:getUniqueId() == containerTo:getUniqueId()) then
                        return false
                    end
                end
            end
        end

        if (item:getId() == 26377 and containerTo:getId() ~= 26052) then
            self:sendCancelMessage("You can only move this item to Store Inbox.")
            return false
        end

        -- Store Inbox
        if (containerTo:getId() == 26052 and item:getId() ~= 26377) then
            self:sendCancelMessage("You cannot add items in the store inbox.")
            return false
        end

        -- Gold Pounch
        if (containerTo:getId() == 26377) then
            if (not (item:getId() == 2160 or item:getId() == 2152 or item:getId() == 2148)) then
                self:sendCancelMessage("You can move only money to this container.")
                return false
            end
        end
    end
    
---
    local amuletId = 2197
    local storage = 1000
    local delay = 1 -- seconds

    if item:getId() == amuletId then
        if toPosition.y == CONST_SLOT_NECKLACE then
            if os.time() > self:getStorageValue(storage) then
                self:setStorageValue(storage, os.time() + delay)
            else
                self:sendCancelMessage("You cannot move this object to fast.")
                return false
            end
        end
    end

--- LIONS ROCK START 

if self:getStorageValue(lionrock.storages.playerCanDoTasks) - os.time() < 0 then
        local p, i = lionrock.positions, lionrock.items
        local checkPr = false
        if item:getId() == lionrock.items.ruby and toPosition.x == p.ruby.x
                and toPosition.y == p.ruby.y  and toPosition.z == p.ruby.z then
            -- Ruby
            self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the ruby on the small socket. A red flame begins to burn.")
            checkPr = true
            if lionrock.taskactive.ruby ~= true then
                lionrock.taskactive.ruby = true
            end
           
            local tile = Tile(p.ruby)
            if tile:getItemCountById(i.redflame) < 1 then
                Game.createItem(i.redflame, 1, p.ruby)
            end
        end
       
        if item:getId() == lionrock.items.sapphire and toPosition.x == p.sapphire.x
                and toPosition.y == p.sapphire.y  and toPosition.z == p.sapphire.z then
            -- Sapphire
            self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the sapphire on the small socket. A blue flame begins to burn.")
            checkPr = true
            if lionrock.taskactive.sapphire ~= true then
                lionrock.taskactive.sapphire = true
            end
           
            local tile = Tile(p.sapphire)
            if tile:getItemCountById(i.blueflame) < 1 then
                Game.createItem(i.blueflame, 1, p.sapphire)
            end
        end
       
        if item:getId() == lionrock.items.amethyst and toPosition.x == p.amethyst.x
                and toPosition.y == p.amethyst.y  and toPosition.z == p.amethyst.z then
            -- Amethyst
            self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the topaz on the small socket. A yellow flame begins to burn.")
            checkPr = true
            if lionrock.taskactive.amethyst ~= true then
                lionrock.taskactive.amethyst = true
            end
           
            local tile = Tile(p.amethyst)
            if tile:getItemCountById(i.yellowflame) < 1 then
                Game.createItem(i.yellowflame, 1, p.amethyst)
            end
        end
       
        if item:getId() == lionrock.items.topaz and toPosition.x == p.topaz.x
                and toPosition.y == p.topaz.y  and toPosition.z == p.topaz.z then
            -- Topaz
            self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the amethyst on the small socket. A violet flame begins to burn.")
            checkPr = true
            if lionrock.taskactive.topaz ~= true then
                lionrock.taskactive.topaz = true
            end
           
            local tile = Tile(p.topaz)
            if tile:getItemCountById(i.violetflame) < 1 then
                Game.createItem(i.violetflame, 1, p.topaz)
            end
        end
       
        if checkPr == true then
            -- Adding the Fountain which gives present
            if lionrock.taskactive.ruby == true and lionrock.taskactive.sapphire == true
                and lionrock.taskactive.amethyst == true and lionrock.taskactive.topaz == true then
               
                local fountain = Game.createItem(i.rewardfountain, 1, { x=33073, y=32300, z=9})
                fountain:setActionId(41357)
               local stone = Tile({ x=33073, y=32300, z=9}):getItemById(3608)
            if stone ~= nil then
            stone:remove()
            end
                self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something happens at the centre of the room ...");
            end
           
            -- Removing Item
            item:remove(1)
        end
    end
 
    if toPosition.x == CONTAINER_POSITION then
        local cid = toPosition.y - 64 -- container id
        local container = self:getContainerById(cid)      
        if not container then
            return true
        end

        if toPosition.x == CONTAINER_POSITION and toCylinder and toCylinder:getId() == 26052 then
        self:sendCancelMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM)
        return false
    end
           
        -- Do not let the player insert items into either the Reward Container or the Reward Chest
        local itemId = container:getId()      
        if itemId == ITEM_REWARD_CONTAINER or itemId == ITEM_REWARD_CHEST then
            self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
            return false
        end
 
        -- The player also shouldn't be able to insert items into the boss corpse      
        local tile = Tile(container:getPosition())
        for _, item in ipairs(tile:getItems() or { }) do
            if item:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == 2^31 - 1 and item:getName() == container:getName() then
                self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
                return false
            end
        end
    end
    
    -- MOVER PRO TP 
    if blockTeleportTrashing and toPosition.x ~= CONTAINER_POSITION then
        local thing = Tile(toPosition):getItemByType(ITEM_TYPE_TELEPORT)
        if thing then
            self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
            self:getPosition():sendMagicEffect(CONST_ME_POFF)
            return false
        end
    end
    
    -- MOVER PARCEL  
    if item:getWeight() > 90000 and item:getId() == 2595 and tile and tile:getItemById(2593) then 
        self:sendCancelMessage('You cannot move parcel too heavy to mailbox.')
        return false 
    end
 
    --local tile = Tile(toPosition)
    if tile and tile:getItemById(21584) then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        self:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
        
    -- Do not let the player move the boss corpse.
    if item:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == 2^31 - 1 then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
    end

    return true
end

meu otserv é tfs 1.3  versão 10.00 - 11.32

Link para o post
Compartilhar em outros sites

Como funciona o sistema de reset do seu servidor? É feito por NPC? Se sim, poderia postar o script dele? Talvez esse NPC tenha um storage, facilitando a implementação do reset look.

Link para o post
Compartilhar em outros sites
9 horas atrás, Mateus Robeerto disse:

Como funciona o sistema de reset do seu servidor? É feito por NPC? Se sim, poderia postar o script dele? Talvez esse NPC tenha um storage, facilitando a implementação do reset look.

meu sistema de reset é pelo gesior, o Player reseta o char pelo site e fica salvo na database

player.php

Spoiler

<?php
if(!defined('INITIALIZED'))
    exit;

class Player extends ObjectData
{
    const LOADTYPE_ID = 'id';
    const LOADTYPE_NAME = 'name';
    const LOADTYPE_ACCOUNT_ID = 'account_id';
    public static $table = 'players';
    public $data = array('name' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'skill_fist' => null, 'skill_fist_tries' => null, 'skill_club' => null, 'skill_club_tries' => null, 'skill_sword' => null, 'skill_sword_tries' => null, 'skill_axe' => null, 'skill_axe_tries' => null, 'skill_dist' => null, 'skill_dist_tries' => null, 'skill_shielding' => null, 'skill_shielding_tries' => null, 'skill_fishing' => null, 'skill_fishing_tries' => null , 'deleted' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null, 'resets' => null);
    public static $fields = array('id', 'name', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'lastlogout', 'blessings', 'balance', 'stamina', 'skill_fist', 'skill_fist_tries', 'skill_club', 'skill_club_tries', 'skill_sword', 'skill_sword_tries', 'skill_axe', 'skill_axe_tries', 'skill_dist', 'skill_dist_tries', 'skill_shielding', 'skill_shielding_tries', 'skill_fishing', 'skill_fishing_tries', 'deleted', 'create_ip', 'create_date', 'comment', 'hide_char', 'resets');
    public static $skillNames = array('fist', 'club', 'sword', 'axe', 'dist', 'shielding', 'fishing');
    public $items;
    public $storages;
    public $account;
    public $rank;
    public $guildNick;
    public static $onlineList;

    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
        if($search_text != null)
            $this->load($search_text, $search_by);
    }

    public function load($search_text, $search_by = self::LOADTYPE_ID)
    {
        if(in_array($search_by, self::$fields))
            $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
        else
            new Error_Critic('', 'Wrong Player search_by type.');
        $fieldsArray = array();
        foreach(self::$fields as $fieldName)
            $fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

        $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
    }

    public function loadById($id)
    {
        $this->load($id, self::LOADTYPE_ID);
    }

    public function loadByName($name)
    {
        $this->load($name, self::LOADTYPE_NAME);
    }

    public function save($forceInsert = false)
    {
        if(!isset($this->data['id']) || $forceInsert)
        {
            $keys = array();
            $values = array();
            foreach(self::$fields as $key)
                if($key != 'id')
                {
                    $keys[] = $this->getDatabaseHandler()->fieldName($key);
                    $values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
                }
            $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
            $this->setID($this->getDatabaseHandler()->lastInsertId());
        }
        else
        {
            $updates = array();
            foreach(self::$fields as $key)
                $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
            $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
        }
    }

    public function getItems($forceReload = false)
    {
        if(!isset($this->items) || $forceReload)
            $this->items = new ItemsList($this->getID());

        return $this->items;
    }

    public function saveItems()
    {
        if(isset($this->items))
        {
            // if any script changed ID of player, function should save items with new player id
            $this->items->setPlayerId($this->getID());
            $this->items->save();
        }
        else
            new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save');
    }

    public function loadStorages()
    {
        $this->storages = array();
        // load all
        $storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
            ', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
            ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
        foreach($storages as $storage)
        {
            $this->storages[$storage['key']] = $storage['value'];
        }
    }

    public function saveStorages()
    {
        if(isset($this->storages))
        {
            $this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
            foreach($this->storages as $key => $value)
            {
                //save each
                $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . 
                    $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . 
                    $this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')');
            }
        }
        else
            new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save');
    }

    public function getStorage($key)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        if(isset($this->storages[$key]))
            return $this->storages[$key];
        else
            return null;
    }

    public function getStorages()
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        return $this->storages;
    }

    public function setStorage($key, $value)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        $this->storages[$key] = $value;
    }

    public function removeStorage($key)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        if(isset($this->storages[$key]))
            unset($this->storages[$key]);
    }

    public function getSkill($id)
    {
        if(isset(self::$skillNames[$id]))
            return $this->data['skill_' . self::$skillNames[$id]];
        else
            new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist');
    }

    public function setSkill($id, $value)
    {
        if(isset(self::$skillNames[$id]))
            $this->data['skill_' . self::$skillNames[$id]] = $value;
    }

    public function getSkillCount($id)
    {
        if(isset(self::$skillNames[$id]))
            return $this->data['skill_' . self::$skillNames[$id] . '_tries'];
        else
            new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist');
    }

    public function setSkillCount($id, $count)
    {
        if(isset(self::$skillNames[$id]))
            $this->data['skill_' . self::$skillNames[$id] . '_tries'] = $value;
    }

    public function loadAccount()
    {
        $this->account = new Account($this->getAccountID());
    }

    public function getAccount($forceReload = false)
    {
        if(!isset($this->account) || $forceReload)
            $this->loadAccount();

        return $this->account;
    }

    public function setAccount($account)
    {
        $this->account = $account;
        $this->setAccountID($account->getID());
    }

    public function loadRank()
    {
        $ranks = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('rank_id') . ', ' . $this->getDatabaseHandler()->fieldName('nick') . ' FROM ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetch();
        if($ranks)
        {
            $this->rank = new GuildRank($ranks['rank_id']);
            $this->guildNick = $ranks['nick'];
        }
        else
        {
            $this->rank = null;
            $this->guildNick = '';
        }
    }

    public function getRank($forceReload = false)
    {
        if(!isset($this->guildNick) || !isset($this->rank) || $forceReload)
            $this->loadRank();

        return $this->rank;
    }

    public function setRank($rank = null)
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
        if($rank !== null)
        {
            $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('guild_id') . ', ' . $this->getDatabaseHandler()->fieldName('rank_id') . ', ' . $this->getDatabaseHandler()->fieldName('nick') . ') VALUES (' . $this->getDatabaseHandler()->quote($this->getID()) . ', ' . $this->getDatabaseHandler()->quote($rank->getGuildID()) . ', ' . $this->getDatabaseHandler()->quote($rank->getID()) . ', ' . $this->getDatabaseHandler()->quote('') . ')');
        }
        $this->rank = $rank;
    }

    public function hasGuild()
    {
        return $this->getRank() != null && $this->getRank()->isLoaded();
    }

    public function setGuildNick($value)
    {
        $this->guildNick = $value;
        $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' SET ' . $this->getDatabaseHandler()->fieldName('nick') . ' = ' . $this->getDatabaseHandler()->quote($this->guildNick) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
    }

    public function getGuildNick()
    {
        if(!isset($this->guildNick) || !isset($this->rank))
            $this->loadRank();

        return $this->guildNick;
    }

    public function removeGuildInvitations()
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
    }

    public function unban()
    {
        $this->getAccount()->unban();
    }

    public function isBanned()
    {
        return $this->getAccount()->isBanned();
    }

    public function isNamelocked()
    {
        return false;
    }

    public function delete()
    {
        $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));

        unset($this->data['id']);
    }
/*
 * default tfs 0.3.6 fields
*/
    public function setID($value){$this->data['id'] = $value;}
    public function getID(){return $this->data['id'];}
    // Kawo add
    public function getResets(){return $this->data['resets'];}
    //#####
    public function setAccountID($value){$this->data['account_id'] = $value;}
    public function getAccountID(){return $this->data['account_id'];}
    public function setName($value){$this->data['name'] = $value;}
    public function getName(){return $this->data['name'];}
    public function setGroupID($value){$this->data['group_id'] = $value;}
    public function getGroupID(){return $this->data['group_id'];}
    public function setVocation($value){$this->data['vocation'] = $value;}
    public function getVocation(){return $this->data['vocation'];}
    public function setLevel($value){$this->data['level'] = $value;}
    public function getLevel(){return $this->data['level'];}
    public function setExperience($value){$this->data['experience'] = $value;}
    public function getExperience(){return $this->data['experience'];}
    public function setHealth($value){$this->data['health'] = $value;}
    public function getHealth(){return $this->data['health'];}
    public function setHealthMax($value){$this->data['healthmax'] = $value;}
    public function getHealthMax(){return $this->data['healthmax'];}
    public function setMana($value){$this->data['mana'] = $value;}
    public function getMana(){return $this->data['mana'];}
    public function setManaMax($value){$this->data['manamax'] = $value;}
    public function getManaMax(){return $this->data['manamax'];}
    public function setMagLevel($value){$this->data['maglevel'] = $value;}
    public function getMagLevel(){return $this->data['maglevel'];}
    public function setManaSpent($value){$this->data['manaspent'] = $value;}
    public function getManaSpent(){return $this->data['manaspent'];}
    public function setSex($value){$this->data['sex'] = $value;}
    public function getSex(){return $this->data['sex'];}
    public function setTown($value){$this->data['town_id'] = $value;}
    public function getTown(){return $this->data['town_id'];}
    public function setPosX($value){$this->data['posx'] = $value;}
    public function getPosX(){return $this->data['posx'];}
    public function setPosY($value){$this->data['posy'] = $value;}
    public function getPosY(){return $this->data['posy'];}
    public function setPosZ($value){$this->data['posz'] = $value;}
    public function getPosZ(){return $this->data['posz'];}
    public function setCapacity($value){$this->data['cap'] = $value;}
    public function getCapacity(){return $this->data['cap'];}
    public function setSoul($value){$this->data['soul'] = $value;}
    public function getSoul(){return $this->data['soul'];}
    public function setConditions($value){$this->data['conditions'] = $value;}
    public function getConditions(){return $this->data['conditions'];}
    public function setLastIP($value){$this->data['lastip'] = $value;}
    public function getLastIP(){return $this->data['lastip'];}
    public function setLastLogin($value){$this->data['lastlogin'] = $value;}
    public function getLastLogin(){return $this->data['lastlogin'];}
    public function setLastLogout($value){$this->data['lastlogout'] = $value;}
    public function getLastLogout(){return $this->data['lastlogout'];}
    public function setSkull($value){$this->data['skull'] = $value;}
    public function getSkull(){return $this->data['skull'];}
    public function setSkullTime($value){$this->data['skulltime'] = $value;}
    public function getSkullTime(){return $this->data['skulltime'];}
    public function setSave($value = 1){$this->data['save'] = (int) $value;}
    public function getSave(){return $this->data['save'];}
    public function setBlessings($value){$this->data['blessings'] = $value;}
    public function getBlessings(){return $this->data['blessings'];}
    public function setBalance($value){$this->data['balance'] = $value;}
    public function getBalance(){return $this->data['balance'];}
    public function setStamina($value){$this->data['stamina'] = $value;}
    public function getStamina(){return $this->data['stamina'];}
    public function setDeleted($value){$this->data['deleted'] = (int) $value;}
    public function isDeleted(){return (bool) $this->data['deleted'];}
    public function setLookBody($value){$this->data['lookbody'] = $value;}
    public function getLookBody(){return $this->data['lookbody'];}
    public function setLookFeet($value){$this->data['lookfeet'] = $value;}
    public function getLookFeet(){return $this->data['lookfeet'];}
    public function setLookHead($value){$this->data['lookhead'] = $value;}
    public function getLookHead(){return $this->data['lookhead'];}
    public function setLookLegs($value){$this->data['looklegs'] = $value;}
    public function getLookLegs(){return $this->data['looklegs'];}
    public function setLookType($value){$this->data['looktype'] = $value;}
    public function getLookType(){return $this->data['looktype'];}
    public function setLookAddons($value){$this->data['lookaddons'] = $value;}
    public function getLookAddons(){return $this->data['lookaddons'];}
/*
 * Custom AAC fields
 * create_ip , INT, default 0
 * create_date , INT, default 0
 * hide_char , INT, default 0
 * comment , TEXT, default ''
*/
    public function setCreateIP($value){$this->data['create_ip'] = $value;}
    public function getCreateIP(){return $this->data['create_ip'];}
    public function setCreateDate($value){$this->data['create_date'] = $value;}
    public function getCreateDate(){return $this->data['create_date'];}
    public function setHidden($value){$this->data['hide_char'] = (int) $value;}
    public function isHidden(){return (bool) $this->data['hide_char'];}
    public function setComment($value){$this->data['comment'] = $value;}
    public function getComment(){return $this->data['comment'];}
/*
 * for compability with old scripts
*/
    public function setGroup($value){$this->setGroupID($value);}
    public function getGroup(){return $this->getGroupID();}
    public function getCreated(){return $this->getCreateDate();}
    public function setCreated($value){$this->setCreateDate($value);}
    public function setCap($value){$this->setCapacity($value);}
    public function getCap(){return $this->getCapacity();}
    public function isSaveSet(){return $this->getSave();}
    public function unsetSave(){$this->setSave(0);}
    public function getTownId(){return $this->getTown();}
    public function getHideChar(){return $this->isHidden();}
    public function find($name){$this->loadByName($name);}

    public static function isPlayerOnline($playerID)
    {
        if(!isset(self::$onlineList))
        {
            self::$onlineList = array();
            $onlines = Website::getDBHandle()->query('SELECT ' . Website::getDBHandle()->fieldName('player_id') . ' FROM ' . Website::getDBHandle()->tableName('players_online'))->fetchAll();
            foreach($onlines as $online)
            {
                self::$onlineList[$online['player_id']] = $online['player_id'];
            }
        }

        return isset(self::$onlineList[$playerID]);
    }

    public function isOnline()
    {
        return self::isPlayerOnline($this->getID());
    }

    public function getOnline()
    {
        return self::isPlayerOnline($this->getID());
    }
}

 

accountmanagement.php

Spoiler

<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-accountmanagement.gif" alt="Contentbox headline">
<?php
if(!defined('INITIALIZED'))
    exit;

if(!$logged)
    if($action == "logout")
        $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Logout Successful</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have logged out of your '.htmlspecialchars($config['server']['serverName']).' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr>          </table>        </div>  </table></div></td></tr>';
    else
    {
        if(isset($isTryingToLogin))
        {
            switch(Visitor::getLoginState())
            {
                case Visitor::LOGINSTATE_NO_ACCOUNT:
                    $main_content .= 'Account with that name doesn\'t exist.';
                    break;
                case Visitor::LOGINSTATE_WRONG_PASSWORD:
                    $main_content .= 'Wrong password to account.';
                    break;
            }
        }
        $main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Login</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';
    }
else
{
    if($action == "")
    {
        $account_reckey = $account_logged->getCustomField("key");
        if($account_logged->getPremDays() > 0)
            $account_status = '<b><font color="green">Premium Account, '. $account_logged->getPremDays() .' days left</font></b>';
        else
            $account_status = '<b><font color="red">Free Account</font></b>';
        if(empty($account_reckey))
            $account_registred = '<b><font color="red">No</font></b>';
        else
            if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])
                $account_registred = '<b><font color="green">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Rec key </a> )</font></b>';
            else
                $account_registred = '<b><font color="green">Yes</font></b>';
        $account_created = $account_logged->getCreateDate();
        $account_email = $account_logged->getEMail();
        $account_email_new_time = $account_logged->getCustomField("email_new_time");
        if($account_email_new_time > 1)
            $account_email_new = $account_logged->getCustomField("email_new");
        $account_rlname = $account_logged->getRLName();
        $account_location = $account_logged->getLocation();
        if($account_logged->isBanned())
            if($account_logged->getBanTime() > 0)
                $welcome_msg = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>';
            else
                $welcome_msg = '<font color="red">Your account is banished FOREVER!</font>';
        else
            $welcome_msg = 'Welcome to your account!';
        $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" ><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><td width="100%"></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=logout" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif" ></div></div></td></tr></form></table></td></tr></table>    </div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/><center><table><tr><td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /></td><td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >'.$welcome_msg.'<br/></td><td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></td></tr></table><br/></center>';
        //if account dont have recovery key show hint
        if(empty($account_reckey))
            $main_content .= '<div class="SmallBox" ><div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" > <font color="red"> <b><h3>CREATE YOUR RECOVERY KEY AND SAVE IT! WE CANT GIVE YOUR CHAR BACK IF YOU GOT HACKED!!!!!! Click on "Register Account" and get your free recovery key today!</b></font></h3></td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>'; 
        if($account_email_new_time > 1)
            if($account_email_new_time < time())
                $account_email_change = '<br>(You can accept <b>'.htmlspecialchars($account_email_new).'</b> as a new email.)';
            else
            {
                $account_email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b>";
                $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="Message" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Note:</td><td style="width:100%;" >A request has been submitted to change the email address of this account to <b>'.htmlspecialchars($account_email_new).'</b>. After <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b> you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></div>    </div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/><br/>';
            }
        $main_content .= '<a name="General+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" >    <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" ><table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:57%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Email Address:</td><td style="width:90%;" >'.htmlspecialchars($account_email).''.$account_email_change.'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Created:</td><td>'.date("j F Y, G:i:s", $account_created).'</td></td><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Registred:</td><td>'.$account_registred.'</td></tr></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name=newemail value="" ><input type="hidden" name=newemaildate value=0 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form>    </table></td><td width="100%"></td>';        //show button "register account"
        if(empty($account_reckey))
            $main_content .= '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>';
        $main_content .= '</tr></table></td></tr></table></div></table></div></td></tr><br/><a name="Public+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" >  <table class="Table5" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td><table style="width:100%;"><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" >'.$account_rlname.'</td></tr><tr><td class="LabelV" >Location:</td><td style="width:90%;" >'.$account_location.'</td></tr></table></td><td align=right><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeinfo" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';
        $main_content .= '<a name="Characters" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Characters</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>   <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:65%" >Name</td><td style="width:15%" >Level</td><td style="width:7%">Status</td><td style="width:5%"> </td></tr>';
        $account_players = $account_logged->getPlayersList();
        //show list of players on account
        foreach($account_players as $account_player)
        {
            $player_number_counter++;
            $main_content .= '<tr style="background-color:';
            if(is_int($player_number_counter / 2))
                $main_content .= $config['site']['darkborder'];
            else
                $main_content .= $config['site']['lightborder'];
            $main_content .= ';" ><td><NOBR>'.$player_number_counter.'. '.htmlspecialchars($account_player->getName());
            if($account_player->isDeleted())
                $main_content .= '<font color="red"><b> [ DELETED ] </b> <a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">>> UNDELETE <<</a></font>';
            $main_content .= '</NOBR></td><td><NOBR>'.$account_player->getLevel().' '.htmlspecialchars($vocation_name[$account_player->getVocation()]).'</NOBR></td>';
            if(!$account_player->isOnline())
                $main_content .= '<td><font color="red"><b>Offline</b></font></td>';
            else
                $main_content .= '<td><font color="green"><b>Online</b></font></td>';
            $main_content .= '<td>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</td></tr>';
        }
        $main_content .= '</table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif" ></div></div></td></tr></form></table></td><td style="width:57%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="'.$layout_name.'/images/buttons/_sbutton_deletecharacter.gif" ></div></div></td></tr></form></table></td><td style="width:100%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=reset" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Reset Character" alt="Reset Character" src="'.$layout_name.'/images/buttons/_sbutton_resetcharacter.gif" ></div></div></td></tr></form></table></td> </tr></table></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';    
    }
//########### CHANGE PASSWORD ##########
    if($action == "changepassword") {
        $new_password = trim($_POST['newpassword']);
        $new_password2 = trim($_POST['newpassword2']);
        $old_password = trim($_POST['oldpassword']);
        if(empty($new_password) && empty($new_password2) && empty($old_password))
        {
            $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
        }
        else
        {
            if(empty($new_password) || empty($new_password2) || empty($old_password))
            {
                $show_msgs[] = "Please fill in form.";
            }
            if($new_password != $new_password2)
            {
                $show_msgs[] = "The new passwords do not match!";
            }
            if(empty($show_msgs))
            {
                if(!check_password($new_password))
                {
                    $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
                }
                if(!$account_logged->isValidPassword($old_password))
                {
                    $show_msgs[] = "Current password is incorrect!";
                }
            }
            if(!empty($show_msgs))
            {
                //show errors
                $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
                foreach($show_msgs as $show_msg) {
                    $main_content .= '<li>'.$show_msg;
                }
                $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
                //show form
                $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
            }
            else
            {
                $org_pass = $new_password;
                $account_logged->setPassword($new_password);
                $account_logged->save();
                $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Password Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your password has been changed.';
                if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])
                {
                    $mailBody = '<html>
                    <body>
                    <h3>Password to account changed!</h3>
                    <p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
                    <p>New password: <b>'.htmlspecialchars($org_pass).'</b></p>
                    </body>
                    </html>

 

 

Editado por mane stick (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

Ok, fácil então... Procure essa linha

function Player:onLook(thing, position, distance)

É só prosseguir com cuidado, ok?

function Player:onLook(thing, position, distance)
    local description = 'You see '

    if thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if (itemType and itemType:getImbuingSlots() > 0) then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if (thing:getSpecialAttribute(i+3)) then
                    time = getTime(thing:getSpecialAttribute(i+3))
                end
                
                if (specialAttr) then
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", "
                    else
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")."
                    end
                else
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "Empty Slot, "
                    else
                        imbuingSlots = imbuingSlots.. "Empty Slot)."
                    end
                end
            end
            description = string.gsub(description, "It weighs", imbuingSlots.. "\nIt weighs")
        end
		
		
		   --[[-- KD look 
     if thing:isCreature() and thing:isPlayer() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, thing:getStorageValue(167912)), math.max(0, thing:getStorageValue(167913)))
    end
        end--]]
    
    --[[-- MARRY 
    if LOOK_MARRIAGE_DESCR and thing:isCreature() then
        if thing:isPlayer() then
            description = description .. self:getMarriageDescription(thing)
        end
    end--]]
		
		
    elseif thing:isPlayer() then
        local playerGuid = thing:getGuid()
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)
        if query then
            local playerDescription = result.getDataString(query, "resets")
            description = string.format("%s\n[ Resets: %s ]", description, playerDescription)
            print(string.format("[Player ID: %s] Resets: %s", playerGuid, playerDescription)) 
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid)) 
        end
    else
        description = description .. thing:getDescription(distance)
    end

    -- KD look 
    if thing:isCreature() and thing:isPlayer() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, thing:getStorageValue(167912)), math.max(0, thing:getStorageValue(167913)))
    end
    
    -- MARRY 
    if LOOK_MARRIAGE_DESCR and thing:isCreature() then
        if thing:isPlayer() then
            description = description .. self:getMarriageDescription(thing)
        end
    end

    if self:getGroup():getAccess() then
        if thing:isItem() then
            description = string.format('%s\nItem ID: %d', description, thing.itemid)

            local actionId = thing.actionid
            if actionId ~= 0 then
                description = string.format('%s, Action ID: %d', description, actionId)
            end

            local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID)
            if uniqueId > 0 and uniqueId < 65536 then
                description = string.format('%s, Unique ID: %d', description, uniqueId)
            end

            description = description .. '.'
            local itemType = thing:getType()

            local transformEquipId = itemType:getTransformEquipId()
            local transformDeEquipId = itemType:getTransformDeEquipId()
            if transformEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onEquip)', description, transformEquipId)
            elseif transformDeEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onDeEquip)', description, transformDeEquipId)
            end

            local decayId = itemType:getDecayId()
            if decayId ~= -1 then
                description = string.format('%s\nDecays to: %d', description, decayId)
            end
        elseif thing:isCreature() then
            local title = getTitle(thing.uid)
            if title then 
                description  = description  .. title .. " of Relembra." 
            end
            local str = '%s\nHealth: %d / %d'
            if thing:getMaxMana() > 0 then
                str = string.format('%s, Mana: %d / %d', str, thing:getMana(), thing:getMaxMana())
            end
            description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. '.'
        end

        local position = thing:getPosition()
        description = string.format(
            '%s\nPosition: %d, %d, %d',
            description, position.x, position.y, position.z
        )

        if thing:isCreature() and thing:isPlayer() then
            description = string.format('%s\nIP: %s.', description, Game.convertIpToString(thing:getIp()))
        end
    end
    self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end

 

Link para o post
Compartilhar em outros sites
16 minutos atrás, Mateus Robeerto disse:

Ok, fácil então... Procure essa linha


function Player:onLook(thing, position, distance)

É só prosseguir com cuidado, ok?


function Player:onLook(thing, position, distance)
    local description = 'You see '

    if thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if (itemType and itemType:getImbuingSlots() > 0) then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if (thing:getSpecialAttribute(i+3)) then
                    time = getTime(thing:getSpecialAttribute(i+3))
                end
                
                if (specialAttr) then
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", "
                    else
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")."
                    end
                else
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "Empty Slot, "
                    else
                        imbuingSlots = imbuingSlots.. "Empty Slot)."
                    end
                end
            end
            description = string.gsub(description, "It weighs", imbuingSlots.. "\nIt weighs")
        end
		
		
		   --[[-- KD look 
     if thing:isCreature() and thing:isPlayer() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, thing:getStorageValue(167912)), math.max(0, thing:getStorageValue(167913)))
    end
        end--]]
    
    --[[-- MARRY 
    if LOOK_MARRIAGE_DESCR and thing:isCreature() then
        if thing:isPlayer() then
            description = description .. self:getMarriageDescription(thing)
        end
    end--]]
		
		
    elseif thing:isPlayer() then
        local playerGuid = thing:getGuid()
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)
        if query then
            local playerDescription = result.getDataString(query, "resets")
            description = string.format("%s\n[ Resets: %s ]", description, playerDescription)
            print(string.format("[Player ID: %s] Resets: %s", playerGuid, playerDescription)) 
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid)) 
        end
    else
        description = description .. thing:getDescription(distance)
    end

    -- KD look 
    if thing:isCreature() and thing:isPlayer() then
        description = string.format("%s\n [PVP Kills: %d] \n [PVP Deaths: %d] \n",
            description, math.max(0, thing:getStorageValue(167912)), math.max(0, thing:getStorageValue(167913)))
    end
    
    -- MARRY 
    if LOOK_MARRIAGE_DESCR and thing:isCreature() then
        if thing:isPlayer() then
            description = description .. self:getMarriageDescription(thing)
        end
    end

    if self:getGroup():getAccess() then
        if thing:isItem() then
            description = string.format('%s\nItem ID: %d', description, thing.itemid)

            local actionId = thing.actionid
            if actionId ~= 0 then
                description = string.format('%s, Action ID: %d', description, actionId)
            end

            local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID)
            if uniqueId > 0 and uniqueId < 65536 then
                description = string.format('%s, Unique ID: %d', description, uniqueId)
            end

            description = description .. '.'
            local itemType = thing:getType()

            local transformEquipId = itemType:getTransformEquipId()
            local transformDeEquipId = itemType:getTransformDeEquipId()
            if transformEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onEquip)', description, transformEquipId)
            elseif transformDeEquipId ~= 0 then
                description = string.format('%s\nTransforms to: %d (onDeEquip)', description, transformDeEquipId)
            end

            local decayId = itemType:getDecayId()
            if decayId ~= -1 then
                description = string.format('%s\nDecays to: %d', description, decayId)
            end
        elseif thing:isCreature() then
            local title = getTitle(thing.uid)
            if title then 
                description  = description  .. title .. " of Relembra." 
            end
            local str = '%s\nHealth: %d / %d'
            if thing:getMaxMana() > 0 then
                str = string.format('%s, Mana: %d / %d', str, thing:getMana(), thing:getMaxMana())
            end
            description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. '.'
        end

        local position = thing:getPosition()
        description = string.format(
            '%s\nPosition: %d, %d, %d',
            description, position.x, position.y, position.z
        )

        if thing:isCreature() and thing:isPlayer() then
            description = string.format('%s\nIP: %s.', description, Game.convertIpToString(thing:getIp()))
        end
    end
    self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end

 

ta quase perfeito, só ta faltando aparecer o lvl agora

 

09:54 You see 
[ Resets: 1 ]
 [PVP Kills: 0] 
 [PVP Deaths: 0]

 

ta assim

Link para o post
Compartilhar em outros sites
2 minutos atrás, mane stick disse:

ta quase perfeito, só ta faltando aparecer o lvl agora

 

09:54 You see 
[ Resets: 1 ]
 [PVP Kills: 0] 
 [PVP Deaths: 0]

 

ta assim

Lol... antes, ele mostrava o level certo?

Link para o post
Compartilhar em outros sites

Ok, volte ao script original e substitua com calma... Acho que vai dar certo.

 

function Player:onLook(thing, position, distance)
    local description = 'You see '

    if thing:isPlayer() then
        local playerGuid = thing:getGuid() 
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)
        if query then
            local playerDescription = result.getDataString(query, "resets")
            description = string.format("%s\n[ Resets: %s ]", description, playerDescription)
            print(string.format("[Player ID: %s] Resets: %s", playerGuid, playerDescription))
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid))
        end
    elseif thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if itemType and itemType:getImbuingSlots() > 0 then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if thing:getSpecialAttribute(i + 3) then
                    time = getTime(thing:getSpecialAttribute(i + 3))
                end
                
                if specialAttr then
                    imbuingSlots = imbuingSlots .. specialAttr .. " " .. time
                    if i ~= itemType:getImbuingSlots() then
                        imbuingSlots = imbuingSlots .. ", "
                    else
                        imbuingSlots = imbuingSlots .. ")."
                    end
                else
                    imbuingSlots = imbuingSlots .. "Empty Slot"
                    if i ~= itemType:getImbuingSlots() then
                        imbuingSlots = imbuingSlots .. ", "
                    else
                        imbuingSlots = imbuingSlots .. ")."
                    end
                end
            end
            description = string.gsub(description, "It weighs", imbuingSlots .. "\nIt weighs")
        end
    else
        description = description .. thing:getDescription(distance)
    end

 

Editado por Mateus Robeerto (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
3 minutos atrás, Mateus Robeerto disse:

Ok, volte ao script original e substitua com calma... Acho que vai dar certo.

 


function Player:onLook(thing, position, distance)
    local description = 'You see '

    if thing:isPlayer() then
        local playerGuid = thing:getGuid() 
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)
        if query then
            local playerDescription = result.getDataString(query, "resets")
            description = string.format("%s\n[ Resets: %s ]", description, playerDescription)
            print(string.format("[Player ID: %s] Resets: %s", playerGuid, playerDescription))
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid))
        end
    elseif thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if itemType and itemType:getImbuingSlots() > 0 then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if thing:getSpecialAttribute(i + 3) then
                    time = getTime(thing:getSpecialAttribute(i + 3))
                end
                
                if specialAttr then
                    imbuingSlots = imbuingSlots .. specialAttr .. " " .. time
                    if i ~= itemType:getImbuingSlots() then
                        imbuingSlots = imbuingSlots .. ", "
                    else
                        imbuingSlots = imbuingSlots .. ")."
                    end
                else
                    imbuingSlots = imbuingSlots .. "Empty Slot"
                    if i ~= itemType:getImbuingSlots() then
                        imbuingSlots = imbuingSlots .. ", "
                    else
                        imbuingSlots = imbuingSlots .. ")."
                    end
                end
            end
            description = string.gsub(description, "It weighs", imbuingSlots .. "\nIt weighs")
        end
    else
        description = description .. thing:getDescription(distance)
    end
end

 

agora ficou assim 

 

10:09 You see 
[ Resets: 1 ]

Link para o post
Compartilhar em outros sites
1 minuto atrás, Mateus Robeerto disse:

Seu servidor possui revscripts e EventCallback?

Desculpa eu sou leigo, você poderia falar aonde eu vejo isso?

Link para o post
Compartilhar em outros sites
50 minutos atrás, mane stick disse:

Desculpa eu sou leigo, você poderia falar aonde eu vejo isso?

Revscriptsys é uma nova forma alternativa de registrar scripts para que você não precise fazer isso via XML. Você só precisa colocar seus scripts lua dentro data/scripts/ou em qualquer subpasta dele, se desejar. Os scripts Monster são, no entanto, colocados em um caminho diferente: data/monster/(ou em qualquer subpasta dele, como antes). Este sistema suporta a utilização de diferentes metatabelas no mesmo script (Actions, MoveEvents, GlobalEvents...).

 

Fica na pasta 'data/scripts"

Creio que o OtservBR não suporta o 'EventCallback', porque simplesmente colocar na pasta 'data/scripts' já funciona na hora, hahaha.

 

 

#Edited

 

O problema foi resolvido via Discord. Para quem quer resets o look por DB, aqui está um exemplo.

 if thing:isCreature() and thing:isPlayer() then
        local playerGuid = thing:getGuid() 
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)

        if query then
            local playerResets = result.getDataString(query, "resets") 
            description = string.format("%s\n[ Resets: %s ]", description, playerResets)
            result.free(query) 
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid))
        end
    end

Depende da sintaxe Lua e do seu arquivo player.lua. Pegue e veja se está correto, ajuste e teste. Boa sorte!

Editado por Mateus Robeerto (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
28 minutos atrás, Mateus Robeerto disse:

Revscriptsys é uma nova forma alternativa de registrar scripts para que você não precise fazer isso via XML. Você só precisa colocar seus scripts lua dentro data/scripts/ou em qualquer subpasta dele, se desejar. Os scripts Monster são, no entanto, colocados em um caminho diferente: data/monster/(ou em qualquer subpasta dele, como antes). Este sistema suporta a utilização de diferentes metatabelas no mesmo script (Actions, MoveEvents, GlobalEvents...).

 

Fica na pasta 'data/scripts"

Creio que o OtservBR não suporta o 'EventCallback', porque simplesmente colocar na pasta 'data/scripts' já funciona na hora, hahaha.

 

me chama no discord: 82mateusroberto

O problema foi resolvido via Discord. Para quem quer resetar o look por DB, aqui está um exemplo.


 if thing:isCreature() and thing:isPlayer() then
        local playerGuid = thing:getGuid() 
        local query = db.storeQuery("SELECT `resets` FROM `players` WHERE `id` = " .. playerGuid)

        if query then
            local playerResets = result.getDataString(query, "resets") 
            description = string.format("%s\n[ Resets: %s ]", description, playerResets)
            result.free(query) 
        else
            print(string.format("[Player ID: %s] Falha na consulta ao banco de dados", playerGuid))
        end
    end

Depende da sintaxe Lua e do seu arquivo player.lua. Pegue e veja se está correto, ajuste e teste. Boa sorte!

Solução /\ 

sou leigo nessa area, Matheus Robeerto me ajudou muito

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo