EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Feature Requests (https://www.eqemulator.org/forums/forumdisplay.php?f=612)
-   -   scribespell for one level (https://www.eqemulator.org/forums/showthread.php?t=28606)

Randymarsh9 06-17-2009 09:13 AM

scribespell for one level
 
My server is meant to be legit, so I don't let people scribespells. I made a quest to give 66-70 spells that has taken me forever, so I was wondering a command to scribespells for just one level could be used, so it wouldn't give all spells.

Randymarsh9 06-17-2009 02:18 PM

Let me clarify, it was 3 A.M. when I posted that. I finished the 66-70 spells quest, but now I want people to be able to acquire 71+ spells. I think a very easy way to do this would be adding a quest command to scribspells for just level 71 or 72, so then it would still mean spending time on lower level spell quests would still be useful and I wouldn't have to invest the weeks making a quest to give spells one at a time like I did for 66-70.

Randymarsh9 06-24-2009 05:00 PM

Does anyone think this can be done?

ChaosSlayerZ 06-24-2009 06:37 PM

personaly I don't use scribe command, cuase my server is also ultra legit and the only true way to scribe a spell is to get the scroll =)

BUT overall scribe command could use little enhancement, and not just by specific level, but by specific spell ID too.

trevius 06-24-2009 11:30 PM

Scribing spells for just 1 level or for a range of specified levels is something I have been meaning to setup for a while. I just have a hard time finding time to get everything in that I want to do :P I will probably add that in once I am able to get qglobal requirements added into the spells table. By that, I mean giving an option to set a qglobal in the spells_new table that will require the player to have that same global in order to scribe that particular spell.

I don't have any plans to add in single spell ID scribing, though I thought there might already be a quest function for that. IMO, if you want to do single spells, the actual scrolls are probably the best way to do it.

Randymarsh9 06-24-2009 11:39 PM

That sounds great. I've been working on an incredibly long quest that has an npc take an item and build up that persons credit which they can use to purchase specific 66-70 spells. It has taken me forever to do and I don't really feel like doing it all again, lol

Kayen 06-25-2009 12:51 PM

ScribeSpell(spell_id, slot, update_client= true)

I think i have tested this and it works.

Yeormom 06-25-2009 02:16 PM

Rather than setting the slot, you should actually pull that using the next available slot function just before you assign the spell to that book slot. One less variable to chase.

ChaosSlayerZ 06-25-2009 02:46 PM

btw one of the problem with scribespell is that it overwrites any custom placing of spells in the spell book. It simple starts writing from first spell slot and on, ignoring if I allreday have something in there, some times resultign in double, triple or even 8x writings of the same spell.

one of the reason I don't use it at all =)

AndMetal 06-28-2009 12:16 AM

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
            )
            {


Randymarsh9 07-08-2009 07:35 PM

Did anybody test this and know if it works or not?

Zeice 07-08-2009 07:58 PM

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.

Randymarsh9 07-08-2009 08:03 PM

how do i add that in to the source code? I've never messed with it before

Zeice 07-08-2009 08:25 PM

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.

Randymarsh9 07-08-2009 09:23 PM

alright so to avoid messing with all my custom stuff, should I just recompile?

trevius 07-08-2009 10:23 PM

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.

Randymarsh9 07-09-2009 12:17 AM

so what rev is this in? I updated everything but I didn't see anything talking about scribespells

trevius 07-09-2009 03:16 AM

AndMetal put it in on R732:

Quote:

==07/01/2009==
AndMetal: quest::scribespells can now accept minimum level as a 2nd argument. Examples: quest::scribespells(60,60) will scribe just level 60 spells, quest::scribespells(75,71) will scribe spells from 71 through 75.
AndMetal: Ditto with #scribespells, quest::traindiscs, & #traindiscs.
AndMetal: quest::scribespells & quest::traindiscs will now return the amount of spells/disciplines that were scribed/learned (an optional way to verify success or failure).
AndMetal: #scribespells & #traindiscs will limit the max level to whatever the rule Character:MaxLevel is set to, unless you have GM Mode turned on, in which case it's limited to 255 (uint8).

Randymarsh9 07-09-2009 11:56 AM

that's odd. I updated all of the things and restarted my server but the quest and command both don't work.

Randymarsh9 07-09-2009 12:16 PM

For the Rev732 one it just says
Code:

INSERT INTO `rule_values` VALUES ('1', 'Spells:SacrificeMinLevel', '46', 'First level Sacrifice will work on');
INSERT INTO `rule_values` VALUES ('1', 'Spells:SacrificeMaxLevel', '69', 'Last level Sacrifice will work on');
INSERT INTO `rule_values` VALUES ('1', 'Spells:SacrificeItemID', '9963', 'Item ID of the item Sacrifice will return. Defaults to an Essence Emerald.');


gaeorn 07-09-2009 12:32 PM

The SQL update, if any, doesn't define what code changes may or may not have been implemented in a revision. AndMetal happened to also include sacrifice changes into the same revision.

When you say the command doesn't work, are you getting an error message? Is it silently not behaving as desired? What exactly do you mean by it doesn't work?

I reviewed the code for the command #scribespells and it appears it should function correctly.

Shendare 07-09-2009 12:34 PM

It appears to work properly for me.

For testing purposes, I recently created a mage, did a #level 75, then used #scribespells to get just 71-75 spells.

Randymarsh9 07-09-2009 12:35 PM

well I did #scribespells 70, 65 #scribespells (70, 65) and then in a quest I had #quest::scribespells (70,65) and none of those worked

Shendare 07-09-2009 12:37 PM

Just for clarification, in case it's a punctuation issue you're running into, the #scribespells command must be entered exactly as follows:

#scribespells 70 65

No parentheses or commas.

The quest::scribespells function should be called exactly as follows:

Code:

sub EVENT_SAY
{
  quest::scribespells(70,65);
}

No # symbol before 'quest' or space before the parenthesis, and followed by a semicolon.

Randymarsh9 07-09-2009 12:41 PM

It just scribes my spells from 1-70 no matter what

Shendare 07-09-2009 12:48 PM

Then it sounds like you're still running an old version of the server.

After compiling the newer rev, did you copy the new .exe files from the source code's Build directory to your server's main EQEmu directory?

Randymarsh9 07-09-2009 12:58 PM

no i did not

Shendare 07-09-2009 01:29 PM

After doing a recompile, the following files should be copied to your server's main EQEmu directory to complete the update:

src\EQEmuServer\Build\*.exe
src\EQEmuServer\utils\*.conf
src\EQEmuServer\eqlaunch\release\*.exe

Make sure you have shut down all running EQEmu server programs before attempting to copy the files.

steve 07-09-2009 03:44 PM

Quote:

Originally Posted by Shendare (Post 173896)
#scribespells 70 65

I'm just curious why the numbers are used backwards? Is this one of those EU vs US things? Seems like it should be:

#scribespells 65 70 or #scribespells 10 25

Or am I missing something?

Shendare 07-09-2009 03:56 PM

The numbers are reversed because the usage of the command is actually as follows:

#scribespells MaxLevel [MinLevel]

Where MinLevel is optional, defaulting to 1 if omitted.

MinLevel is a later addition to the command, which used to only take MaxLevel and always use a MinLevel of 1.

Randymarsh9 07-12-2009 11:10 PM

This is a little problem I have noticed. I'm not sure if anyone else has had this, but when using #scribespells, it will erase the other spells. For instance, i did #scribespells 75, 75 and it gave me my 75 spells. then i did #scribespells 71,71 and it gave me my 71 spells, but got rid of my 75 ones

Zeice 07-12-2009 11:57 PM

Yeah I just made a post about this today. Apparently it deletes the first spells in your spellbook or something like that.

http://www.eqemulator.net/forums/showthread.php?t=28871

Mcbaine2 09-05-2009 12:13 PM

Did you ever ponder the thought of having one merchant in your main zone that sells everyone's 71+ spells?

This seems like an easy fix compared to trying to write a custom command to do the same thing.


All times are GMT -4. The time now is 06:11 AM.

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