EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Retain Spells on Death (https://www.eqemulator.org/forums/showthread.php?t=41035)

Meddera 11-23-2016 06:56 PM

Retain Spells on Death
 
I am new to all this and recently was able to get my server up and running but I have no idea how to make any changes. I would like to stop spells from disappearing from memory upon death. I found this in the forums but needed some help on where these file locations are and what I need to use to make changes?


Thanks in advance..



in the source, delete the following from attack.cpp:


Code:
if((GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
UnmemSpellAll(true);
else
UnmemSpellAll(false);

Delete from client.cpp:

UnmemSpellAll();

ghanja 11-23-2016 11:23 PM

Get either Navicat or HeidiSQL, to make database changes. I'm not sure if EOC allows changes to the rule_values table or not, but, if you're going to begin changing things, I'd recommend a DB editor either way.

Once you've done this and connected to your database (there is a plethora of material on how to do this around here), search for all "rule_name" column occurrences of

Code:

Character:RespawnFromHover
to "true" in the corresponding "rule_name" column.

Granted this changes other behavior, but, may be the fastest. Until a new rule is added, if it's added, to the binaries.

ghanja 11-24-2016 12:07 AM

This assumes you have DBI Perl installed (instructions are in the Wiki). And, it's by far untested (even for syntax, sorry away from my home PC for the holidays):

Code:

## global_player.pl

sub EVENT_TIMER {
        if ($timer eq "RecordCharacter") {
                RecordCharacterMemmedSpells($charid);
        }
}

sub EVENT_SAY {
        if ($text=~/#loadspells/i) {
                if (defined $qglobals{"memmedspells"}) {
                        LoadMemmedSpells();
                } else {
                        $client->Message(15, "You have no spell slots in custom memory!");
                }
        }
}

sub EVENT_CONNECT {
        LoadMemmedSpells() if (defined $qglobals{"memmedspells"});
        quest::settimer("RecordCharacter", 10);
}

sub LoadMemmedSpells {
        $client->UnmemSpellAll(1); ## just a sanity thing
        foreach my $i (0..9) { ## forget current maximum spell slots
                if (defined $qglobals{"memmedspellslot$i"}) {
                        $client->MemSpell($qglobals{"memmedspellslot$i"}, $i, 1);
                }
        }
}
       
sub RecordCharacterMemmedSpells {
        my $dbh = plugin::MySQL_Connect();
        my $sth = $dbh->prepare("
                                                                SELECT slot_id, spell_id
                                                                FROM character_memmed_spells
                                                                WHERE id = ?
                                                        ");
        $sth->bind_param(1,$_[0]);
        $sth->execute();
        if ($sth->rows() > 0) {
                quest::setglobal("memmedspells", 1, 5, "F");
                while (my @row = $sth->fetchrow_array()) {
                        quest::setglobal("memmedspellslot$row[0]", $row[1], 5, "F");
                }
        }
        $sth->finish();
        $dbh->disconnect();
}

(shrug) hopefully someone comes in and gives it a look over, second+ set of eyes never hurt.

*Edit: The code above is sort of moot now after having been enlightened by Kingly's post. But will leave it for those that like Perl.

Kingly_Krab 11-24-2016 12:16 AM

The code block is this:
Code:

if (RuleB(Character, UnmemSpellsOnDeath)) {
    if((ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && RuleB(Character, RespawnFromHover))
        UnmemSpellAll(true);
    else
        UnmemSpellAll(false);
}

Simply add a rule_values entry for Character:UnmemSpellsOnDeath and set it to false. I added this a while back, not sure how people don't know. :P

Here's the commit.

ghanja 11-24-2016 12:25 AM

Well. Damn. There you go. Follow the process in my first reply but instead "rule_name" of Character:UnmemSpellsOnDeath to a "rule_value" of false as Kingly stated.

Never was asked to enable/disable to go looking for it. However, it's not in the wiki (at the time of this post). ;)

http://wiki.eqemulator.org/p?Server_Rules

I'd add it and more, but, never got approved so, there ya go.

Meddera 11-24-2016 10:41 AM

Ok so I do have Heidi as I was able to figure out the GM designation with it, but still not sure how to use the program so its been slow going.

I just went to rules_values and clicked on data and scrolled to the very bottom and added

Character:UnmemSpellsOnDeath and set it to false. Do I need to change the ruleset ID? It defaults as zero. And is there anything else that needs to be done for this to work?


Thanks again.

Meddera 11-24-2016 10:53 AM

Ok I changed ruleset ID to 1 and it works!

Thanks guys! Happy Bird Day


All times are GMT -4. The time now is 10:32 PM.

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