Jump to content
  • 0

Can we make NPC appear at certain time or date?


pojiejapan

Question


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

I have made a simple quest script. But I want it to be only available at certain day. For example monday and only for 12 hour. Is this possible?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  221
  • Reputation:   12
  • Joined:  12/18/11
  • Last Seen:  

Tested the script and works fine with some tiny changes:

The first line had spaces instead of tabs, so I erased them and made them into tabs.

Added one last right curly (Just like you said GenGen!).

*Note that you have to add the tabs yourself, it won't work If I post them here for some reason, they go back to spaces.*

Final copy:



prontera,150,168,2 script Mr.Monday 911,{
//=========================== Settings ====================================
set .@changername$,"[ ^FF0000 Mr.Monday ^000000]";// YOU MAY CHANGE THE NAME OF THE NPC
set .tcgid,7227;
set @tcgamount,1;
//======================= Settings End ====================================
//*************************************************************************

if (gettime(4)==1){
mes .@changername$;
mes "Hello "+strcharinfo(0)+" ,";
mes "What a wonderful day is today";
mes "Do you know that today is Monday?";
mes "Monday means Moon day, that's a fact.";
next;
mes "Hmm, Hey I got this unsual item ";
mes "when I was wandering around the ";
mes "wood It looks blackish in colour and it scared me.";
next;
switch(select("Do you still have it?:I got to go dude"))
{
case 1:
mes .@changername$;
mes "Sure but I don't have it right now";
mes "my brother have it,";
mes "I can tell you where my brother is but";
next;
switch(select("But what?:Cancel"))
{
case 1:
mes .@changername$;
mes "You have to help me find something";
mes "I really love a hat ^FF0000 Earmuff ^000000";
mes "can you find the material for me?";
next;
switch(select("I have it right now:Cancel"))
{
case 1:
mes .@changername$;
mes "Okay let me check if";
mes "you have the material..";
next;
mes .@changername$;
mes "Rustle... Rustle...";
next;
if((countitem(724) > 0) && (countitem(949) > 499) && (countitem(5001) > 0))
{
delitem 724,1;
delitem 949,500;
delitem 5001,1;
next;
mes .@changername$;
getitem .tcgid,@tcgamount; //Change to next Item!
mes "Here take this and see my big brother.";
mes "Mr. Tuesday, take this and he will talk to you.";
close;
}
else
{
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;

OnClock0000:
enablenpc "Mr.Monday";
end;

OnClock1200:
disablenpc "Mr.Monday";
end;
}

if(gettime(4)!=1){
disablenpc "Mr.Monday";
close;
}
}
}
[/codeBOX]

Edited by Keim
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

You have to use the label On<weekday><hour><minute>: and the command enablenpc().

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

Sir do I change I put it at the top of the script like this? :

On<weekday><hour><minute>: and the command enablenpc().


prontera,150,168,2 script Mr.Monday 911,{
//=========================== Settings ====================================
set .@changername$,"[ ^FF0000 Mr.Monday ^000000]";// YOU MAY CHANGE THE NAME OF THE NPC
set .tcgid,7227;
set @tcgamount,1;
//======================= Settings End ====================================
//*************************************************************************

On<Monday><12><00>: enablenpc()

mes .@changername$;
mes "Hello "+strcharinfo(0)+" ,";
mes "What a wonderful day is today";
mes "Do you know that today is Monday?";
mes "Monday means Moon day, that's a fact.";
next;
mes "Hmm, Hey I got this unsual item ";
mes "when I was wandering around the ";
mes "wood It looks blackish in colour and it scared me.";
next;
switch(select("Do you still have it?:I got to go dude"))
{
 case 1:
  mes .@changername$;
  mes "Sure but I don't have it right now";
  mes "my brother have it,";
  mes "I can tell you where my brother is but";
  next;
  switch(select("But what?:Cancel"))
  {
case 1:
 mes .@changername$;
 mes "You have to help me find something";
 mes "I really love a hat ^FF0000 Earmuff ^000000";
 mes "can you find the material for me?";
 next;
 switch(select("I have it right now:Cancel"))
 {
  case 1:
mes .@changername$;
mes "Okay let me check if";
mes "you have the material..";
next;
mes .@changername$;
mes "Rustle... Rustle...";
next;
if((countitem(724) > 0) && (countitem(949) > 499) && (countitem(5001) > 0))
{
 delitem 724,1;
 delitem 949,500;
 delitem 5001,1;
 next;
 mes .@changername$;
 getitem .tcgid,@tcgamount; //Change to next Item!
 mes "Here take this and see my big brother.";
 mes "Mr. Tuesday, take this and he will talk to you.";
 close;
}
else
{
 mes .@changername$;
 mes "Sorry you have to get the items first!";
 close;
}
  case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
 }
case 2:
 mes .@changername$;
 mes "Okay goodbye!";
 close;
  }
 case 2:
  mes .@changername$;
  mes "Okay goodbye!";
  close;
}
}

Edited by Arcenciel
Codeboxed
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

prontera,100,100,4 script LimitNPC 868,{
if (gettime(4)==1){ // 0-sunday , 1-monday , 2-tuesday......6-saturday
mes "[ LimitNPC ]";
mes "Today is Monday!!";
close;
}
OnInit:
disablenpc "LimitNPC";
end;

OnClock0000:
enablenpc "LimitNPC";
end;

OnClock1200:
disablenpc "LimitNPC";
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

sir vjreyz, can I just copy your script and combine it with my script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

in ur case, i think this should be work. havent tested yet. its recommended to test this script at offline server b4 launch it at offical /no1

http://pastebin.com/s9VBsCS7

please specify if there is any errors.

I think i missed 1 " } " at the last line. XDD

Edited by vjreyz
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...