Jump to content
  • 0

Is there a way to call a variable created in src from normal scripting?


Edwardlol

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

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? 

 

Thanks!

 


Bump, Still needed... !

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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