Hi guys, I'm creating a script that make the players use a progressbar before to equip something, I got this in clif.c:
/// Removes an ongoing progress bar (ZC_PROGRESS_CANCEL).
/// 02f2
void clif_progressbar_abort(struct map_session_data * sd)
{
int fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x2f2));
WFIFOW(fd,0) = 0x2f2;
WFIFOSET(fd,packet_len(0x2f2));
//This function only triggers by abort, not by finish
pc_setglobalreg( sd, "progressbar_abort", 1 ); //Whether the last progressbar aborted
clif_displaymessage(sd->fd,"No te has podido equipar.");
}
And I have this on script.c
BUILDIN_FUNC(progressbar)
{
struct map_session_data * sd = script_rid2sd(st);
const char * color;
unsigned int second;
//When starting a new progressbar, this will be set to zero
pc_setglobalreg( sd, "progressbar_abort", 0 );
if( !st || !sd )
return 0;
st->state = STOP;
color = script_getstr(st,2);
second = script_getnum(st,3);
sd->progressbar.npc_id = st->oid;
sd->progressbar.timeout = gettick() + second*1000;
clif_progressbar(sd, strtol(color, (char **)NULL, 0), second);
return SCRIPT_CMD_SUCCESS;
}
As you can see I got a player global function on my script.c and clif.c , is there a way to call that function in a npc to check if it fails or not?
Question
Edwardlol
Hi guys, I'm creating a script that make the players use a progressbar before to equip something, I got this in clif.c:
And I have this on script.c
As you can see I got a player global function on my script.c and clif.c , is there a way to call that function in a npc to check if it fails or not?
Thanks!
Bump, Still needed... !
Link to comment
Share on other sites
0 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.