Jump to content
  • 0

Emotion trigger


82558223

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  09/01/15
  • Last Seen:  

hello every body,I have an idea that make an emotion trigger.

the npc like this:

OnInit:
    defpattern 1, "([^:]+):.*\\s123.*", "talk";
    activatepset 1;
    end;

talk:

    npcskill "AB_HIGHNESSHEAL",100,130,175;

    percentheal 0,100;

 

I want to use emotion "help"  instead of  text "123".

So,how to make it..please..

Edited by 82558223
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1616
  • Joined:  03/26/12
  • Last Seen:  

Replace the regex with a pattern that will check for the word help. There are hundreds of guides on the Internet that can give you regex patterns.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

wrong answer @Akkarin /heh

he wants the npc script to trigger with emotion -> /help

not by typing "help"


this particular topic makes me interested ... its been a while since I do source modifications

BUILDIN_FUNC(emote_event) {
    int type = script_getnum(st,2);
    const char* event = NULL;
    TBL_PC *sd;
    if ( !script_rid2sd(sd) )
        return SCRIPT_CMD_SUCCESS;
    if ( type < ET_SURPRISE || type >= ET_MAX ) {
        ShowWarning( "buildin_emotion: Unknown emotion %d (min=%d, max=%d).\n", type, ET_SURPRISE, (ET_MAX-1) );
        return SCRIPT_CMD_FAILURE;
    }
    if ( script_hasdata(st,3) ) {
        event = script_getstr(st,3);
        check_event(st, event);
    }
    ShowDebug( "%s using emotion %d wanting to trigger '%s'", sd->status.name, type, event );
    return SCRIPT_CMD_SUCCESS;
}
	//    next step ... need to hook clif_parse_Emotion function ... erm ... this is not hercules LOL !!!

hahaha ... totally forgotten this is rathena forum !! (damn stayed at hercules too long)

 

ok I give up, if this member interested in switching to hercules than I might be interested to write a plugin


EDIT:

I just leave the steps here, just anyone interested in doing so ...

after this, need to edit clif.cpp file, find clif_parse_Emotion, if the emoticon == ET_HELP,

check if the player is in range with npc (see npc.cpp file ... didn't go in-depth yet) ...

if so then trigger the said event label (hardcoded-event label -> not using the script command version yet)

 

then ... hmm need to make the server remember all the emote_event script commands event labels... save them in an array or something ...

then change the hardcoded event label to trigger with the saved loop ...

well, quite a big modification if you ask me ...

 

or maybe I'm just still noob in source coding, maybe there are better ways to do this


edit to below ->

yup that's why I said I leave the steps here, I'm with the hercules anyways

surely some member here can finish this modification ................ if they are bored ... like me ~ /meh

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1616
  • Joined:  03/26/12
  • Last Seen:  

35 minutes ago, AnnieRuru said:

wrong answer @Akkarin /heh

he wants the npc script to trigger with emotion -> /help

not by typing "help"

I miss-read, that'll teach me to read the forums as soon as i wake up!

35 minutes ago, AnnieRuru said:

if this member interested in switching to hercules than I might be interested to write a plugin

There's no sense in switching to an emulator with less official content just to have a plugin written /ene

On a side note: You won't get tagged for Annie Ruru anymore, that account was banned a long time ago so I've removed it. Now you can have all of the @AnnieRuru tags :P 

  • Love 1
Link to comment
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.   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...