Jump to content
  • 0

Script for a Mine NPC


c e d i e

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   0
  • Joined:  08/22/13
  • Last Seen:  

I would like to request for this kind of NPC. If any of you have time, just need some help.

 

NPC name: Mining Room

Mining Room(This is where I have to kill the mobs or the place where I will mine): dew_dun02 (Also, how can I disable players on warping direct to this map?)

 

Requires item before entering the room:

- Mine Hat [5031] (Need to be equipped when entering) *Mine hat doesn't need to be taken by npc. It just need to be equipped before the player can enter the room*

- 10 Old Pick [7318] *Will be lost when enter or will be taken by npc when the player enters the room.*

 

After killing 20 mobs inside the mining room(dew_dun02), he will be warped out of the room and back to the main town.

Berries are allowed inside.

 

I hope someone can help me with this. I really want to add this kind of mining room in my server. Please? :( Thanks in advance!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Also, how can I disable players on warping direct to this map?
Set dew_dun02 as nowarp mapflag.

 

Try this one : 

prontera,150,150,0    script    Mining Room    100,{
    set .@npc$, "[ " + strnpcinfo(1) + " ]";
    
    mes .@npc$;
    mes "Go to mining room requires you to have Mine Hat on your head and 10x Old Pick. So would you like to go?";
    next;
    
    if ( select("Yes:No") - 1 ) {
        mes .@npc$;
        mes "Come back when you are ready";
        close;
    }
    
    if ( countitem( 7318 ) < 10 || getequipid( EQI_HEAD_TOP ) != 5031 ) {
        mes .@npc$;
        mes "You do not follow my requirements";
        close;
    }
    
    mes .@npc$;
    mes "Bye bye!";
    close2;
    delitem 7318, 10;
    warp "dew_dun02",0,0;
    end;
}

-    script    Count    -1,{
    OnNPCKillEvent:
        if ( strcharinfo(3) != "dew_dun02") end;
        if ( Kills >= 20 ) {
            dispbottom "You have already killed 20 mobs";
            warp "prontera",150,150;
            set Kills, 0;
        } else set Kills, Kills + 1;
        end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   0
  • Joined:  08/22/13
  • Last Seen:  

 

Also, how can I disable players on warping direct to this map?
Set dew_dun02 as nowarp mapflag.

 

Try this one : 

prontera,150,150,0    script    Mining Room    100,{
    set .@npc$, "[ " + strnpcinfo(1) + " ]";
    
    mes .@npc$;
    mes "Go to mining room requires you to have Mine Hat on your head and 10x Old Pick. So would you like to go?";
    next;
    
    if ( select("Yes:No") - 1 ) {
        mes .@npc$;
        mes "Come back when you are ready";
        close;
    }
    
    if ( countitem( 7318 ) < 10 || getequipid( EQI_HEAD_TOP ) != 5031 ) {
        mes .@npc$;
        mes "You do not follow my requirements";
        close;
    }
    
    mes .@npc$;
    mes "Bye bye!";
    close2;
    delitem 7318, 10;
    warp "dew_dun02",0,0;
    end;
}

-    script    Count    -1,{
    OnNPCKillEvent:
        if ( strcharinfo(3) != "dew_dun02") end;
        if ( Kills >= 20 ) {
            dispbottom "You have already killed 20 mobs";
            warp "prontera",150,150;
            set Kills, 0;
        } else set Kills, Kills + 1;
        end;
}

 

Wow! You did it right sir! Thank you so much! (y)

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