EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Workaround for large race bash? (https://www.eqemulator.org/forums/showthread.php?t=42458)

Xanathol 05-20-2019 06:33 PM

Workaround for large race bash?
 
On TLPs, large races that get slam also get 2h bash out of the box. I'm trying to implement this via the global_player.pl file in the connect function but can't get it to fire (I've implemented some custom AAs here that do work but this is the only one race based). Here's the code, cut down to just the pertinent parts:

Code:

sub EVENT_CONNECT {
        # 2her bash
        if( $race == "Ogre" or $race == "Troll" or $race == "Barbarian" )
        {        $client->GrantAlternateAdvancementAbility(79, 1);
        }

        # class based custom AA
        if( $class == "Warrior" )
        {        $client->GrantAlternateAdvancementAbility(30200, 1);
        }
}

Simply put, the first one doesn't work but the class based one does.

Any ideas? Is it possible the $race global isn't being set and if so, what would be the work around (I tried $client->GetRace( ) on a whim but no-go).

Uleat 05-20-2019 09:13 PM

Try changing your equality operator from
Code:

==
to
Code:

eq
Use eq for strings and == for numbers.

Huppy 05-20-2019 09:55 PM

Things will differ between lua and perl, (for those who need the info), like this little clip example from the Priest of Discord, for the wiz/druid spells.

LUA
Code:

elseif((e.other:Class() == "Wizard" or e.other:Class() == "Druid")
Perl
Code:

elsif(($class eq "Wizard" || $class eq "Druid")

Xanathol 05-20-2019 10:23 PM

Thank gang but still not firing. :(
Code:

        if( $race eq "Ogre" || $race eq "Troll" || $race eq "Barbarian" )
        {        $client->GrantAlternateAdvancementAbility(79, 1);
        }


Update: afte adding in some statements here & there, it turns out there's nothing wrong with the comparison - the AA just won't grant (I get inside the if statement, just the AA doesn't come through). So that's that. :) Thanks folks.

Huppy 05-21-2019 12:54 AM

Technically, you don't need a script to assign an AA to specific classes or races. You can do that in the aa_ability table. Set races to 770 for Ogre, Troll and Barbarian. Then in aa_actions table (aaid entrry) set the rank to 0, then whatever reuse time, spell_id and target. In altadv_vars, set cost to 0, max level to 1. In aa_ranks set the cost to 0 and level_req to 1. After that, when an ogre, barbarian or troll login, they will have the option to purchase the AA for 0 cost. (I just tested all this out). I logged in other races and there was no AA for them to purchase.

Xanathol 05-21-2019 02:02 AM

Thanks I may try that. I'll have to code up a secondary 2 hand bash AA to do it though, since I was hijacking the knight on in my testing. I do like the autogrant btw - that way a user doesn't have to go look for it and buy it. Works well on my custom warrior aggro proc one. :)


All times are GMT -4. The time now is 01:09 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.