Jump to content
  • 0
Sign in to follow this  
GmOcean

Guild Antagonist Support

Question

Okay, so following what was posted by Annieruru in another topic I added the changes needed to make players able to attack each other if their guild is listed as an antagonist guild for that said enemy. I also made a few changes to this:

 

/*====================================================* Player sd, asking player tsd a formal enemy relation between their 2 guilds*---------------------------------------------------*/int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd){    struct guild *g, *tg;    int i;    nullpo_ret(sd);    g=sd->guild;    tg=tsd->guild;    if(g==NULL || tsd==NULL)        return 0;    // Prevent creation opposition with same guilds [LuzZza]    if(sd->status.guild_id == tsd->status.guild_id)        return 0;    //Checks to antagonist count returns 0 if max.    if( guild->get_alliance_count(g,1) >= battle_config.max_guild_alliance )    {        clif->guild_oppositionack(sd,1);        return 0;    }    //Checks antagonist count of target guild, returons 0 if max.    if( guild->get_alliance_count(tg,1) >= battle_config.max_guild_alliance )    {        clif->guild_oppositionack(sd,1);        return 0;    }    for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations        if(g->alliance[i].guild_id==tsd->status.guild_id){            if (g->alliance[i].opposition == 1) { // check if not already hostile                clif->guild_oppositionack(sd,2);                return 0;            }            if(map->agit_flag || map->agit2_flag) // Prevent the changing of alliances to oppositions during WoE.                return 0;            //Change alliance to opposition.            intif->guild_alliance(sd->status.guild_id,tsd->status.guild_id,             sd->status.account_id,tsd->status.account_id,8);            //Change alliance to oppostion for Target Guild.            intif->guild_alliance(tsd->status.guild_id,sd->status.guild_id,                 tsd->status.account_id,tsd->status.account_id,8);        }    }    // inform other serv    intif->guild_alliance(sd->status.guild_id,tsd->status.guild_id,     sd->status.account_id,tsd->status.account_id,1);    // inform other serv for target guild    intif->guild_alliance(tsd->status.guild_id,sd->status.guild_id,         tsd->status.account_id,sd->status.account_id,1);    return 0;}

 

Which promptly checks to see if the "target" guild has a free slot in it's antagonist list, then if both the src & target guild have free slots, it will add them both to each other's antagonist list, and thusly inform each guild as well.

 

What I need help doing is editing the removal process. I can't seem to figure out how to make it so when Guild A removes Guild B from their list, Guild A needs to be removed from Guild B's list as well. But incidentally this isn't enough for what I need it to do.

I was trying to write 2 script commands that would do the following:

 

1. Add each guild to each other's Antagonist list. ( Still haven't figured out the best way of doing this without just directly copy + paste the code into a BUILDIN block ). I keep running into trouble when trying to find the information of the target guild. Especially since I don't know how to code this so it acts like a skill scroll, where you can click the target and it pulls the required information... @.@;

 

2. Remove each guild from each other's Antagonist list. ( I haven't started on this because I don't know how to do it through a patch yet, also in order for this command to be useful to my needs, I need to disable the possibility of guild leader's being able to remove them on their own ). <-- Is it even possible to remove the deletion option? I would assume I could remove the code block but would the player still have the option of Right Click -> Delete? I think that'd result in a crash D:

 

I am in need of help from the src masters i've seen recently... spread light on the darkness that clouds my tiny brain !!

Edited by GmOcean

Share this post


Link to post
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.   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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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