Guild Announcement after Emergency Call ready

caspe

New member
Messages
146
Points
0
Announcement after emergency call skill ready, also when EC skill used and try to use again it should show remaining time.

 
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.

 
Last edited by a moderator:
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.

 
Last edited by a moderator:
Thanks to @Myriad now emergency call show remaining time

Here is changes:

skill.c

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

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

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. 

 
Last edited by a moderator:
Back
Top