Jump to content
  • 0

Reward on the Same map


Question

Posted (edited)

Greetings rAthena

Can i request this script that if only you can recieve the reward if you're on the same map as the MVP is killed

Spoiler

-    script    mvpdrop    -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
    if ( getcharid(1) ) {
        getpartymember getcharid(1), 1;
        getpartymember getcharid(1), 2;
            for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( !isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) // what happens if someone in the party member is offline =/
                    continue;
        getitem 6941, 2, $@partymemberaid[.@i];
        getitem 30027, 2, $@partymemberaid[.@i];
        }
        announce "Wow! A party named [ "+ strcharinfo(1) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3) +"! Awesome work guys!",bc_all,0x6666CC;
    }
    else {
        getitem 30027,2;
        getitem 6941,2;
        announce "Amazing! A lone wolf named [ "+ strcharinfo(0) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" himself at "+ strcharinfo(3) +"! Reckless, but still, good work!",bc_all,0x6666CC;
    }
}
end;
}

I thank you in advance

More power to rAthena

Edited by ValkRO

3 answers to this question

Recommended Posts

  • 0
Posted

Try

-   script mvpdrop -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
    if ( getcharid(1) ) {
        getpartymember getcharid(1), 1;
        getpartymember getcharid(1), 2;
        getmapxy(.@mapname$,.@mapx,.@mapy,UNITTYPE_PC);
            for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( !isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ||  // what happens if someone in the party member is offline =/
                    strcharinfo(3,$@partymembercid[.@i]) != .@mapname$ || // If the party member is not on the same map of the killer
                    checkidle(rid2name($@partymemberaid[.@i])) > 30 ) // If player is idle for 30 seconds
                    continue;
        getitem 6941, 2, $@partymemberaid[.@i];
        getitem 30027, 2, $@partymemberaid[.@i];
        }
        announce "Wow! A party named [ "+ strcharinfo(1) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3) +"! Awesome work guys!",bc_all,0x6666CC;
    }
    else {
        getitem 30027,2;
        getitem 6941,2;
        announce "Amazing! A lone wolf named [ "+ strcharinfo(0) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" himself at "+ strcharinfo(3) +"! Reckless, but still, good work!",bc_all,0x6666CC;
    }
}
end;
}

Just change the 30 on how many seconds before you can consider the character as AFK

  • 0
Posted (edited)

Try

-   script mvpdrop -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
    if ( getcharid(1) ) {
        getpartymember getcharid(1), 1;
        getpartymember getcharid(1), 2;
        getmapxy(.@mapname$,.@mapx,.@mapy,UNITTYPE_PC);
            for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( !isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ||  // what happens if someone in the party member is offline =/
                    strcharinfo(3,$@partymembercid[.@i]) != .@mapname$ ) // If the party member is not on the same map of the killer
                    continue;
        getitem 6941, 2, $@partymemberaid[.@i];
        getitem 30027, 2, $@partymemberaid[.@i];
        }
        announce "Wow! A party named [ "+ strcharinfo(1) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3) +"! Awesome work guys!",bc_all,0x6666CC;
    }
    else {
        getitem 30027,2;
        getitem 6941,2;
        announce "Amazing! A lone wolf named [ "+ strcharinfo(0) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" himself at "+ strcharinfo(3) +"! Reckless, but still, good work!",bc_all,0x6666CC;
    }
}
end;
}

 

Edited by Technoken
changed UNITYPE_PC to UNITTYPE_PC lol
  • Upvote 1
  • 0
Posted
On 2/6/2017 at 1:50 PM, Technoken said:

Try


-   script mvpdrop -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
    if ( getcharid(1) ) {
        getpartymember getcharid(1), 1;
        getpartymember getcharid(1), 2;
        getmapxy(.@mapname$,.@mapx,.@mapy,UNITTYPE_PC);
            for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( !isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ||  // what happens if someone in the party member is offline =/
                    strcharinfo(3,$@partymembercid[.@i]) != .@mapname$ ) // If the party member is not on the same map of the killer
                    continue;
        getitem 6941, 2, $@partymemberaid[.@i];
        getitem 30027, 2, $@partymemberaid[.@i];
        }
        announce "Wow! A party named [ "+ strcharinfo(1) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3) +"! Awesome work guys!",bc_all,0x6666CC;
    }
    else {
        getitem 30027,2;
        getitem 6941,2;
        announce "Amazing! A lone wolf named [ "+ strcharinfo(0) +" ] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" himself at "+ strcharinfo(3) +"! Reckless, but still, good work!",bc_all,0x6666CC;
    }
}
end;
}

 

Thank you  Technoken! Just one more request, please. the last thing it needs is an AFK checker. People in my server still found ways to abuse this system. Thank you so much in advance

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