Jump to content

Question

Posted (edited)

Good Day..

I need some help in editing this script that I found... 

// https://rathena.org/board/topic/108246-hourly-points/ 
-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly",    .npc_name$ + "::OnCheck";
        end;
        
    OnClock0000:
        query_sql( "DELETE FROM acc_reg_num` WHERE `key` = '#reward' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " );
        addrid(0);
        #reward = -1;
        
    OnUpdate:
        deltimer .npc_name$+"::OnUpdate";
        #reward++;
        switch ( #reward ) {
            case 1:
                #reward += 1;
                break;
            case 2:
                #reward += 2;
                break;
            case 3:
                #reward += 3;
                break;
            case 4:
                #reward += 4;
                break;
            case 5:
                #reward += 5;
                break;
            default: break;
        }
        
    OnPCLoginEvent:
        if ( #reward < .max_hour ) {
            @timer = gettimetick(2) + .duration;
            addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
        }
        if ( #reward )    dispbottom "[ Hourly Rewards ] " + #reward + "/" + .max_hour + " hour" + ((#reward > 1)?"s":"") + " played!",0x9ae2d7;
        end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 -  Can someone remove the 12'o clock reset.. like it will automatically reset after the max hour..

 -  Show the total Reward Points you have as the player login in game..

 - For the hourly command, pls show how much more time to get the next reward.

 -  Can someone explain this part ... in every case how many points is added?

           case 1:
                #reward += 1;
                break;
            case 2:
                #reward += 2;
                break;
            case 3:
                #reward += 3;
                break;
            case 4:
                #reward += 4;
                break;
            case 5:
                #reward += 5;
                break;
            default: break;

Im planning to have it 10 points in the 1st hour.. 20 for 2hours 30 for 3hrs and so on

THANK YOU SO MUCH for those who will reply to this... 

Edited by MusiLiciouS

13 answers to this question

Recommended Posts

  • 1
Posted (edited)
15 hours ago, MusiLiciouS said:

Good Day..

I need some help in editing this script that I found... 

 -  Can someone remove the 12'o clock reset.. like it will automatically reset after the max hour..

 -  Show the total Reward Points you have as the player login in game..

 - For the hourly command, pls show how much more time to get the next reward.

...

-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Edited by Skorm
  • 0
Posted (edited)
On 3/5/2017 at 1:07 PM, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

hello @SkormSkorm can you add this suggestion im running my server official vip system

if the player has vip status the hourly points give more 50%

for normal players give 10,20,30,40 bla bla

vip player 15,30, bla bla

Edited by Bringer
  • 0
Posted
On 3/5/2017 at 1:07 PM, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Question Allows players who afk and pubbing to gain points except players who use @autotrade or Vending I see this script any one help me??

  • 0
Posted
On 3/22/2017 at 4:37 PM, Dev Blaze said:

Question Allows players who afk and pubbing to gain points except players who use @autotrade or Vending I see this script any one help me??

There are other hourly points scripts that prevent that. Like this one that I modified awhile ago.

http://upaste.me/66e5267563e64fefe

  • 0
Posted

@NakedWolf an Npc is a script there are different types for example this hourly points npc or script doesn't show on the server it's an invisible npc or script that triggers every hour and gives the player points 

  • Upvote 1
  • 0
Posted
On 4/5/2017 at 8:47 AM, MusiLiciouS said:

Will this script affect VIP Players? Like there's an additional 50% points for VIP Players.

...

-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        .vip_multi = 2;
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10 * ( vip_status(1) ? .vip_multi : 1 );
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

  • 0
Posted (edited)
8 hours ago, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        .vip_multi = 2;
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10 * ( vip_status(1) ? .vip_multi : 1 );
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Hello Sir i want to use your Hourly System
1.Please Remove the Max Hour
2.Vendor will stop the hourly system
4. additional 50% points for VIP Players. { DONE }

Edited by Bringer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...