guys, can someone help me programming this callfunc
I'm trying to make a callfunc to use on an item
this item should heal the player and whoever is in the group (only if they are within a 10x10 area
I am still building, but I have a series of doubts and I am not able to get the id of the party members
function script F_HealGroup {
//members id
getpartymember(getcharid(CHAR_ID_PARTY), 1);
.@range= 10;
.@porcent = 50;
//map coordinate
getmapxy(.@m$,.@x,.@y,0);
//get user in area 10x10
.@count = getunits((BL_MOB | BL_PC), .@units, -1, .@m$, max(0, .@x - .@range), max(0, .@y - .@range), .@x + .@range, .@y + .@range);
// for the party member
for (.@i = 0; .@i < .@count; .@i++) {
dispbottom .@units[.@i]; //debug - print the user id
percentheal( .@porcent, .@porcent);
specialeffect(310, AREA, .@units[.@i] );
}
return;
}
I tried to get the idea with getpartymember (getcharid (CHAR_ID_PARTY), 1);
But I couldn't apply it in the code ... I also tried to use the areapercentheal ("map", x, y, x2, y2, hp, sp); but I couldn't apply it either ... Maybe it's even easier than the shape I'm trying to make.
I'm not very good with scripts.
guys, can someone help me programming this callfunc
I'm trying to make a callfunc to use on an item
this item should heal the player and whoever is in the group (only if they are within a 10x10 area
I am still building, but I have a series of doubts and I am not able to get the id of the party members
function script F_HealGroup { //members id getpartymember(getcharid(CHAR_ID_PARTY), 1); .@range= 10; .@porcent = 50; //map coordinate getmapxy(.@m$,.@x,.@y,0); //get user in area 10x10 .@count = getunits((BL_MOB | BL_PC), .@units, -1, .@m$, max(0, .@x - .@range), max(0, .@y - .@range), .@x + .@range, .@y + .@range); // for the party member for (.@i = 0; .@i < .@count; .@i++) { dispbottom .@units[.@i]; //debug - print the user id percentheal( .@porcent, .@porcent); specialeffect(310, AREA, .@units[.@i] ); } return; }
I tried to get the idea with getpartymember (getcharid (CHAR_ID_PARTY), 1);
But I couldn't apply it in the code ... I also tried to use the areapercentheal ("map", x, y, x2, y2, hp, sp); but I couldn't apply it either ... Maybe it's even easier than the shape I'm trying to make.
I'm not very good with scripts.
Share this post
Link to post
Share on other sites