Jump to content

Question

Posted (edited)

Hello everyone, I would like to make this script work in a specific map only can somebody help me? Thank you in advance!
 

Quote

-    script    hourly_point_main    -1,{
     OnInit:
        .npc_name$ = strnpcinfo(3);
        .reward_minutes = 60;
        bindatcmd("check", .npc_name$ + "::OnAtcommand");
        end;
 
    OnAtcommand:
        dispbottom("Accumulated " + #daily_minute_count);
        end;
 
    OnPCLoginEvent:
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");
        end;

    OnUpdate:
        deltimer(.npc_name$ + "::OnUpdate");
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");

        if (checkvending() & 2) {
            end;
        }

        #daily_minute_count += .reward_minutes;

        switch(#daily_minute_count) {
            case 60: // 60 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 120: // 120 minutes 
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 180: // 180 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 240: // 240 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 300: // 300 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 360: // 360 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 420: // 420 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480: // 480 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // reset.
                break;
            default:
                break;
        }
}

 

Edited by Sallycantdance

1 answer to this question

Recommended Posts

  • 0
Posted (edited)
5 hours ago, Sallycantdance said:

Hello everyone, I would like to make this script work in a specific map only can somebody help me? Thank you in advance!
 

 

-    script    hourly_point_main    -1,{
     OnInit:
        .npc_name$ = strnpcinfo(3);
        .reward_minutes = 60;
        .target_map$ = "prontera"; // Restrict to Prontera
        bindatcmd("check", .npc_name$ + "::OnAtcommand");
        end;
 
    OnAtcommand:
        dispbottom("Accumulated " + #daily_minute_count);
        end;
 
    OnPCLoginEvent:
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");
        end;

    OnUpdate:
        deltimer(.npc_name$ + "::OnUpdate");
        addtimer(.reward_minutes * 60000, .npc_name$ + "::OnUpdate");

        // Check if the player is in Prontera
        if (strcharinfo(3) != .target_map$) {
            end;
        }

        if (checkvending() & 2) {
            end;
        }

        #daily_minute_count += .reward_minutes;

        switch(#daily_minute_count) {
            case 60: 
            case 120: 
            case 180: 
            case 240: 
            case 300: 
            case 360: 
            case 420: 
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480:
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // Reset counter after 8 hours
                break;
        }
}

Features:

✅ Works only in Prontera (prontera map)
✅ Rewards every hour up to 8 hours
✅ Prevents vending abuse
✅ Resets counter after 8 hours

Edited by Paul

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