Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-23-2016, 06:56 PM
Meddera
Sarnak
 
Join Date: Nov 2016
Posts: 28
Default 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();
Reply With Quote
  #2  
Old 11-23-2016, 11:23 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

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.
Reply With Quote
  #3  
Old 11-24-2016, 12:07 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

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.

Last edited by ghanja; 11-24-2016 at 12:27 AM.. Reason: Moot now
Reply With Quote
  #4  
Old 11-24-2016, 12:16 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

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.
Reply With Quote
  #5  
Old 11-24-2016, 12:25 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

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.
Reply With Quote
  #6  
Old 11-24-2016, 10:41 AM
Meddera
Sarnak
 
Join Date: Nov 2016
Posts: 28
Default

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.
Reply With Quote
  #7  
Old 11-24-2016, 10:53 AM
Meddera
Sarnak
 
Join Date: Nov 2016
Posts: 28
Default

Ok I changed ruleset ID to 1 and it works!

Thanks guys! Happy Bird Day
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:50 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3