Jump to content
  • 0

need help on my script


Question

Posted (edited)

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

8 answers to this question

Recommended Posts

Posted (edited)

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
Posted

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;

Posted

<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

Posted

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

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