Jump to content
  • 0
caspe

Guild Announcement after Emergency Call ready

Question

7 answers to this question

Recommended Posts

  • 0

Logically through a script, you could initnpctimer() and then message() the AID. But I don't know how to do that through source.

Edit: just skimming through some source, I think you can use a combination of timer->gettick() and something else to perform the time counter. Not sure about sending a msg to the guild leader though. I think you can achieve the GL ID through sql query, im not sure about the announcement part tho.
Edit2: sorry, i dont actually have meaningful contribution, just rambling. Apologies.

Edited by Myriad

Share this post


Link to post
Share on other sites
  • 0

Thanks to @Smoke I made a source edit which will send a clif->message stating how long until ecall can be used again.
Unfortunately I couldn't figure out how to send an announcement once the timer is up.

PM me on herc discord if you are interested.

Edited by Myriad

Share this post


Link to post
Share on other sites
  • 0

Thanks to @Myriad now emergency call show remaining time

Here is changes:

skill.c

Spoiler

In skill.c, find:
-------------------
    if (sd)
        guild->block_skill(sd,skill->get_time2(skill_id,skill_lv));

In case GD_EMERGENCYCALL:
-------------------
Change to
-------------------
    if (sd)
    {
        guild->block_skill(sd,skill->get_time2(skill_id,skill_lv));
        pc_setglobalreg(sd, script->add_str("RECALL_DELAY"), time(0) + 300);
    }

message.conf

Spoiler

In conf/message.conf, add your custom message
-------------------
CUSTOM_MSG_NUMBER: You cannot use Emergency Call for another %d seconds.

clif.c

Spoiler

Find:

--------------------------------------------------------------------

if( pc_issit(sd) )
        return;

if( skill->not_ok(skill_id, sd) )
        return;

--------------------------------------------------------------------

Add this code after first if

-----------------------------------------------------------------------

if (skill_id == GD_EMERGENCYCALL &&
        sd->state.gmaster_flag &&
        pc_readglobalreg(sd,script->add_str("RECALL_DELAY")) > time(0))
    {
        char output[100];
        sprintf(output, msg_txt(CUSTOM_MSG_NUMBER), (DIFF_TICK(pc_readglobalreg(sd,script->add_str("RECALL_DELAY")), time(0)))); // You cannot use Emergency Call for another %d seconds.
        clif->message(sd->fd, output);
        clif->message(sd->fd, "Emergency Call failed.");
        return;
    }

 

Everything working fine except one compilation warning

map\skill.c(8111): warning C4244: 'function': conversion from 'time_t' to 'int', possible loss of data

Can someone help me to fix that. :innocent: using latest hercules revision. 

Edited by caspe

Share this post


Link to post
Share on other sites

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

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.