Jump to content
  • 0

PCRE npc cell


Lelouch vi Britannia

Question


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   84
  • Joined:  01/05/12
  • Last Seen:  

can you help me with this script about PCRE .coz i want a script that activate's PCRE within the npc's range of 5 or 6 cells

here's my example of a npc with PCRE script

prontera,156,184,4 script Unknown Creature 999,{
mes "Welcome come stranger!!";
close;

Cash:
switch(rand(4)) {
  case 1:
 npctalk "What? i can't hear you stranger";
 break;

  case 2:
 npctalk "Cash? you want cash stranger? are you really sure you like?";
 set Zeny,zeny+1;
 next;
 npctalk "Here ya go stranger.Enjoy!!";
 break;

  case 3:
 npctalk "Lol!!";
 break;

  case 4:
 npctalk "Don't mess with me stranger";
 break;
}
Idiot:
switch(rand(3)) {
  case 1:
 npctalk "Die scumbag";
 percenteahl -100,-100;
 break;

  case 2:
 npctalk "Your a F*%#@*& N!@#%";
 percenteahl -100,-100;
 break;

  case 3:
 npctalk "...";
 break;
}
OnInit:
 defpattern 1, "([^:]+):.*sgive me cash*", "Cash";
 defpattern 1, "([^:]+):.*sidiot*", "Idiot";
 activatepset 1;
 end;
}

Ops!! i think i posted in a wrong section i think this is should be in request >.< gomen gomen

Edited by Lelouch
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   105
  • Joined:  11/19/11
  • Last Seen:  

cash:
getmapxy .@map$, .@x, .@y, 0;
getmapxy .@map$, .@x1, .@y1, 1;
if ( distance( .@x, .@y, .@x1, .@y1 ) > 5 ) end;

Idiot:
getmapxy .@map$, .@x, .@y, 0;
getmapxy .@map$, .@x1, .@y1, 1;
if ( distance( .@x, .@y, .@x1, .@y1 ) > 6 ) end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   84
  • Joined:  01/05/12
  • Last Seen:  

arigatou QQfoolsorellina-san ,ive tested it now and its working pretty fine now /lv;):)/omg

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