Jump to content
  • 0

ROTD Icon Countdown


Westin

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  10/25/12
  • Last Seen:  

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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   1
  • Joined:  03/27/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

find the fakeicon(..) script command  source mod and implement into your server

Link to comment
Share on other sites

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.

×
×
  • Create New...