Settings.lua changes won't take affect

Cyprus
Posts: 53
Joined: Sat Sep 06, 2014 10:54 pm

Re: Settings.lua changes won't take affect

Post by Cyprus » Sat Nov 08, 2014 8:35 am

Code: Select all

inline int32 CLuaBaseEntity::addBardSong(lua_State *L)
{
    DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL);

    DSP_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isuserdata(L, 1));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 2) || !lua_isnumber(L, 2));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 3) || !lua_isnumber(L, 3));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 4) || !lua_isnumber(L, 4));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 5) || !lua_isnumber(L, 5));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 6) || !lua_isnumber(L, 6));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 7) || !lua_isnumber(L, 7));
    DSP_DEBUG_BREAK_IF(lua_isnil(L, 8) || !lua_isnumber(L, 8));

    int32 n = lua_gettop(L);

    CLuaBaseEntity* PEntity = Lunar<CLuaBaseEntity>::check(L, 1);

    CStatusEffect * PEffect = new CStatusEffect(
        (EFFECT)lua_tointeger(L, 2),
        (uint16)lua_tointeger(L, 2),
        (uint16)lua_tointeger(L, 3),
        (uint16)lua_tointeger(L, 4),
        (uint16)lua_tointeger(L, 5),
        (uint16)lua_tointeger(L, 6),
        (uint16)lua_tointeger(L, 7),
        (uint16)lua_tointeger(L, 8));
    uint8 maxSongs = 2;
    if (PEntity && PEntity->m_PBaseEntity && PEntity->m_PBaseEntity->objtype == TYPE_PC){
        CCharEntity* PCaster = (CCharEntity*)PEntity->m_PBaseEntity;
        CItemWeapon* PItem = (CItemWeapon*)PCaster->getEquip(SLOT_RANGED);
        if (PItem == NULL || PItem->getID() == 65535 || !(PItem->getSkillType() == SKILL_STR || PItem->getSkillType() == SKILL_WND)){
            maxSongs = 1;
        }
        maxSongs += PCaster->getMod(MOD_MAXIMUM_SONGS_BONUS);
    }
    lua_pushboolean(L, ((CBattleEntity*)m_PBaseEntity)->StatusEffectContainer->ApplyBardEffect(PEffect, maxSongs));
    return 1;
}
Ok, just to make sure I don't mess anything up...I found 2 "maxSongs" of the addBardSong part of that file. I adjust the first one only right(the one that is valued at 2)? Am I correct to assume the other is for when someone subs Bard since you can only have 1 song then?

**EDIT: Cleaned up the copy/paste mess to prevent eye bleeding for any devs looking at it...
Last edited by Cyprus on Sat Nov 08, 2014 12:16 pm, edited 2 times in total.

Cyprus
Posts: 53
Joined: Sat Sep 06, 2014 10:54 pm

Re: Settings.lua changes won't take affect

Post by Cyprus » Sat Nov 08, 2014 8:48 am

Code: Select all

-----------------------------------------
-- Spell: Advancing March
-- Gives party members Haste
-----------------------------------------

require("scripts/globals/status");
require("scripts/globals/settings");

-----------------------------------------
-- OnMagicCastingCheck
-----------------------------------------

function OnMagicCastingCheck(caster,target,spell)
     return 0;
end;

-----------------------------------------
-- OnSpellCast
-----------------------------------------

function onSpellCast(caster,target,spell)
    local sLvl = caster:getSkillLevel(SKILL_SNG); -- Gets skill level of Singing
    local iLvl = caster:getWeaponSkillLevel(SLOT_RANGED);
    local power = 35;

    if (sLvl+iLvl > 200) then
        power = power + math.floor((sLvl+iLvl-200) / 7);
    end

    if (power >= 64) then
        power = 64;
    end

    local iBoost = caster:getMod(MOD_MARCH_EFFECT) + caster:getMod(MOD_ALL_SONGS_EFFECT);

    power = power + iBoost*16;

    if (caster:hasStatusEffect(EFFECT_SOUL_VOICE)) then
        power = power * 2;
    elseif (caster:hasStatusEffect(EFFECT_MARCATO)) then
        power = power * 1.5;
    end

    caster:delStatusEffect(EFFECT_MARCATO);

    local duration = 120 * ENHANCING_SONG_DURATION;

    duration = duration * ((iBoost * 0.1) + (caster:getMod(MOD_SONG_DURATION_BONUS)/100) + 1);

    if (caster:hasStatusEffect(EFFECT_TROUBADOUR)) then
        duration = duration * 2;
    end

    if not (target:addBardSong(caster,EFFECT_MARCH,power,0,duration,caster:getID(), 0, 1)) then
        spell:setMsg(75);
    end

    return EFFECT_MARCH;
end;
Just want to make sure this looks right in regards to enabling the settings.lua for song duration like we discussed before...just picked a random song as my example. I'm not positive if the require("scripts/globals/settings"); is in the correct place. I won't have a chance to go in & modify anything until tomorrow morning...just using the github to try & figure things out while at work so that I can be more productive with my limited time at home.

**EDIT: I just copied & pasted the code from the github & it removed the spacing when I did so. Thanks forgottenandlost for getting my squared away on whether I had things added in correctly & updating the script so it showed correctly. Updated the above to reflect this.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Settings.lua changes won't take affect

Post by kjLotus » Sat Nov 08, 2014 2:24 pm

yeah, you're right on both (mostly, it's not that you get 1 song for subbing brd, you get 1 song for not having an instrument equipped)

Cyprus
Posts: 53
Joined: Sat Sep 06, 2014 10:54 pm

Re: Settings.lua changes won't take affect

Post by Cyprus » Sat Nov 08, 2014 2:37 pm

Ah, ya your right...it's been so long since I played retail that I couldn't remember exactly why you could only have one song when subbing BRD, just knew it was true lol. Thanks again!

TGatlin2790
Posts: 40
Joined: Tue Aug 19, 2014 3:46 am

Re: Settings.lua changes won't take affect

Post by TGatlin2790 » Sun Nov 23, 2014 2:09 am

what do I need to put just to have up to Treasures of Aht Urhgan lite on the start screen?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Settings.lua changes won't take affect

Post by kjLotus » Sun Nov 23, 2014 2:15 am

login screen is controlled by login_config.conf, not settings.lua

TGatlin2790
Posts: 40
Joined: Tue Aug 19, 2014 3:46 am

Re: Settings.lua changes won't take affect

Post by TGatlin2790 » Sun Nov 23, 2014 2:26 am

I understand that, but all expansions are lit up on the start page, from what I understand you put 4096 bits to make them all light up, but what do I need it to say to have just up to Treasures lit up?

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: Settings.lua changes won't take affect

Post by Delaide » Sun Nov 23, 2014 2:42 am

Actually, you set it as 4094 for everything to light up. Not sure if that would make a different, but just wanted to mention it.

TGatlin2790
Posts: 40
Joined: Tue Aug 19, 2014 3:46 am

Re: Settings.lua changes won't take affect

Post by TGatlin2790 » Sun Nov 23, 2014 2:46 am

thats what i meant, just hit 6 instead of 4, lol

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Settings.lua changes won't take affect

Post by whasf » Mon Nov 24, 2014 4:13 pm

The bitmasks are explained in the config file, break out that windows calculator :)
-- Whasf

Post Reply