Jump to content
  • 0

Hourly item rewards that need to click the npc to get it


MelMel

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Hello rathena,

 

can i please request for a script that work like this:

 

a npc that will only reward the player item id ex:9189 every one hour if they click them

and if it's not time yet they wont get the item even if they click the npc.

 

and same account character will not be able to get the item from the npc if they already get.

 

i really want them to click it to be able to get the item not automaticly like hourly point or hourly rewards.

 

thanks in advance

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

and same account character will not be able to get the item from the npc if they already get.

i really want them to click it to be able to get the item not automaticly like hourly point or hourly rewards.

//	~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function	script	timeleft__	{
	if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
	.@day = .@left / 86400;
	.@hour = .@left % 86400 / 3600;
	.@min = .@left % 3600 / 60;
	.@sec = .@left % 60;
	if ( .@day )
		return .@day +" day "+ .@hour +" hour";
	else if ( .@hour )
		return .@hour +" hour "+ .@min +" min";
	else if ( .@min )
		return .@min +" min "+ .@sec +" sec";
	else
		return .@sec +" sec";
}

prontera,150,165,5	script	Hourly reward	87,{
	if ( #hourly_timer > gettimetick(2) ) {
		mes "You must wait "+ callfunc( "timeleft__", #hourly_timer - gettimetick(2) ) +".";
		close;
	}
	mes "Here your hourly Item : x"+ .item_amount +" ^ff0000"+ getitemname( .item_ID );
	getitem .item_ID, .item_amount;
	#hourly_timer = gettimetick(2) + 3600;
	close;
OnInit:
	.item_ID = 501;
	.item_amount = 1;
	end;
}
  • Upvote 1
Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  04/01/13
  • Last Seen:  

On 5/9/2013 at 1:25 AM, icabit said:

try my attachment

i got this script way back in eathena days xD

works like a charm for me

it automatically gives the player the item

I tried it but it shown error

 

[Error]: quest_add: quest 61000 not found in DB.
[Debug]: Source (NPC): Hourly at prontera (159,187)
[Debug]: Function: setquest (1 parameter):
[Debug]: Data: number value=61000
[Error]: quest_add: quest 61000 not found in DB.
[Debug]: Source (NPC): Hourly at prontera (159,187)
[Debug]: Function: setquest (1 parameter):
[Debug]: Data: number value=61000
[Error]: quest_add: quest 61000 not found in DB.
[Debug]: Source (NPC): Hourly at prontera (159,187)
[Debug]: Function: setquest (1 parameter):
[Debug]: Data: number value=61000
[Error]: quest_add: quest 61000 not found in DB.
[Debug]: Source (NPC): Hourly at prontera (159,187)
[Debug]: Function: setquest (1 parameter):
[Debug]: Data: number value=61000
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Posted (edited) · Hidden by Capuche, May 9, 2013 - Duplicate post
Hidden by Capuche, May 9, 2013 - Duplicate post

sorry double post... please erase this. very sorry

Edited by MelMel
Link to comment

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  353
  • Reputation:   70
  • Joined:  07/14/12
  • Last Seen:  

try my attachment

i got this script way back in eathena days xD

works like a charm for me

it automatically gives the player the item

Edited by icabit
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

Try this;

-    script    hourlypoints    -1,{

//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
    
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1 || checkchatting() == 1) {
    dispbottom "The hourly points event stopped because you were vending / chatting. Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
//Check if Idle
getmapxy( .@map$, .@x, .@y, 0 );
if(@map$ == .@map$ && @x == .@x && @y == .@y) {
    set @afk, @afk + 1;
}
//If move timer resets
else {
    set @afk, 0;
}
    set @map$, .@map$; set @x, .@x; set @y, .@y;
//Idle Check for 5 Minutes
if(@afk == 5) {
    dispbottom "The hourly points event stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
end;

OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    set hourlypoints,hourlypoints+10;
    dispbottom "You received 10 Hourly Points by staying ingame for 1 hour";
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 6) {
    set @consecutive_hour,0;
    set hourlypoints,hourlypoints+10;
    dispbottom "You received 10 Hourly Points by staying ingame for consecutive of 6 hour";
    }
stopnpctimer;
initnpctimer;
end;

}

prontera,200,180,1	script	Hourly Points Trader	106,{
mes "Do you really want to trade your Points?";
menu "Yes",-,"No",Lno;
next;
if(pvppoints < 10) goto Lnenough;
mes "Here you go!";
set pvppoints,pvppoints-10;
getitem 7227,100;
close;

Lnenough:
mes "You do not have enough ^008800Hourly Points^000000.";
close;

Lno:
mes "Please decide.";
close;

}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/08/13
  • Last Seen:  

..

this work in rAthena only.. when i use eAthena version it does'nt work.. how?

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

..

Try this:

prontera,150,165,5	script	Hourly reward	87,{
	if ( #hourly_timer > gettimetick(2) ) {
		mes "You must wait "+ callfunc( "timeleft__",#hourly_timer-gettimetick(2) ) +".";
		close;
	}
	mes "Here your hourly Item : x"+ .item_amount +" ^ff0000"+ getitemname( .item_ID );
	getitem .item_ID, .item_amount;
	set #hourly_timer,gettimetick(2)+3600;
	close;
OnInit:
	set .item_ID,501;
	set .item_amount,1;
	end;
}
Edited by Capuche
Remove long evil quote to make the topic more readable
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Read Set

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/08/13
  • Last Seen:  

...

still didn't work ...

Edited by Capuche
Remove long evil quote to make the topic more readable
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

You must change the synthax in the function

http://rathena.org/wiki/Set

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/08/13
  • Last Seen:  

You must change the synthax in the function

http://rathena.org/wiki/Set

 

can you make that script for me please? because i'm nubie in script.. T_T

i want player to click the NPC and the npc Give the reward for player every 5 minutes..

here's my script.. work in rAthena but didn't work in eAthena.. 

 

//    ~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function    script    timeleft__    {
    if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
    .@day = .@left / 86400;
    .@hour = .@left % 86400 / 3600;
    .@min = .@left % 3600 / 60;
    .@sec = .@left % 60;
    if ( .@day )
        return .@day +" day "+ .@hour +" hour";
    else if ( .@hour )
        return .@hour +" hour "+ .@min +" min";
    else if ( .@min )
        return .@min +" min "+ .@sec +" sec";
    else
        return .@sec +" sec";
}
ra_temple,109,147,5    script    Hourly Reward    1247,{
    if ( #hourly_timer > gettimetick(2) ) {
        mes "You must wait "+ callfunc( "timeleft__", #hourly_timer - gettimetick(2) ) +".";
        close;
    }
    mes "Thanks For Coming :)";
    announce ""+strcharinfo(0)+" Telah Mengambil Reward Hourly",bc_all| bc_white;
    getitem 19999,1; // Die RO Sign
    getitem 675,1; // Mitrhil Coin
    #hourly_timer = gettimetick(2) + 300;
    close;
    
    end;
}
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Even a newbie can make this change... you're just lazy.

function	script	timeleft__	{
	set .@left, getarg(0);
	if ( .@left <= 0 ) return getarg(0);
	set .@day, .@left / 86400;
	set .@hour, .@left % 86400 / 3600;
	set .@min, .@left % 3600 / 60;
	set .@sec, .@left % 60;
	if ( .@day )
		return .@day +" day "+ .@hour +" hour";
	else if ( .@hour )
		return .@hour +" hour "+ .@min +" min";
	else if ( .@min )
		return .@min +" min "+ .@sec +" sec";
	else
		return .@sec +" sec";
}

prontera,150,165,5	script	Hourly reward	87,{
	if ( #hourly_timer > gettimetick(2) ) {
		mes "You must wait "+ callfunc( "timeleft__", #hourly_timer - gettimetick(2) ) +".";
		close;
	}
	mes "Thanks For Coming :)";
	announce ""+strcharinfo(0)+" Telah Mengambil Reward Hourly",bc_all| bc_white;
	getitem 19999,1; // Die RO Sign
	getitem 675,1; // Mitrhil Coin
	set #hourly_timer, gettimetick(2) + 300;
	close;
OnInit:
	set .item_ID, 501;
	set .item_amount, 1;
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/08/13
  • Last Seen:  

thanks capuche.. it's workk :)

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