ewanjeli Posted January 4, 2013 Posted January 4, 2013 (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 January 5, 2013 by ewanjeli Quote
Emistry Posted January 4, 2013 Posted January 4, 2013 perhap you should try by first explain what your npc gonna do with the "expanded" area?? Quote
ewanjeli Posted January 4, 2013 Author Posted January 4, 2013 (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 January 4, 2013 by ewanjeli Quote
Emistry Posted January 4, 2013 Posted January 4, 2013 hmm ? this ? dicastes01,197,183,4 script Come here#sanctuary 742,7,7,{ Quote
ewanjeli Posted January 4, 2013 Author Posted January 4, 2013 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; Quote
Capuche Posted January 4, 2013 Posted January 4, 2013 <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 Quote
ewanjeli Posted January 4, 2013 Author Posted January 4, 2013 thx Capuche and Emistry... but still it dont heal char 3 cell from the npc Quote
Emistry Posted January 4, 2013 Posted January 4, 2013 distance(.@x,.@y, .npc_x,.npc_y) > 2 increase the value of 2 Quote
ewanjeli Posted January 4, 2013 Author Posted January 4, 2013 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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, 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 Quote
Question
ewanjeli
i want to expand the area 5x5 cell around npc to 15x15 cell
can someone explain....
Edited by ewanjeli8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.