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 10-10-2007, 04:03 AM
krusher
Sarnak
 
Join Date: Jan 2003
Location: Grand Rapids, MI
Posts: 90
Default

I have begun work on this request. Will keep you posted as i progress...

Krusher
Reply With Quote
  #2  
Old 10-12-2007, 11:17 AM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Thank You!
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #3  
Old 11-01-2007, 08:03 AM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

I've coded the function the way you requested.


Shot:



Code:
1/ Add the prototype in the command.h
Code:
void command_showdrops(Client *c, const Seperator *sep);
2/ In command.cpp
2.1/ Find the line:
Code:
command_add("refundaa", "Refunds your target's AA points, will disconnect them in the process as well.", 100, command_refundaa)
2.2/Replace by
Code:
command_add("refundaa", "Refunds your target's AA points, will disconnect them in the process as well.", 100, command_refundaa) ||
command_add("showdrops"," Usage #showdrops [itemID]", 100, command_showdrops)
2.3/At the end of the file, add the function's code
Code:
void command_showdrops(Client *c, const Seperator *sep)
{
    if(sep->arg[1][0] == '\0'){
        c->Message(10, "Bad argument, usage #showdrops [itemID].");
        return;
    }
 
    int itemID = atoi(sep->arg[1]);
 
    char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
 
    MYSQL_RES *result_lootdrop_id;
    MYSQL_RES *result_lootdtable_id;
    MYSQL_RES *result_npc_name;
 
    MYSQL_ROW row_lootdrop;
    MYSQL_ROW row_loottable;
    MYSQL_ROW row_npc_name;
 
    int npc_numbers=0;
 
    c->Message(0,"Item %i drops:", itemID);
 
    if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT lootdrop_id from lootdrop_entries where item_id=%i",itemID), errbuf, &result_lootdrop_id))
    {
        while ((row_lootdrop = mysql_fetch_row(result_lootdrop_id)))
        {
            npc_numbers++;
            if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT loottable_id from loottable_entries where lootdrop_id=%i",atoi(row_lootdrop[0])), errbuf, &result_lootdtable_id))
            {
 
                while ((row_loottable = mysql_fetch_row(result_lootdtable_id)))
                {
                   if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT name from loottable where id=%i",atoi(row_loottable[0])), errbuf, &result_npc_name))
                   {
                        while ((row_npc_name = mysql_fetch_row(result_npc_name)))
                        {
                            c->Message(0, "NPC- %s -- Loottable: %i",row_npc_name[0],atoi(row_loottable[0]));
                        }
                   }
                }
            }
        }
    }
    if(npc_numbers == 0)
        c->Message(0,"0 NPC found. 0 Loottable found.");
    else
        c->Message(0,"%i NPC(s) found.",npc_numbers);
 
}
Have fun,
Mag
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots
Reply With Quote
  #4  
Old 11-02-2007, 07:25 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Thank you, Magoth! If for nothing else, a little tutorial on how to play with commands.
Reply With Quote
  #5  
Old 11-02-2007, 01:30 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

THANK YOU! SO MUCH!

Will play with this and if it works great, maybe it can get added to the tree
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #6  
Old 11-02-2007, 01:45 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Ok this is FLAT OUT incredible!

THANK YOU.

And yes, I too learned something about how new commands are made. THANKS on all counts!

Now, I can only pray this gets into the tree so that I do not have to diff it every build...

You posting that like that really helps out those of us who can "read the language but not speak the language that well (yet)" understand this stuff at a whole new level.

So, thank you for your time.

Can you tell I am grateful? lol
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #7  
Old 11-02-2007, 01:54 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

One more thing:

THANK YOU AGAIN

(lol)
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #8  
Old 11-02-2007, 05:42 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Won't let me post code for some reason BUT it's bombimg out on the compile... vs. build 1052.

Will double check and see if it's me or not.
Reply With Quote
  #9  
Old 11-02-2007, 05:51 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Ok this:

Code:
command_add("showdrops"," Usage #showdrops [itemID]", 100, command_showdrops)
...needs to be this...

Code:
command_add("showdrops"," Usage #showdrops [itemID]", 100, command_showdrops) ||
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #10  
Old 11-02-2007, 06:37 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

It's also showing the loot table name instead of the NPC name for some reason.

Please see screenshot:

__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #11  
Old 11-02-2007, 09:31 PM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

If you want to see the name of the NPC showed instead of the name of the Lootable, then change the 2.3 of my previous answer to:

2.3/At the end of the file (command.cpp), add the function's code
Code:
void command_showdrops(Client *c, const Seperator *sep)
{
    if(sep->arg[1][0] == '\0'){
        c->Message(10, "Bad argument, usage #showdrops [itemID].");
        return;
    }
 
    int itemID = atoi(sep->arg[1]);
 
    char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
 
    MYSQL_RES *result_lootdrop_id;
    MYSQL_RES *result_lootdtable_id;
    MYSQL_RES *result_npc_name;
 
    MYSQL_ROW row_lootdrop;
    MYSQL_ROW row_loottable;
    MYSQL_ROW row_npc_name;
 
    int npc_numbers=0;
 
    c->Message(0,"Item %i drops:", itemID);
 
    if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT lootdrop_id from lootdrop_entries where item_id=%i",itemID), errbuf, &result_lootdrop_id))
    {
        while ((row_lootdrop = mysql_fetch_row(result_lootdrop_id)))
        {  
            if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT loottable_id from loottable_entries where lootdrop_id=%i",atoi(row_lootdrop[0])), errbuf, &result_lootdtable_id))
            {
 
                while ((row_loottable = mysql_fetch_row(result_lootdtable_id)))
                {
                   if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT name from npc_types where loottable_id=%i",atoi(row_loottable[0])), errbuf, &result_npc_name))
                   {
                        while ((row_npc_name = mysql_fetch_row(result_npc_name)))
                        {
                            c->Message(0, "NPC- %s -- Loottable: %i",row_npc_name[0],atoi(row_loottable[0]));
                            npc_numbers++;
                        }
                   }
                }
            }
        }
    }
    if(npc_numbers == 0)
        c->Message(0,"0 NPC found. 0 Loottable found.");
    else
        c->Message(0,"%i NPC(s) found.",npc_numbers);
 
}
Mag
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots
Reply With Quote
  #12  
Old 11-02-2007, 09:44 PM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Thank you very much!!

This is perfect

No clue how I could ever live without this now. I hope it makes it into the tree.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
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 12:23 AM.


 

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