Jump to content

add affect remove affect


Go to solution Solved by WeedHex,

Recommended Posts

hello, i wanted make align bonus- so if somebody take 5000 -9999 align and 10000 - 15000 and ..... he will have some bonus.. i have a function but i dont know where i should give this function, i tried some functiont but dont work properly

my function:

Quote

    if (GetRealAlignment() >= 5000 && GetRealAlignment() <= 9999 )
    {
        AddAffect(ALIGN_BON_1, POINT_MAX_HP, 100, 0, 31532121, 0, true);
    }
    
    if (GetRealAlignment() >= 10000 && GetRealAlignment() <= 14999 )
    {
        AddAffect(ALIGN_BON_2, POINT_MAX_HP, 200, 0, 31532121, 0, true);
    }
    
    
    if (FindAffect(ALIGN_BON_1) && GetRealAlignment() >= 10000 && GetRealAlignment() <= 4999 )
    {
            RemoveAffect(ALIGN_BON_1);
    }
    
    if (FindAffect(ALIGN_BON_2) && GetRealAlignment() >= 15000 && GetRealAlignment() <= 9999 )
    {
            RemoveAffect(ALIGN_BON_2);
    }

i  tried in function "entergame" but there dont work removeaffect , it doesnt remove any affect ingame and in fuction "computepoints" - there dont work add effect - kick in select interface.

Thanks for any help, ideas, support.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

12 hours ago, WeedHex said:

char_affect.cpp

load_affect_login_event

void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)

thanks its work almost, but ADD effect function work only if player have some affect already, so if he have 0 affects, it doesnt add him that aff what i wants do you have idea for that?

Link to comment
Share on other sites

  • 3 years later...
  • Active Member

Hello! My problem is I'm trying to make a mount bonus system in source. I succesfully add the bonuses (via affect), when I login I'm getting the bonuses, but after a relog/teleport it doubles itself. Do you guys have any idea how could I fix this?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.