Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2009, 12:16 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Just a quick thought on how to implement this...

Code:
ScribeSpells(max_level, min_level = 1)
That way we default from 1 through max_level if we don't provide the second argument. So, to scribe spells for just level 71:

Code:
quest::scribespells(71, 71)
Should be pretty easy to implement in the server code. I haven't compiled or tested this, but this should do it:

Code:
Index: Y:/svn/trunk/EQEmuServer/zone/command.cpp
===================================================================
--- Y:/svn/trunk/EQEmuServer/zone/command.cpp	(revision 700)
+++ Y:/svn/trunk/EQEmuServer/zone/command.cpp	(working copy)
@@ -5694,7 +5695,7 @@
 
 void command_scribespells(Client *c, const Seperator *sep)
 {
-	int level;
+	uint8 max_level, min_level;
 	int16 book_slot;
 	int16 curspell;
 	Client *t=c;
@@ -5704,29 +5705,36 @@
 
 	if(!sep->arg[1][0])
 	{
-		c->Message(0, "FORMAT: #scribespells <level>");
+		c->Message(0, "FORMAT: #scribespells <max level> <min level>");
 		return;
 	}
 
-	level = atoi(sep->arg[1]);
+	max_level = (uint8)atoi(sep->arg[1]);
+	min_level = sep->arg[2][0] ? (uint8)atoi(sep->arg[2]) : 1;
 
-	if(level < 1)
+	if(max_level < 1)
 	{
 		c->Message(0, "ERROR: Enter a level greater than 1.");
 		return;
 	}
 
+	if (max_level < min_level) {
+		c->Message(0, "ERROR: Min Level can't be greater than Max Level.");
+		return;
+	}
+
 	t->Message(0, "Scribing spells to spellbook.");
 	if(t != c)
 		c->Message(0, "Scribing spells for %s.", t->GetName());
-	LogFile->write(EQEMuLog::Normal, "Scribe spells request for %s from %s, level: %d", t->GetName(), c->GetName(), level);
+	LogFile->write(EQEMuLog::Normal, "Scribe spells request for %s from %s (min level: %u, max_level: %u)", t->GetName(), c->GetName(), min_level, max_level);
 
 	for(curspell = 0, book_slot = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++)
 	{
 		if
 		(
 			spells[curspell].classes[WARRIOR] != 0 && // check if spell exists
-			spells[curspell].classes[t->GetPP().class_-1] <= level && 
+			spells[curspell].classes[t->GetPP().class_-1] <= max_level &&	//maximum level
+			spells[curspell].classes[t->GetPP().class_-1] >= min_level &&	//minimum level
 			spells[curspell].skill != 52
 		)
 		{

Index: Y:/svn/trunk/EQEmuServer/zone/perlparser.cpp
===================================================================
--- Y:/svn/trunk/EQEmuServer/zone/perlparser.cpp	(revision 700)
+++ Y:/svn/trunk/EQEmuServer/zone/perlparser.cpp	(working copy)
@@ -789,12 +789,16 @@
 XS(XS__scribespells)
 {
 	dXSARGS;
-	if (items != 1)
+	if (items < 1)
 		Perl_croak(aTHX_ "Usage: scribespells(spell_level)");
 
-	int	spell_level = (int)SvIV(ST(0));
+	uint8 max_level = (uint8)SvIV(ST(0));
+	uint8 min_level = (uint8)SvIV(ST(1));
 
-	quest_manager.scribespells(spell_level);
+	if (min_level)
+		quest_manager.scribespells(max_level, min_level);
+	else
+		quest_manager.scribespells(max_level);
 
 	XSRETURN_EMPTY;
 }

Index: Y:/svn/trunk/EQEmuServer/zone/questmgr.cpp
===================================================================
--- Y:/svn/trunk/EQEmuServer/zone/questmgr.cpp	(revision 701)
+++ Y:/svn/trunk/EQEmuServer/zone/questmgr.cpp	(working copy)
@@ -624,7 +624,7 @@
 	initiator->Kick();
 }
 
-void QuestManager::scribespells(int spell_level) {
+void QuestManager::scribespells(uint8 max_level, uint8 min_level = 1) {
  	//Cofruben:-Scribe spells for user up to his actual level.
 	int16 book_slot;
 	int16 curspell;
@@ -633,7 +633,8 @@
 	   if
 	   (
 		  spells[curspell].classes[WARRIOR] != 0 &&
-		  spells[curspell].classes[initiator->GetPP().class_-1] <= spell_level &&
+		  spells[curspell].classes[initiator->GetPP().class_-1] <= max_level &&	//maximum level
+		  spells[curspell].classes[initiator->GetPP().class_-1] <= min_level &&	//minimum level
 		  spells[curspell].skill != 52
 	   )
 	   {
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #2  
Old 07-08-2009, 07:35 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Did anybody test this and know if it works or not?
Reply With Quote
  #3  
Old 07-08-2009, 07:58 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

It works. Traindiscs wasn't working at first but that's been fixed now too. I haven't tested it extensively but from what I saw it did work.
Reply With Quote
  #4  
Old 07-08-2009, 08:03 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

how do i add that in to the source code? I've never messed with it before
Reply With Quote
  #5  
Old 07-08-2009, 08:25 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

If you compile your own source it's already in the latest revision. If you go off the binaries, I believe the latest binary has it included.
Reply With Quote
  #6  
Old 07-08-2009, 09:23 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

alright so to avoid messing with all my custom stuff, should I just recompile?
Reply With Quote
  #7  
Old 07-08-2009, 10:23 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You don't have to redo your entire DB every time that you update. Just make sure that you run the SQL updates in the /utils/sql/svn folder for all revisions after the o e you were already running.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:14 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 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3