Jump to content
  • 0

need help on my script


ewanjeli

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  12/08/12
  • Last Seen:  

i want to expand the area 5x5 cell around npc to 15x15 cell

setarray .@dx[0], -1, 0, 1,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-1, 0, 1;
setarray .@dy[0], -2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2;

can someone explain....

Edited by ewanjeli
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

perhap you should try by first explain what your npc gonna do with the "expanded" area?? /hmm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  12/08/12
  • Last Seen:  

expanded area is for heal.. this is the script

this is not my script buut i need to edit it

dicastes01,197,183,4 script Come here#sanctuary 742,2,2,{
npctalk "Can you feel my healing powers?";
if (.npc_map$=="") donpcevent strnpcinfo(3)+"::OnInit";
end;

OnInit:
getmapxy .npc_map$,.npc_x,.npc_y, 1;
setarray .@dx[0], -1, 0, 1,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-1, 0, 1;
setarray .@dy[0], -2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2;
for (set .@i,0; .@i<getarraysize(.@dx); set .@i,.@i+1) {
  movenpc "sanctuary#"+.@i, .npc_x+.@dx[.@i], .npc_y+.@dy[.@i];
}
OnTimer10000:
specialeffect 83;
initnpctimer;
end;

OnTouch:
while (getmapxy(.@map$,.@x,.@y,0) == 0) {
 if (.npc_map$!=.@map$ || distance(.@x,.@y, .npc_x,.npc_y) > 2) break;
 if (Hp < MaxHp) {
percentheal 100,100;
  specialeffect2 312;
  sc_start SC_BLESSING,360000,5;
  sc_start SC_INCREASEAGI,360000,5;
 }
 sleep2 1000;
}
end;
}

Edited by ewanjeli
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

hmm ? this ?

dicastes01,197,183,4 script Come here#sanctuary 742,7,7,{

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  12/08/12
  • Last Seen:  

sorry Emistry,

but i dont understand what you mean by this?

but i need jus to expand this array to 15x15 cell

setarray .@dx[0], -1, 0, 1,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-1, 0, 1;
setarray .@dy[0], -2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2;

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{<code>}

TriggerX and triggerY, if given, will define an area, centered on NPC and

spanning triggerX cells in every direction across X and triggerY in every

direction across Y. Walking into that area will trigger the NPC. If no

'OnTouch:' special label is present in the NPC code, the execution will start

from the beginning of the script, otherwise, it will start from the 'OnTouch:'

label. Monsters can also trigger the NPC, though the label 'OnTouchNPC:' is

used in this case.

To expand the area for heal centered on the NPC, change

dicastes01,197,183,4 script Come here#sanctuary 742,2,2,{

to

dicastes01,197,183,4 script Come here#sanctuary 742,7,7,{

like Emistry said /ok

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  12/08/12
  • Last Seen:  

thx Capuche and Emistry...

but still it dont heal char 3 cell from the npc

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

distance(.@x,.@y, .npc_x,.npc_y) > 2

increase the value of 2

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  12/08/12
  • Last Seen:  

thx it Emistry work but i change something else too

setarray .@dx[0], -1, 0, 1,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-1, 0, 1;
setarray .@dy[0], -2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2;

to

setarray .@dx[0], -7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7,-7,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5, 5, 6, 7;
setarray .@dy[0], -7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7;

it done

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