• 0
Sign in to follow this  
XrichiX

Skill clone

Question

como puedo crear una skill que tire un clon

 

how can I create a skill that pulls a clone

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

1.  what about the source part?

Does he clone the whole part of @clone into skill.c??  for that new custom skill??

Spoiler contain parts from atcommand.cpp ACMD_FUNC(clone) don't need to open!

Spoiler


// @clone/@slaveclone/@evilclone <playername> [Valaris]
ACMD_FUNC(clone)
{
    int x=0,y=0,flag=0,master=0,i=0;
    struct map_session_data *pl_sd=NULL;

    memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));

    if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
        clif_displaymessage(sd->fd,msg_txt(sd,1323)); // You must enter a player name or ID.
        return 0;
    }

    if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) {
        clif_displaymessage(fd, msg_txt(sd,3));    // Character not found.
        return 0;
    }

    if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
        clif_displaymessage(fd, msg_txt(sd,126));    // Cannot clone a player of higher GM level than yourself.
        return 0;
    }

    parent_cmd = atcommand_checkalias(command+1);

    if (strcmpi(parent_cmd, "clone") == 0)
        flag = 1;
    else if (strcmpi(parent_cmd, "slaveclone") == 0) {
        flag = 2;
        if(pc_isdead(sd)){
            clif_displaymessage(fd, msg_txt(sd,129+flag*2));
            return 0;
        }
        master = sd->bl.id;
        if (battle_config.atc_slave_clone_limit
            && mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) {
            clif_displaymessage(fd, msg_txt(sd,127));    // You've reached your slave clones limit.
            return 0;
        }
    }

    do {
        x = sd->bl.x + (rnd() % 10 - 5);
        y = sd->bl.y + (rnd() % 10 - 5);
    } while (map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10);

    if (i >= 10) {
        x = sd->bl.x;
        y = sd->bl.y;
    }

    if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, MD_NONE, flag?1:0, 0)) > 0) {
        clif_displaymessage(fd, msg_txt(sd,128+flag*2));    // Evil Clone spawned. Clone spawned. Slave clone spawned.
        return 0;
    }
    clif_displaymessage(fd, msg_txt(sd,129+flag*2));    // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
    return 0;
}

 

OFFtopic::

I have a question though,

why rathena or the eathena so long time and yet have not the file "Skill_avail.txt",

just like the item_avail.txt or mob_avail.txt??

so we can definitely clone skill and test 

eg.

Asura (original)

Asura (nerfed)

Asura (Buffed)

then test which one is the more like'd and then decide what to change in source.

 

Share this post


Link to post
Share on other sites
  • 0

the answer to this topic is OnPCUseSkillEvent
yes, many are broken, even mine in hercules plugin release also broken LOL

 

skill_avail ... that's an interesting suggestion
but due to the complexity of the skill database, I wonder how many field needed clone a skill ID
item_avail only needs 2, mob_avail can have up to 12, skill_avail .... hmmm ... lazy to count 😛

Share this post


Link to post
Share on other sites
  • 0

 

 

for example

how do I put that pull a clone instead of a mob

case KO_ZANZOU:
        if(sd){
            struct mob_data *md2;

            md2 = mob_once_spawn_sub(src, src->m, src->x, src->y, status_get_name(src), MOBID_ZANZOU, "", SZ_SMALL, AI_NONE);
            if( md2 )
            {
                md2->master_id = src->id;
                md2->special_state.ai = AI_ZANZOU;
                if( md2->deletetimer != INVALID_TIMER )
                    delete_timer(md2->deletetimer, mob_timer_delete);
                md2->deletetimer = add_timer (gettick() + skill_get_time(skill_id, skill_lv), mob_timer_delete, md2->bl.id, 0);
                mob_spawn( md2 );
                map_foreachinallrange(unit_changetarget, src, AREA_SIZE, BL_MOB, src, &md2->bl);
                clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
                skill_blown(src,bl,skill_get_blewcount(skill_id,skill_lv),unit_getdir(bl),BLOWN_NONE);
            }
        }
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this