Jump to content
  • 0

ROTD Icon Countdown


Question

Posted (edited)

I try to do this script and add a countdown timer on fakeicon. But when i logout and login, the counts start's again. I try everything but 0 solutions. Anyone can help me?

 

    OnInit:
     initnpctimer;
        set .timer,10800000;
      
        // min gm level
        set .gm_level,100;
    
        // monster race list
        setarray .rotd$[0],
            "Formless",
            "Undead",
            "Brute",
            "Plant",
            "Insect",
            "Fish",
            "Demon",
            "Demi Human",
            "Angel",
            "Dragon";

        setarray .rotdicon[0],
            1509,
            1502,
            1507,
            1500,
            1503,
            1501,
            1506,
            1504,
            1508,
            1505;

        set .rotd_size,getarraysize( .rotd$ );
        for( set .@i,0; .@i < .rotd_size; set .@i,.@i + 1 )
            set .rotd_menu$,.rotd_menu$ + .rotd$[.@i] +":";
        set .rotd_menu$,.rotd_menu$ + "^0055FFRandom Race^000000";
    
        set .today_rotd,5;
        set .rotd_exp_bonus,90;

        delwaitingroom;
        waitingroom .rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",0;
 
        // min party member lv to gain exp
        set .party_level_range,15;
end;

    // daily reset
    OnHour00:
    OnHour03:
    OnHour06:
    OnHour09:
    OnHour12:
    OnHour15:
    OnHour18:
    OnHour21:
       
        set .today_rotd,rand( .rotd_size );
        set .rotd_exp_bonus,rand( 10,100 );
        announce "[Race of the Day] : "+.rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",bc_all;
       

        delwaitingroom;
        waitingroom .rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",0;
        end;

    OnPCLoginEvent:
       fakeIcon(getcharid(0),.rotdicon[.today_rotd],.timer,1);
       end;

 

Edited by holdur

4 answers to this question

Recommended Posts

  • 0
Posted

you may try something like this


OnHour00:
OnHour03:
OnHour06:
OnHour09:
OnHour12:
OnHour15:
OnHour18:
OnHour21:
	.rotd_start_time = gettimetick(2);
	.today_rotd = rand( .rotd_size );
	.rotd_exp_bonus = rand( 10,100 );
	announce "[Race of the Day] : "+.rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",bc_all;
	delwaitingroom;
	waitingroom .rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",0;
	end;

OnPCLoginEvent:
	if (!.rotd_start_time) end;
	.@time_passed = gettimetick(2) - .rotd_start_time;
	fakeIcon(getcharid(0), .rotdicon[.today_rotd], (.timer - (.@time_passed * 1000)), 1);
	end;

 

  • 0
Posted

It is because of the 

    OnPCLoginEvent:
       fakeIcon(getcharid(0),.rotdicon[.today_rotd],.timer,1);
       end;

Every time you login its getting the icon. Its better to create custom SC for this.

  • 0
Posted
On 11/18/2023 at 11:17 AM, Emistry said:

you may try something like this


OnHour00:
OnHour03:
OnHour06:
OnHour09:
OnHour12:
OnHour15:
OnHour18:
OnHour21:
	.rotd_start_time = gettimetick(2);
	.today_rotd = rand( .rotd_size );
	.rotd_exp_bonus = rand( 10,100 );
	announce "[Race of the Day] : "+.rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",bc_all;
	delwaitingroom;
	waitingroom .rotd$[.today_rotd]+" +"+.rotd_exp_bonus+"% exp",0;
	end;

OnPCLoginEvent:
	if (!.rotd_start_time) end;
	.@time_passed = gettimetick(2) - .rotd_start_time;
	fakeIcon(getcharid(0), .rotdicon[.today_rotd], (.timer - (.@time_passed * 1000)), 1);
	end;

 

 

 

Hy Emistry

 

Can help-me?

 

image.png.189e3a3d877ff7256c9502684d879efd.png

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...