Jump to content
  • 0

please EDIT my script ..


Diss

Question


  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  207
  • Reputation:   1
  • Joined:  05/01/13
  • Last Seen:  

hi guys !! anyone can fix this script

 

if can be the reward for this npc is random ex. gold, gold coin,etc

//===== rAthena Script =======================================
//= Ai Daily Gold Giver
//===== By: ==================================================
//= Jupeto ( [email protected] )
//===== Current Version: =====================================
//= 1.0.0
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: =========================================
//= Earn guild points by taking quests either item or mob hunt
//===== Additional Comments: =================================  
// 1.0.0 Release
//============================================================
prontera,156,182,2    script    Daily Gold    54,{
    function SYS_ConvertTime;
    
    set .@npcname$, "[Daily Gold]"; // NPC Name
    set .@itemid, 969; // Item ID to give ( 969 is Gold )
    set .@itemamount, 20; // Amount of item to give
    set .@timdelay, 86400; // Time delay a user can get golds, 86400 is one day in seconds.
    mes .@npcname$;
    mes "Hello there.";
    mes "I am a special gold dealer, who will give you " + .@itemamount + " " + ( ( .@itemamount > 1 ) ? "pieces" : "piece" ) + " of " + getitemname( .@itemid ) + " once per day.";
    next;
    mes .@npcname$;
    mes "Would you like to get your free " + .@itemamount + " " + ( ( .@itemamount > 1 ) ? "pieces" : "piece" ) + " of " + getitemname( .@itemid ) + " now?";
    next;
    if(select("Yes","No") == 2) {
         mes .@npcname$;
         mes "Ok, good bye then.";
         close;
    }
    if(TimedGold > gettimetick(2)) {
         mes .@npcname$;
         mes "I am sorry " + strcharinfo(0) + ", but you can only get " + .@itemamount + " " + ( ( .@itemamount > 1 ) ? "pieces" : "piece" ) + " of " + getitemname( .@itemid ) + " once per day.";
         next;
         mes .@npcname$;
         mes "You have to wait for " + SYS_ConvertTime( TimedGold - gettimetick(2) ) + " left";
         close;
    }
    mes .@npcname$;
    mes "Ok, here goes!";
    close2;
    getitem .@itemid,.@itemamount;
    set TimedGold, gettimetick(2) + .@timdelay;
    dispbottom "Daily Gold : Please be reminded that you may only get " + .@itemamount + " " + ( ( .@itemamount > 1 ) ? "pieces" : "piece" ) + " of " + getitemname( .@itemid ) + " once per day.";
    
    function SYS_ConvertTime
    {        
        set @time, getarg( 0 );
        set @time$, "";
        
        set @days, @time / 86400;
        set @hours, ( @time / 3600 ) - ( @days * 24 );
        set @minutes, ( @time / 60 ) - ( @days * 1440 ) - ( @hours * 60 );
        set @seconds, @time % 60;
        
        set @seconds$, @seconds + " second" + ( ( @seconds < 2 ) ? "" : "s" );
        set @minutes$, @minutes + " minute" + ( ( @minutes < 2 ) ? "" : "s" );
        set @hours$, @hours + " hour" + ( ( @hours < 2 ) ? "" : "s" );
        set @days$, @days + " day" + ( ( @days < 2 ) ? "" : "s" );
        
        set @time$, @days$ + " " + @hours$ + " " + @minutes$ + " and " + @seconds$;
        
        return @time$;
    }
}

 

thanks in advance !!

Edited by Capuche
To Code
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


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

Use F_RandMes function

getitem callfunc( "F_RandMes", 3, 1101, 1201, 1501 ),.@itemamount;

http://rathena.org/board/topic/78263-scripting-faqtipstricks/

for more infos

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  207
  • Reputation:   1
  • Joined:  05/01/13
  • Last Seen:  

Use F_RandMes function

getitem callfunc( "F_RandMes", 3, 1101, 1201, 1501 ),.@itemamount;

http://rathena.org/board/topic/78263-scripting-faqtipstricks/

for more infos

 

 

thanks sir its work ..

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