• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Happyhour MOD

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
43
Releasing this script cuz the guy I bought it from offers no support and cant get it working for me so :p

I don't know what this is tested on.

Basicly you get extra exp at certain times that you can configure yourself!

Code:
<?xml version='1.0' encoding='UTF-8'?>
<mod name='HappyHours' version='1.0' author='Tomek/Xevis' contact='[email protected]' enabled='yes'>

    <config name='happyHoursConf'>
        <![CDATA[
            HH_STORAGE = 2327
            HH_EXTRA_EXP_PERCENT = 10
         
            DAYS = {
                ['Monday'] = {
                    {from = '16:00:00', to = '22:00:00'} 
                },
                ['Tuesday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Sunday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Wednesday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Thursday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Friday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Saturday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Sunday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                }
            }
         
        ]]>
    </config>

    <lib name='happyHoursLib'>
        <![CDATA[
            function doPlayerSetSkills(cid, value)
                for i = 0, 8 do
                    doPlayerSetRate(cid, i, value)
                end
            end

            function stopNewWorld()
                doSetStorage(HH_STORAGE, -1)

                for _, cid in ipairs(getPlayersOnline()) do
                    doPlayerSetSkills(cid, 1)
                end

                doBroadcastMessage('HappyHours ends! Rates back to normal.')
            end
        ]]>
    </lib>
 
    <globalevent name="happyHoursStop" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
         
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
         
            function onThink(interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for k, v in pairs(DAYS[os.date('%A')]) do
                        if isInArray(v.to, os.date('%X', os.time())) then
                                stopNewWorld()
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent> 
 
    <globalevent name="happyHoursStart" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
         
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
         
            function onThink(cid, interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for _, d in pairs(DAYS[os.date('%A')]) do
                        if isInArray(d.from, os.date('%X', os.time())) then
                            local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)

                            for _, cid in ipairs(getPlayersOnline()) do
                                doPlayerSetSkills(cid, newRate)
                            end
                         
                            doSetStorage(HH_STORAGE, 1)
                         
                            doBroadcastMessage('Happy Hours! Rates have changed to: ' .. newRate .. '! Rates will back to normal at ' .. d.to .. ' (server time). Have fun!!', MESSAGE_STATUS_WARNING)
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent>

    <event type='login' name='happyHoursLogin' event='script'>
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            function onLogin(cid)
                if getStorage(HH_STORAGE) == 1 then
                    local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)
                    doPlayerSetSkills(cid, newRate)
                    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'Happy Hours! Rates have changed to: ' .. newRate .. '! Have fun!!')
                end
                return true
            end
        ]]>
    </event>
</mod>
 
Very usefull script :D
But, i think there's a way to make the char have double exp forever, i'm not very advanced, but i think this way the error will fixed:

Code:
  function onLogin(cid)
  if getStorage(HH_STORAGE) == 1 then
  local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)
  doPlayerSetSkills(cid, newRate)
  doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'Happy Hours! Rates have changed to: ' .. newRate .. '! Have fun!!')
  else
  doPlayerSetSkills(cid, 1)
  end
  return true
  end
 
Releasing this script cuz the guy I bought it from offers no support and cant get it working for me so :p

I don't know what this is tested on.

Basicly you get extra exp at certain times that you can configure yourself!

Code:
<?xml version='1.0' encoding='UTF-8'?>
<mod name='HappyHours' version='1.0' author='Tomek/Xevis' contact='[email protected]' enabled='yes'>

    <config name='happyHoursConf'>
        <![CDATA[
            HH_STORAGE = 2327
            HH_EXTRA_EXP_PERCENT = 10
       
            DAYS = {
                ['Monday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Tuesday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Sunday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Wednesday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Thursday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Friday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Saturday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                },
                ['Sunday'] = {
                    {from = '16:00:00', to = '22:00:00'}
                }
            }
       
        ]]>
    </config>

    <lib name='happyHoursLib'>
        <![CDATA[
            function doPlayerSetSkills(cid, value)
                for i = 0, 8 do
                    doPlayerSetRate(cid, i, value)
                end
            end

            function stopNewWorld()
                doSetStorage(HH_STORAGE, -1)

                for _, cid in ipairs(getPlayersOnline()) do
                    doPlayerSetSkills(cid, 1)
                end

                doBroadcastMessage('HappyHours ends! Rates back to normal.')
            end
        ]]>
    </lib>

    <globalevent name="happyHoursStop" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
       
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
       
            function onThink(interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for k, v in pairs(DAYS[os.date('%A')]) do
                        if isInArray(v.to, os.date('%X', os.time())) then
                                stopNewWorld()
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent>

    <globalevent name="happyHoursStart" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
       
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
       
            function onThink(cid, interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for _, d in pairs(DAYS[os.date('%A')]) do
                        if isInArray(d.from, os.date('%X', os.time())) then
                            local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)

                            for _, cid in ipairs(getPlayersOnline()) do
                                doPlayerSetSkills(cid, newRate)
                            end
                       
                            doSetStorage(HH_STORAGE, 1)
                       
                            doBroadcastMessage('Happy Hours! Rates have changed to: ' .. newRate .. '! Rates will back to normal at ' .. d.to .. ' (server time). Have fun!!', MESSAGE_STATUS_WARNING)
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent>

    <event type='login' name='happyHoursLogin' event='script'>
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            function onLogin(cid)
                if getStorage(HH_STORAGE) == 1 then
                    local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)
                    doPlayerSetSkills(cid, newRate)
                    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'Happy Hours! Rates have changed to: ' .. newRate .. '! Have fun!!')
                end
                return true
            end
        ]]>
    </event>
</mod>



how to install this, plz
 
I tested it and it does not work.


It give no message when the time is correct.


And no exp is givien more!
 
Back
Top