Ir para conteúdo

Featured Replies

Postado

Salve rapazeada do TK, estou com um problema no meu servidor de que quando o player usa um item que ganha o mage full por exemplo, desloga e loga novamente ele perde o mage full e ganha o oriental full, alguém sabe o que poderia ser? Já agradeço pela atenção!

Deixarei os scripts que acredito serem necessários abaixo:

login.lua:

Spoiler
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
 
function onLogin(cid)
    if (getBooleanFromString(getConfigValue('accountManager')) == false) then
        if (getCreatureName(cid) == "Account Manager") then
            return doRemoveCreature(cid, true)
        end
    end
 
    local loss = getConfigValue('deathLostPercent')
    if (loss ~= nil and getPlayerStorageValue(cid, "bless") ~= 5) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 7)
    end
 
    if (getPlayerStorageValue(cid, "death_bless") == 1) then
        local t = { PLAYERLOSS_EXPERIENCE, PLAYERLOSS_SKILLS, PLAYERLOSS_ITEMS, PLAYERLOSS_CONTAINERS }
        for i = 1, #t do
            doPlayerSetLossPercent(cid, t[i], 100)
        end
        setPlayerStorageValue(cid, "death_bless", 0)
    end
 
    local accountManager = getPlayerAccountManager(cid)
    if (accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if (lastLogin > 0) then
            doCreatureSetStorage(cid, 5412, os.time())
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end
 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif (accountManager == MANAGER_NAMELOCK) then
        addEvent(valid(doCreatureSay), 500, cid,
            "Hello, it appears that your character has been locked for name violating rules, what new name would you like to have?"
            , TALKTYPE_PRIVATE_NP, true, cid)
    elseif (accountManager == MANAGER_ACCOUNT) then
        addEvent(valid(doCreatureSay), 500, cid,
            "Hello, type 'account' to manage your account. If you would like to start over, type 'cancel' anywhere.",
            TALKTYPE_PRIVATE, true, cid)
    else
        addEvent(valid(doCreatureSay), 500, cid,
            "Hello, type 'account' to create an account or 'recover' to recover an account.", TALKTYPE_PRIVATE, true, cid)
    end
 
    if (not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end
 
    registerCreatureEvent(cid, "Idle")
    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "PVPCreature")
    registerCreatureEvent(cid, "ReportBug")
    if (config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end
 
    registerCreatureEvent(cid, "GuildEvents")
    registerCreatureEvent(cid, "AdvanceSave")
    registerCreatureEvent(cid, "FimVip")
    registerCreatureEvent(cid, "ProtectLevel")
 
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
 
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i + 100, 0)
        end
    end
 
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
 
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
 
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0)
    doPlayerSendTextMessage(cid, TALKTYPE_PRIVATE,
        "New feature: now you can use command: !auto spell, mana - ex: !auto exura, 25")
    doPlayerSendTextMessage(cid, TALKTYPE_PRIVATE,
        "This command will automatically eat food for you, It work for making runes.")

 

outfits.lua:

 

Spoiler
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="258" name="Citizen"/>
        <list gender="1" lookType="267" name="Citizen"/>
    </outfit>
 
    <outfit id="2">
        <list gender="0" lookType="259" name="Hunter"/>
        <list gender="1" lookType="268" name="Hunter"/>
    </outfit>
 
    <outfit id="3">
        <list gender="0" lookType="432" name="Summoner"/>
        <list gender="1" lookType="491" name="Mage"/>
    </outfit>
 
    <outfit id="4">
        <list gender="0" lookType="261" name="Knight"/>
        <list gender="1" lookType="270" name="Knight"/>
    </outfit>
 
    <outfit id="5" premium="yes" quest="11322">
        <list gender="0" lookType="329" name="Noblewoman"/>
        <list gender="1" lookType="297" name="Nobleman"/>
    </outfit>
 
    <outfit id="6" premium="yes" quest="11322">
        <list gender="0" lookType="339" name="Mage"/>
        <list gender="1" lookType="316" name="Summoner"/>
    </outfit>
 
    <outfit id="7" premium="yes" quest="11322">
        <list gender="0" lookType="139" name="Warrior"/>
        <list gender="1" lookType="299" name="Warrior"/>
    </outfit>
   
    <outfit id="8" premium="yes" quest="11322">
        <list gender="1" lookType="436" name="Druid"/>
        <list gender="0" lookType="431" name="Druid"/>
    </outfit>  
   
    <outfit id="9" premium="yes" quest="11322">
        <list gender="1" lookType="414" name="Oriental"/>
        <list gender="0" lookType="434" name="Oriental"/>
    </outfit>  
 
    <outfit id="10" premium="yes" quest="11322">
        <list gender="1" lookType="435" name="Assassin"/>
        <list gender="0" lookType="437" name="Assassin"/>
    </outfit>
   
    <outfit id="11" premium="yes" quest="11322">
        <list gender="0" lookType="337" name="Guardian"/>
        <list gender="1" lookType="308" name="Guardian"/>
    </outfit>
   
    <outfit id="12" premium="yes" quest="11322">
        <list gender="0" lookType="338" name="Spike Elite"/>
        <list gender="1" lookType="309" name="Spike Elite"/>
    </outfit>
   
    <outfit id="13" premium="yes" quest="11322">
        <list gender="1" lookType="307" name="Mysticelite"/>
        <list gender="0" lookType="336" name="Mysticelite"/>
    </outfit>
   
    <outfit id="14" premium="yes" quest="11322">
        <list gender="1" lookType="411" name="Golden"/>
        <list gender="0" lookType="433" name="Golden"/>
    </outfit>
    <outfit id="15" premium="yes" quest="11322">
        <list gender="1" lookType="492" name="Oriental King"/>
        <list gender="0" lookType="492" name="Oriental King"/>
    </outfit>
    <outfit id="16" premium="yes" quest="11322">
        <list gender="1" lookType="493" name="Scary"/>
        <list gender="0" lookType="493" name="Scary"/>
    </outfit>
    <!--
    <outfit id="15" premium="yes">
        <list gender="1" lookType="438" name="Yalahari"/>
        <list gender="0" lookType="439" name="Yalahari"/>
    </outfit>
    -->
</outfits>

 

roupa.lua:

 

Spoiler
function onLogin(cid)
if getPlayerStorageValue(cid,8470001) >= 1 then --Summoner Addon
        doPlayerAddOutfit(cid,316, 3)
        doPlayerAddOutfit(cid,339, 3)
else
end
if getPlayerStorageValue(cid,8470002) >= 1 then --Golden addon
        doPlayerAddOutfit(cid,411, 3)
        doPlayerAddOutfit(cid,433, 3)
end
if getPlayerStorageValue(cid,8470003) >= 1 then --Oriental Addon
        doPlayerAddOutfit(cid,414, 3)
        doPlayerAddOutfit(cid,434, 3)
end
if getPlayerStorageValue(cid,8470004) >= 1 then -- Druid addon
        doPlayerAddOutfit(cid,436, 3)
        doPlayerAddOutfit(cid,431, 3)
end
if getPlayerStorageValue(cid,8470005) >= 1 then --Assassin addon
        doPlayerAddOutfit(cid,435, 3)
        doPlayerAddOutfit(cid,437, 3)
end
if getPlayerStorageValue(cid,8470010) >= 1 then --Mage male 2 (HAT) /summoner female 2 (HAT)
        doPlayerAddOutfit(cid,491, 2)
                doPlayerAddOutfit(cid,432, 2)
end
if getPlayerStorageValue(cid,8470011) >= 1 then --summoner female 1 addon
        doPlayerAddOutfit(cid,432, 1)
end
if getPlayerStorageValue(cid,8470012) >= 1 then --Mage addon 1 male (VARINHA)
                doPlayerAddOutfit(cid,491, 1)
end
if getPlayerStorageValue(cid,8470013) >= 1 then --Warrior addon
                doPlayerAddOutfit(cid,440, 3)
                doPlayerAddOutfit(cid,443, 3)
end
if getPlayerStorageValue(cid,8470014) >= 1 then --Warrior addon
        doPlayerAddOutfit(cid,440, 3)
        doPlayerAddOutfit(cid,443, 3)
end
return true
end

 

addon.lua:
 

 

Spoiler

 

function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,8470002) <= 0 and item.itemid == 8495 then   --Citizen Outfit
        setPlayerStorageValue(cid,8470002, 3)
        doPlayerAddOutfit(cid,258, 3)
        doPlayerAddOutfit(cid,267, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of citizen outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470003) <= 0 and item.itemid == 8496 then   --Mage Outfit
        setPlayerStorageValue(cid,8470003, 3)
        doPlayerAddOutfit(cid,491, 3)
        doPlayerAddOutfit(cid,432, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of mage outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470004) <= 0 and item.itemid == 8497 then   --Knight Outfit
        setPlayerStorageValue(cid,8470004, 3)
        doPlayerAddOutfit(cid,261, 3)
        doPlayerAddOutfit(cid,270, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of knight outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470005) <= 0 and item.itemid == 8498 then   --Nobleman outfit
        setPlayerStorageValue(cid,8470005, 3)
        doPlayerAddOutfit(cid,329, 3)
        doPlayerAddOutfit(cid,297, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of nobleman outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470006) <= 0 and item.itemid == 8500 then  -- Summoner outfit
        setPlayerStorageValue(cid,8470006, 3)
        doPlayerAddOutfit(cid,316, 3)
        doPlayerAddOutfit(cid,339, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of summoner outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470007) <= 0 and item.itemid == 8499 then  -- Warrior outfit
        setPlayerStorageValue(cid,8470007, 3)
        doPlayerAddOutfit(cid,139, 3)
        doPlayerAddOutfit(cid,299, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of warrior outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470008) <= 0 and item.itemid == 8501 then  -- Druid outfit
        setPlayerStorageValue(cid,8470008, 3)
        doPlayerAddOutfit(cid,436, 3)
        doPlayerAddOutfit(cid,431, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of druid outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470009) <= 0 and item.itemid == 8502 then  -- Assassin outfit
        setPlayerStorageValue(cid,8470009, 3)
        doPlayerAddOutfit(cid,435, 3)
        doPlayerAddOutfit(cid,437, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of assassin outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470010) <= 0 and item.itemid == 8503 then  -- Golden outfit
        setPlayerStorageValue(cid,8470010, 3)
        doPlayerAddOutfit(cid,411, 3)
        doPlayerAddOutfit(cid,433, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of golden outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470011) <= 0 and item.itemid == 8327 then  -- Oriental
        setPlayerStorageValue(cid,8470011, 3)
        doPlayerAddOutfit(cid,414, 3)
        doPlayerAddOutfit(cid,434, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of oriental outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470012) <= 0 and item.itemid == 8328 then  -- Druid
        setPlayerStorageValue(cid,8470012, 3)
        doPlayerAddOutfit(cid,436, 3)
        doPlayerAddOutfit(cid,431, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of druid outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470013) <= 0 and item.itemid == 8329 then  -- Assassin
        setPlayerStorageValue(cid,8470013, 3)
        doPlayerAddOutfit(cid,435, 3)
        doPlayerAddOutfit(cid,437, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of assassin outfit.')
        doRemoveItem(item.uid, 1)
else
end
if getPlayerStorageValue(cid,8470014) <= 0 and item.itemid == 8330 then  -- Mage female outfit
        setPlayerStorageValue(cid,8470014, 3)
        doPlayerAddOutfit(cid,491, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received all addons of mage female outfit.')
        doRemoveItem(item.uid, 1)
else
end
return true
end

 

 

 

 

Editado por yuriowns (veja o histórico de edições)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo