Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 10-06-2015, 06:33 PM
Cilraaz
Sarnak
 
Join Date: Mar 2010
Posts: 77
Default

I threw something together and it happened to work. It's fairly non-intrusive, only using a small block of code in zone/exp.cpp and a global quest flag.

Edit zone/exp.cpp and add the following to the top of the AddEXP function:
Code:
        std::string query = StringFormat("SELECT value FROM quest_globals WHERE charid='%i' AND name='Halt_Exp_Gains_Toggle'", this->CharacterID());
        auto results = database.QueryDatabase(query);
        if(results.Success()) {
                auto row = results.begin();
                char* ExpOff = row[0];
                int8 ExpFlag = atoi(ExpOff);
                if (ExpFlag == 1)
                        return;
        }
I added the following quest code. Add it to whatever NPC you want to toggle the experience flag:
Code:
if($text=~/experience/i) {
                quest::say("Greetings, $name.  This is a test script. Do you want to [check your experience flag] or [toggle your experience flag]? and things");
}

if($text=~/check my exp/i) {
        if(defined $qglobals{Halt_Exp_Gains_Toggle}) {
                if($qglobals{Halt_Exp_Gains_Toggle} == 1) {
                        $expflag = "disabled";
                } else {
                        $expflag = "enabled";
                }
        } else {
                $expflag = "enabled";
        }

        quest::say("Well, $name, your ability to gain experience appears to be $expflag");
}

if($text=~/toggle my exp/i) {
        quest::say("Are you sure you [want to toggle] your experience flag?");
}

if($text=~/want to toggle/i) {
        if(defined $qglobals{Halt_Exp_Gains_Toggle}) {
                if($qglobals{Halt_Exp_Gains_Toggle} == 1) {
                        quest::setglobal("Halt_Exp_Gains_Toggle", 0, 5, "F");
                        $expflag = "enabled";
                } else {
                        quest::setglobal("Halt_Exp_Gains_Toggle", 1, 5, "F");
                        $expflag = "disabled";
                }
        } else {
                quest::setglobal("Halt_Exp_Gains_Toggle", 1, 5, "F");
                $expflag = "disabled";
        }

        quest::say("Your ability to gain experience is now $expflag. If you wish to alter this status, please talk to me again.");
}
Obviously, all of the quest text can be modified and the confirmation can be removed if wanted.

The code in exp.cpp should only need to go in AddEXP. There are also SetEXP and CalcEXP functions, but I believe SetEXP is only used by the #setxp and #setaaxp commands, while I have no idea where CalcEXP is used.
Reply With Quote
 


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 11:10 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3