EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   Give another class's spell to a character? (https://www.eqemulator.org/forums/showthread.php?t=42041)

GreenManalishi 08-15-2018 05:01 PM

Give another class's spell to a character?
 
So say I am a Mage and I want to give myself Snare, is that hard to do? I can edit the db and I can find character_spells, but not sure what to do from there.

Randymarsh9 08-15-2018 05:54 PM

It is pretty easily, actually.

First of all, I'd recommend trying to edit it in EOC (on the homepage under resources). It gives a nice GUI that makes editing basically everything much easier.

If you want to modify it in the database yourself, find the spell id that you want to modify in spells_new and set the classes column for the class you want to give the spell to the level you want them to obtain it. So, if you want to give a mage a spell at level 5, set classes13 to 5 in spells_new for that spell id.

That will allow mages to use that spell on the server. You will likely have to update your client's spells_us file as well so that the client is aware of the change. I believe there are scripts to export that already.

Finally, if you're planning on using scrolls to learn spells, I believe you may have to edit the scroll to allow it to be usable by mages as well.

GreenManalishi 08-15-2018 10:24 PM

Thanks that helps a lot! Never even heard of that EOC, sounds promising. I would like to do more than just add a spell, I'd like to add more spell gems and make a custom class basically, but this is the first step :)

Splose 08-16-2018 12:01 AM

auto giving players mnemonic retention on their first login on event connect is a good way to do your spell gem idea

GreenManalishi 08-16-2018 12:06 AM

Thanks! I was trying to work out how to do that so went the mnemonic retention route too. I just couldn't figure out how to give it for free :D I tried to copy Origin but it wasn't working. I managed to give myself a new spell though :D Editting the DB was easy, but I had to trial and error the spells_us file which took a while. Also once I finally got it in the book, then memmed, and finally able to be cast, it crashed the game :D But I'll figure it out, I am gonna set up that EOC because it sounds far better. This is fun!

Splose 08-16-2018 01:24 AM

I'll post the code for you when I get off work in a few hours

Slaymore 08-16-2018 01:40 PM

Hi, GreenManalishi.
I was playing around with this idea as well. Check out this post.
http://www.eqemulator.org/forums/showthread.php?t=40603
It will set the classes() to have the spell set for all to the level that a class can first get the spell. For example cleric cHeal at 39 would be available to all classes at 39. I was unable to get to to work but was unaware about modifying the spell_us file. I will try again with that information.

Splose,
I am also interesting in that code for the extra spell slot, thanks in advance.

Splose 08-16-2018 05:23 PM

Depending on how many spell gems you want to give.

quests/global/global_player.pl
Code:

sub EVENT_CONNECT {
        if(!defined($qglobals{"SpellGem"}) {
                $client->IncrementAA(1071);        #:: Mnemonic Retention Rk. I
                #$client->IncrementAA(4764);        #:: Mnemonic Retention RK. II
                #$client->IncrementAA(7553);        #:: Mnemonic Retention RK. III
                #$client->IncrementAA(7681);        #:: Mnemonic Retention RK. IV
                $client->SetGlobal("SpellGem", 1, 5, "F");
        }
}


Slaymore 08-17-2018 01:04 AM

Thanks, Splose.
I think I get the first part, what does this
$client->SetGlobal("SpellGem", 1, 5, "F");
do? at level 1, 5 and 15?

Splose 08-17-2018 04:24 AM

Quote:

Originally Posted by Slaymore (Post 259747)
Thanks, Splose.
I think I get the first part, what does this
$client->SetGlobal("SpellGem", 1, 5, "F");
do? at level 1, 5 and 15?

This puts a flag on your character so this code only runs once for players who do not have the flag.

GreenManalishi 08-17-2018 10:28 AM

Thanks! That helps a lot.

GreenManalishi 08-20-2018 03:35 AM

Quote:

Originally Posted by Splose (Post 259738)
quests/global/global_player.pl
Code:

sub EVENT_CONNECT {
        if(!defined($qglobals{"SpellGem"}) {
                $client->IncrementAA(1071);        #:: Mnemonic Retention Rk. I
                #$client->IncrementAA(4764);        #:: Mnemonic Retention RK. II
                #$client->IncrementAA(7553);        #:: Mnemonic Retention RK. III
                #$client->IncrementAA(7681);        #:: Mnemonic Retention RK. IV
                $client->SetGlobal("SpellGem", 1, 5, "F");
        }
}


Got the spell part working, it is fun :D But I can't manage to give myself any new spell slots, I wonder if it is because I am low level. I tried editing level requirement and lots of stuff but still couldn't get it to work. I tried making the mneominc retention free and lots of stuff but nada. Also I am not sure where to put the code from above. Here is my (default) sub event, do I put it inside this?

Code:

sub EVENT_CONNECT {
    # the main key is the ID of the AA
    # the first set is the age required in seconds
    # the second is if to ignore the age and grant anyways live test server style
    # the third is enabled
    my %vet_aa = (
        481 => [31536000, 1, 1], ## Lesson of the Devote 1 yr
        482 => [63072000, 1, 1], ## Infusion of the Faithful 2 yr
        483 => [94608000, 1, 1], ## Chaotic Jester 3 yr
        484 => [126144000, 1, 1], ## Expedient Recovery 4 yr
        485 => [157680000, 1, 1], ## Steadfast Servant 5 yr
        486 => [189216000, 1, 1], ## Staunch Recovery 6 yr
        487 => [220752000, 1, 1], ## Intensity of the Resolute 7 yr
        511 => [252288000, 1, 1], ## Throne of Heroes 8 yr
        2000 => [283824000, 1, 1], ## Armor of Experience 9 yr
        8081 => [315360000, 1, 1], ## Summon Resupply Agent 10 yr
        8130 => [346896000, 1, 1], ## Summon Clockwork Banker 11 yr
        453 => [378432000, 1, 1], ## Summon Permutation Peddler 12 yr
        182 => [409968000, 1, 1], ## Summon Personal Tribute Master 13 yr
        600 => [441504000, 1, 1] ## Blessing of the Devoted 14 yr
    );
            my $age = $client->GetAccountAge();
    for (my ($aa, $v) = each %vet_aa) {
        if ($v[2] && ($v[1] || $age >= $v[0])) {
            $client->GrantAlternateAdvancementAbility($aa, 1);

        }
    }
}

I am not a coder so don't know where to fit it in.

Splose 08-20-2018 03:56 AM

This should be fine. Another thing to note is that anything with a "#" before it is commented out. So you will have to comment out the other 3 ranks if you want to give all 4 before any character is hit by this code.

Once it is hit once by this code it won't be hit again by it due to the flag. You will have to go into your quest_globals db table and delete the specific global for your charid if you need it to be ran multiple times.

Code:

sub EVENT_CONNECT {
        if(!defined($qglobals{"SpellGem"}) {
                $client->IncrementAA(1071);        #:: Mnemonic Retention Rk. I
                #$client->IncrementAA(4764);        #:: Mnemonic Retention RK. II
                #$client->IncrementAA(7553);        #:: Mnemonic Retention RK. III
                #$client->IncrementAA(7681);        #:: Mnemonic Retention RK. IV
                $client->SetGlobal("SpellGem", 1, 5, "F");
        }
    # the main key is the ID of the AA
    # the first set is the age required in seconds
    # the second is if to ignore the age and grant anyways live test server style
    # the third is enabled
    my %vet_aa = (
        481 => [31536000, 1, 1], ## Lesson of the Devote 1 yr
        482 => [63072000, 1, 1], ## Infusion of the Faithful 2 yr
        483 => [94608000, 1, 1], ## Chaotic Jester 3 yr
        484 => [126144000, 1, 1], ## Expedient Recovery 4 yr
        485 => [157680000, 1, 1], ## Steadfast Servant 5 yr
        486 => [189216000, 1, 1], ## Staunch Recovery 6 yr
        487 => [220752000, 1, 1], ## Intensity of the Resolute 7 yr
        511 => [252288000, 1, 1], ## Throne of Heroes 8 yr
        2000 => [283824000, 1, 1], ## Armor of Experience 9 yr
        8081 => [315360000, 1, 1], ## Summon Resupply Agent 10 yr
        8130 => [346896000, 1, 1], ## Summon Clockwork Banker 11 yr
        453 => [378432000, 1, 1], ## Summon Permutation Peddler 12 yr
        182 => [409968000, 1, 1], ## Summon Personal Tribute Master 13 yr
        600 => [441504000, 1, 1] ## Blessing of the Devoted 14 yr
    );
            my $age = $client->GetAccountAge();
    for (my ($aa, $v) = each %vet_aa) {
        if ($v[2] && ($v[1] || $age >= $v[0])) {
            $client->GrantAlternateAdvancementAbility($aa, 1);

        }
    }
}


GreenManalishi 08-20-2018 11:05 AM

Thank you :) <3


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

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