Welcome to AC Web.
Results 1 to 12 of 12
  1. #1


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604

    Help on recreating these spells


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    I'm wondering if anyone knows where in the core to edit to create these spells. They're the pandaren racials and I'm trying to port them to 3.3.5a.





    I've looked through the SkyFire repo but I can't find the changes anywhere that allows for these spells to exist.

  2. #2
    for Epicurean go in unit.cpp and find void Unit::_ApplyAura(AuraApplication * aurApp, uint32 effMask) somewhere before applying the aura effect
    Code:
    if (aura->GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_FOOD_BUFF)
            {
                for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
                    if (aura->GetEffect(i))
                        aura->GetEffect(i)->SetAmount(aura->GetSpellInfo()->Effects[i].BasePoints * 2);
            }
    don't forget to check idk you can check if player is pandaren or check if player has aura Epicurean

    for Inner Peace go in player.cpp find uint32 Player::GetXPRestBonus(uint32 xp) and replace return rested_bonus with
    Code:
    return HasAura(aura_id) ? rested_bonus * 2 : rested_bonus;
    replace aura_id with Inner Peace not sure how you want this to be handled but you can replace HasAura with HasSpell

  3. #3
    Spelleffects/Attributes, darksoke solution also works

  4. #4


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604
    Quote Originally Posted by darksoke View Post
    for Epicurean go in unit.cpp and find void Unit::_ApplyAura(AuraApplication * aurApp, uint32 effMask) somewhere before applying the aura effect
    Code:
    if (aura->GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_FOOD_BUFF)
            {
                for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
                    if (aura->GetEffect(i))
                        aura->GetEffect(i)->SetAmount(aura->GetSpellInfo()->Effects[i].BasePoints * 2);
            }
    don't forget to check idk you can check if player is pandaren or check if player has aura Epicurean

    for Inner Peace go in player.cpp find uint32 Player::GetXPRestBonus(uint32 xp) and replace return rested_bonus with
    Code:
    return HasAura(aura_id) ? rested_bonus * 2 : rested_bonus;
    replace aura_id with Inner Peace not sure how you want this to be handled but you can replace HasAura with HasSpell
    How did you find these? I looked for hours... Thanks though

    Bonus: Do you know how to update the tooltip with the correct doubled stats?
    Last edited by Kobiesan; 01-10-2019 at 06:42 PM.

  5. #5


    Join Date
    Dec 2015
    Location
    Developing the world
    Posts
    1,120
    Quote Originally Posted by Kobiesan View Post
    How did you find these? I looked for hours... Thanks though

    Bonus: Do you know how to update the tooltip with the correct doubled stats?
    Tooltip about wut?

  6. #6


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604
    Quote Originally Posted by titkata_bg View Post
    Tooltip about wut?
    The well fed tooltip. With Epicurean it'll say +6 stamina when really it gives +12.

    - - - Updated - - -

    Also, that rest code isn't correctly updating the rest exp in the exp bar. Is that changed in the interface or core?

    - - - Updated - - -

    Think I found the proper solution to inner peace.

    In void Player::Update(uint32 p_time)
    Code:
    if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
        {
            if (roll_chance_i(3) && _restTime > 0)      // freeze update
            {
                time_t currTime = GameTime::GetGameTime();
                time_t timeDiff = currTime - _restTime;
                if (timeDiff >= 10)                             // freeze update
                {
                    _restTime = currTime;
    
                    float bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME);
                    if (HasSpell(90168)) // If player has Inner Peace give double rest exp
                        bubble *= 2;
                    float extraPerSec = ((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000.0f) * bubble;
    
                    // speed collect rest bonus (section/in hour)
                    float currRestBonus = GetRestBonus();
                    SetRestBonus(currRestBonus + timeDiff * extraPerSec);
                }
            }
        }
    Last edited by Kobiesan; 01-11-2019 at 02:39 AM.

  7. #7
    Quote Originally Posted by Kobiesan View Post
    How did you find these? I looked for hours... Thanks though

    Bonus: Do you know how to update the tooltip with the correct doubled stats?
    In order to update the tooltip you have to do what Andy said but i doubt in 3.3.5 there's an aura effect to update every stat at the same time. That why usually most scripted spells in wotlk have tooltips like "Greatly increase" , "Slightly increase" ....

    Quote Originally Posted by Kobiesan View Post
    The well fed tooltip. With Epicurean it'll say +6 stamina when really it gives +12.

    - - - Updated - - -

    Also, that rest code isn't correctly updating the rest exp in the exp bar. Is that changed in the interface or core?

    - - - Updated - - -

    Think I found the proper solution to inner peace.

    In void Player::Update(uint32 p_time)
    Code:
    if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
        {
            if (roll_chance_i(3) && _restTime > 0)      // freeze update
            {
                time_t currTime = GameTime::GetGameTime();
                time_t timeDiff = currTime - _restTime;
                if (timeDiff >= 10)                             // freeze update
                {
                    _restTime = currTime;
    
                    float bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME);
                    if (HasSpell(90168)) // If player has Inner Peace give double rest exp
                        bubble *= 2;
                    float extraPerSec = ((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000.0f) * bubble;
    
                    // speed collect rest bonus (section/in hour)
                    float currRestBonus = GetRestBonus();
                    SetRestBonus(currRestBonus + timeDiff * extraPerSec);
                }
            }
        }
    hell no :/ uint32 Player::GetXPRestBonus(uint32 xp) is the right way to do it cause that's the function returning the Rest XP bonus value

    you should also look into this GetRestBonus();

    Last edited by darksoke; 01-12-2019 at 03:20 PM.

  8. #8


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604
    Quote Originally Posted by darksoke View Post
    In order to update the tooltip you have to do what Andy said but i doubt in 3.3.5 there's an aura effect to update every stat at the same time. That why usually most scripted spells in wotlk have tooltips like "Greatly increase" , "Slightly increase" ....



    hell no :/ uint32 Player::GetXPRestBonus(uint32 xp) is the right way to do it cause that's the function returning the Rest XP bonus value

    you should also look into this GetRestBonus();

    Well, I tried both and neither are working.

  9. #9
    Quote Originally Posted by Kobiesan View Post
    Well, I tried both and neither are working.
    Be careful is RESTED XP not overall XP

  10. #10


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604
    Quote Originally Posted by darksoke View Post
    Be careful is RESTED XP not overall XP
    I tried this from Player::Update
    Code:
    if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
        {
            if (roll_chance_i(3) && _restTime > 0)      // freeze update
            {
                time_t currTime = GameTime::GetGameTime();
                time_t timeDiff = currTime - _restTime;
                if (timeDiff >= 10)                             // freeze update
                {
                    _restTime = currTime;
    
                    float bubble;
                    if (HasSpell(90168)) // If has Inner Peace give double rest exp.
                    {
                        bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME) * 2;
                    }
                    else
                    {
                        bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME);
                    }
                    float extraPerSec = ((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000.0f) * bubble;
    
                    // speed collect rest bonus (section/in hour)
                    float currRestBonus = GetRestBonus();
                    SetRestBonus(currRestBonus + timeDiff * extraPerSec);
                }
            }
        }
    and this from Player::LoadFromDB
    Code:
    if (time_diff > 0)
        {
            //speed collect rest bonus in offline, in logout, far from tavern, city (section/in hour)
            float bubble0;
            //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
            float bubble1;
            // If has Inner Peace give double rest exp.
            if (HasSpell(90168))
            {
                bubble0 = .062f;
                bubble1 = .25f;
            }
            else
            {
                bubble0 = 0.031f;
                bubble1 = 0.125f;
            }
            float bubble = fields[28].GetUInt8() > 0
                ? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY)
                : bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS);
    
            SetRestBonus(GetRestBonus() + time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000)*bubble);
        }
    And it's still not working. I also tried your solution but neither are correctly updating the client rest exp bar. I am inclined to believe it's somewhere in the interface that limits it's growth visually but I don't know where.

  11. #11

  12. #12


    Join Date
    Apr 2013
    Location
    twitch.tv/kobiesan
    Posts
    604

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by darksoke View Post
    Nothing in reputationframe.lua looks like what I need.
    Last edited by Kobiesan; 01-19-2019 at 08:11 PM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •