Jump to content
  • 0

Adding clans to battle_check_target


Tzuridis

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  06/19/12
  • Last Seen:  

I want to edit battle_check_target which determines who the player can attack.

As it is now:

 

battle_check_target

//which has these definitions set for it

    BCT_NOONE       = 0x000000, ///< No one
    BCT_SELF        = 0x010000, ///< Self
    BCT_ENEMY       = 0x020000, ///< Enemy
    BCT_PARTY       = 0x040000, ///< Party members
    BCT_GUILDALLY   = 0x080000, ///< Only allies, NOT guildmates
    BCT_NEUTRAL     = 0x100000, ///< Neutral target
    BCT_SAMEGUILD   = 0x200000, ///< Guildmates, No Guild Allies

    BCT_ALL         = 0x3F0000, ///< All targets

    BCT_WOS         = 0x400000, ///< Except self (currently used for skipping if src == bl in skill_area_sub)
    BCT_GUILD       = BCT_SAMEGUILD|BCT_GUILDALLY,  ///< Guild AND Allies (BCT_SAMEGUILD|BCT_GUILDALLY)
    BCT_NOGUILD     = BCT_ALL&~BCT_GUILD,           ///< Except guildmates
    BCT_NOPARTY     = BCT_ALL&~BCT_PARTY,           ///< Except party members
    BCT_NOENEMY     = BCT_ALL&~BCT_ENEMY,           ///< Except enemy
    BCT_ALLY        = BCT_PARTY|BCT_GUILD,
    BCT_FRIEND      = BCT_NOENEMY,
    BCT_CLAN        = BCT_SAMECLAN|BCT_CLANALLY ///< **What I added**

I added BCT_CLAN at the bottom which would reference these variables? int literals?

BCT_SAMECLAN    = 0x300000 or whatever it would be, ///< Clanmates
BCT_CLANALLY    = 0x280000, ///< Clan allies

The purpose is to add BCT_CLAN to the conditional which determines if a player can attack someone:

if( !state ) //If not an enemy, nor a guild, nor party, nor yourself, it's neutral.
        state = BCT_NEUTRAL;
    //Alliance state takes precedence over enemy one.
    else if( state&BCT_ENEMY && strip_enemy && state&(BCT_SELF|BCT_PARTY|BCT_GUILD|**BCT_CLAN**) )
        state&=~BCT_ENEMY;

    return (flag&state)?1:-1;
}

///> I also added the **BCT_CLAN**

My question is how would I go about finding out what those (0x000000) values are for the same clan and clan ally. How was this figured out for the BCT_GUILDALLY & BCT_SAMEGUILD?

Edited by Tzuridis
Link to comment
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.   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...