• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [CreatureEvents] Error en Advance (New level effect)

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    lsenturion

    lsenturion
    Miembro
    Miembro
    Descripcion escribió:Buenas gentesita hermosa, Tengo este script:
    Código:
    --Script made by Pitufo/Haifurer, edited by figaro!
    local config = {
        [0] = { "Fist skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [1] = { "Club skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [2] = { "Sword skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [3] = { "Axe skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [4] = { "Distance skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [5] = { "Shield skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [6] = { "Fishing skill UP", 30}, -- 30 = variable[2]  -- Animation effect
        [7] = { "Magic level UP", 30}, -- 30 = variable[2]  -- Animation effect
        [8] = { "Level UP", 30} -- 30 = variable[2]  -- Animation effect
    }


    function onAdvance(cid, skill, oldlevel, newlevel)

    local pos = getPlayerPosition(cid)
    local effectPositions = {
    {x = pos.x, y = pos.y - 3, z = pos.z},
    {x = pos.x, y = pos.y + 3, z = pos.z},
    {x = pos.x - 3, y = pos.y, z = pos.z},
    {x = pos.x + 3, y = pos.y, z = pos.z},
    {x = pos.x - 2, y = pos.y - 2, z = pos.z},
    {x = pos.x + 2, y = pos.y - 2, z = pos.z},
    {x = pos.x + 2, y = pos.y + 2, z = pos.z},
    {x = pos.x - 2, y = pos.y + 2, z = pos.z}
    }

           
        for type, variable in pairs(config) do
            if newlevel > oldlevel then
                doCreatureSay(cid, ""..variable[1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
      for _, ePos in ipairs(effectPositions) do
          doSendDistanceShoot(pos, ePos, CONST_ANI_SMALLHOLY)
          doSendMagicEffect(ePos, CONST_ME_HOLYAREA)
                end

               
            end
        end   
    return TRUE
    end
    Pero no me funciona en mi servidor TFS 0.4 (No me arroja error en consola ni nada), Ya probe con el servidor TFS 0.3.7 y me funciono muy bien sin problema, tal vez sea por la version de TFS o algun problema en el login.lua o creaturescripts.xml... Pero me puse a comprobar si era eso y resulto que no.

    Aqui les dejo mi Login y Creaturescripts...

    Código:


    function onLogin(cid)
    local config = {
       loginMessage = getConfigValue('loginMessage'),
       useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
    }
       local loss = getConfigValue('deathLostPercent')
       if(loss ~= nil and getPlayerStorageValue(cid, "bless") ~= 5 and getPlayerLevel(cid) <= 100) then
          doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
          doPlayerAddBlessing(cid, 1)
          doPlayerAddBlessing(cid, 2)
          doPlayerAddBlessing(cid, 3)
          doPlayerAddBlessing(cid, 4)
          doPlayerAddBlessing(cid, 5)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[PROTECTED BY FREE BLESS TILL LEVEL 100]")
       end
       
       
       
       if getPlayerStorageValue(cid, 665) > 0 then
          doPlayerSendTextMessage(cid, 22, "You died in an unfair fight so your losses were reduced by " .. getPlayerStorageValue(cid, 665)  .. "%")
          doPlayerSetStorageValue(cid, 665, -1)
         end
       
       
    local welcomeText = "Welcome dear: " .. getCreatureName(cid) .. ".\n\n Our Kruda community welcomes you. \n We hope you have fun and have an amazing time.\n Have fun on Kruda!."
    local text = "Welcome dear " .. getCreatureName(cid) .. " to Kruda!. \n Dont forget to share Kruda with your friends. \n Donate now and support us!\n\nHave fun on Kruda!\n\n\n\nKruda Staff - #HailKruda."
    doPlayerSendTextMessage(cid, 22,  ""..text.."")

    if(getPlayerStorageValue(cid, 19622)) == -1 then
      doBroadcastMessage(""..welcomeText.."")
      doTeleportThing(cid, {x = 32369, y = 32241, z = 7})
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
      setPlayerStorageValue(cid, 19622, 1)
      return true
    end
    if getPlayerNobility(cid) >= 500 then
    setPlayerStorageValue(cid,65834, 1) -- AÑADE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VISCONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    end
    if getPlayerNobility(cid) >= 201 and getPlayerNobility(cid) <= 499 then
    setPlayerStorageValue(cid,65835, 1) -- AÑADE EL DUKE
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VISCONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    end
    if getPlayerNobility(cid) >= 101 and getPlayerNobility(cid) <= 200 then
    setPlayerStorageValue(cid,65836, 1) -- AÑADE EL MARQUIS
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VISCONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    end
    if getPlayerNobility(cid) >= 31 and getPlayerNobility(cid) <= 100 then
    setPlayerStorageValue(cid,65837, 1) -- AÑADE EL CONDE
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VISCONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    end
    if getPlayerNobility(cid) >= 21 and getPlayerNobility(cid) <= 30 then
    setPlayerStorageValue(cid,65838, 1) -- AÑADE EL VISCONDE
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    end
    if getPlayerNobility(cid) >= 10 and getPlayerNobility(cid) <= 20 then
    setPlayerStorageValue(cid,65839, 1) -- AÑADE EL LORD
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VIZCONDE
    return true
    end
    if getPlayerNobility(cid) <= 9 then
    setPlayerStorageValue(cid,65834, 0) -- REMUEVE EL KING
    setPlayerStorageValue(cid,65835, 0) -- REMUEVE EL DUKE
    setPlayerStorageValue(cid,65836, 0) -- REMUEVE EL MARQUES
    setPlayerStorageValue(cid,65837, 0) -- REMUEVE EL CONDE
    setPlayerStorageValue(cid,65838, 0) -- REMUEVE EL VIZCONDE
    setPlayerStorageValue(cid,65839, 0) -- REMUEVE EL LORD
    return true
    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
             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
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
       elseif(accountManager == MANAGER_ACCOUNT) then
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
       else
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
       end

       if(not isPlayerGhost(cid)) then
          doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
       end

       registerCreatureEvent(cid, "Mail")
       registerCreatureEvent(cid, "GuildMotd")

       registerCreatureEvent(cid, "Idle")
       if(config.useFragHandler) then
          registerCreatureEvent(cid, "SkullCheck")
       end

    registerCreatureEvent(cid, "moutaddon")
    registerCreatureEvent(cid, "AddonsStorage")
    registerCreatureEvent(cid, "LevelBroadcast")
    registerCreatureEvent(cid, "DeathBroadcast")
    registerCreatureEvent(cid, "attackguild")
    registerCreatureEvent(cid, "CheckTop")
    registerCreatureEvent(cid, "SummonDmg")
    registerCreatureEvent(cid, "TopEffect")
    registerCreatureEvent(cid, "EffectOutLogin")
    registerCreatureEvent(cid, "TopFrags")
    registerCreatureEvent(cid, "FimVip")
    registerCreatureEvent(cid, "FimVip2")
    registerCreatureEvent(cid, "VipCheck")
    registerCreatureEvent(cid, "RTopFrags")
    registerCreatureEvent(cid, "Tasks")
    registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "fraglook")
    registerCreatureEvent(cid, "demonOakLogout")
    registerCreatureEvent(cid, "demonOakDeath")
    registerCreatureEvent(cid, "PointSystem")
    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "PlayerKill")
    registerCreatureEvent(cid, "KillingInTheNameOf")
    registerCreatureEvent(cid, "PythiusDead")
    registerCreatureEvent(cid, "NpcAttack")
    registerCreatureEvent(cid, "zombieevent")
    registerCreatureEvent(cid, "UpAbsolute")

    if getPlayerVipDays(cid) >= 1 then
    doPlayerSetExperienceRate(cid, 2)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can receive 5,000,000 EXP every 24 hours using the command !vipexp")
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buy your VIP Ticket to receive +5,000,000 experience every 24 hrs and many more luxuries!!")
    end

        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)
       return true
    end
    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <creaturescripts>
    <event type="login" name="TopEffect" event="script" value="nobilityeffect.lua"/>
    <event type="advance" name="CheckTop" event="script" value="nobilityeffect.lua"/>
    <event type="cast" name="oseum" event="script" value="oseum.lua"/>
    <event type="cast" name="freezy" event="script" value="freezy.lua"/>
    <event type="cast" name="drake" event="script" value="drake.lua"/>
    <event type="cast" name="shazy" event="script" value="shazy.lua"/>
    <event type="login" name="moutaddon" event="script" value="mountaddon.lua"/>
    <event type="death" name="target" event="script" value="target.lua"/>
    <event type="death" name="celestial" event="script" value="celestial.lua"/>
    <event type="death" name="mezquivaal" event="script" value="mezquivaal.lua"/>
    <event type="death" name="sensei" event="script" value="sensei.lua"/>
    <event type="death" name="ancientprotector" event="script" value="ancientprotector.lua"/>
    <event type="death" name="amoniacport" event="script" value="amoniacport.lua"/>
    <event type="death" name="gleader" event="script" value="gleader.lua"/>
    <event type="death" name="ancientguardian" event="script" value="ancientguardian.lua"/>
    <event type="death" name="ancientspectre" event="script" value="ancientspectre.lua"/>
    <event type="death" name="ancientsoul" event="script" value="ancientsoul.lua"/>
    <event type="death" name="ancientpoltergeist" event="script" value="ancientpoltergeist.lua"/>

    <event type="login" name="offtrain_PlayerLogin" event="script" value="offlinetrain_login.lua"/>
    <event type="logout" name="offtrain_PlayerLogout" event="script" value="offlinetrain_logout.lua"/>

       <event type="look" name="fraglook" event="script" value="fraglook.lua"/>
        <event type="login" name="GetPoints" event="script" value="getpoints.lua" />
       <event type="statschange" name="SummonDmg" event="script" value="summondmg.lua"/>

       <event type="login" name="FimVip" event="script" value="fimvip.lua"/>
       <event type="login" name="FimVip2" event="script" value="fimvip2.lua"/>
       <event type="login" name="VipExp" event="script" value="vipexp.lua"/>
       <event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>

       <event type="moveitem" name="MoveItem" event="script" value="houseprotect.lua"/>

       <event type="login" name="EffectOutLogin" event="script" value="outfiteffects.lua"/>
       <event type="outfit" name="OutfitEffects" event="script" value="outfiteffects.lua"/>
       <event type="kill" name="TopFrags" event="script" value="topfrags.lua" />
       <event type="login" name="RTopFrags" event="script" value="topfrags.lua" />
       
       <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
       <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
       <event type="receivemail" name="Mail" event="script" value="mail.lua"/>
       <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
       <event type="think" name="Idle" event="script" value="idle.lua"/>
       <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
       <event type="death" name="PythiusDead" script="pythius_the_rotten.lua" />
       <event type="death" name="monster2" event="script" value="monster2.lua"/>
       <event type="death" name="inquisitionPortals" script="teleports_inquisition.lua"/>
       <event type="death" name="torturerport" event="script" value="torturerport.lua"/>
       <event type="death" name="demonport" event="script" value="demonport.lua"/>
       <event type="death" name="chompanokport" event="script" value="chompanokport.lua"/>
       <event type="death" name="neekoport" event="script" value="neekoport.lua"/>
       <event type="death" name="ireliaport" event="script" value="ireliaport.lua"/>
       <event type="death" name="krukenport" event="script" value="krukenport.lua"/>
       <event type="death" name="goddemonport" event="script" value="godemonport.lua"/>
       <event type="death" name="poseidonport" event="script" value="poseidonport.lua"/>
       <event type="death" name="colossalport" event="script" value="colossalport.lua"/>
       <event type="death" name="zeusport" event="script" value="zeusport.lua"/>
       <event type="login" name="AddonsStorage" event="script" value="addons.lua"/>
       <event type="death" name="gazdendriel" event="script" value="gazdendriel.lua"/>
       <event type="death" name="baziport" event="script" value="baziport.lua"/>
       <event type="death" name="braxorport" event="script" value="braxorport.lua"/>
       <event type="death" name="apokaxorport" event="script" value="apokaxorport.lua"/>
       <event type="death" name="satoxorport" event="script" value="satoxorport.lua"/>
       <event type="death" name="tuzaoxorport" event="script" value="tuzaoxorport.lua"/>
       <event type="death" name="morganaxorport" event="script" value="morganaxorport.lua"/>
       <event type="death" name="esmeraxorport" event="script" value="esmeraxorport.lua"/>
       <event type="death" name="godlexorport" event="script" value="godlexorport.lua"/>
       <event type="death" name="aztlanport" event="script" value="aztlanport.lua"/>
       <event type="death" name="xinethport" event="script" value="xinethport.lua"/>
       <event type="death" name="huitzyport" event="script" value="huitzyport.lua"/>
       <event type="death" name="azmenrakport" event="script" value="azmenrakport.lua"/>
       <event type="death" name="fossilport" event="script" value="fossilport.lua"/>
       <event type="death" name="volvport" event="script" value="volvport.lua"/>
       <event type="death" name="evilbunny" event="script" value="evilbunny.lua"/>
     
    <event type="statschange" name="zombieevent" event="script" value="zombieevent.lua"/>

       <event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
       <event type="advance" name="advance" event="script" value="advance.lua"/>
       <event type="kill" name="PlayerKill" event="script" value="arenakill.lua"/>
       <event type="death" name="inquisitionPortals" event="script" value="inquisitionPortals.lua"/>
       <event type="death" name="bluelegs" event="script" value="bluelegs.lua"/>
       <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
       <event type="attack" name="AttackGuild" script="attackguild.lua"/>
       <event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
       <event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/>
       <event type="death" name="Azerus" event="script" value="azerus.lua"/> 
       <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
          <event type="target" name="NpcAttack" event="script" value="npc.lua"/>
    </creaturescripts>
    Captura del Error escribió:Imagen del error: [CreatureEvents] Error en Advance (New level effect) Empty
    El error radica en: CreatureScript

    http://krudaserver.com

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).