Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Database/World Building

Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2015, 09:59 AM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default Couple of questions about Database and other.

So I have been reading through these forums mostly here and the Quest:Q:A section.

I am attempting to make it so that most things on my server are doable with a group of players and bots not requiring a raid. Maybe 2 groups at the most.

I have an idea how to do this using a SQL for Npc_Types that lowers values such as Update Npc_Types set hp = (hp * 0.25) where (XXXXXX); or something and then going from there with the rest of the values hp regen and such.

The question I have is how do XXXXXX in my made up query above.
Is there a reliable way to select only a creature regarded as a boss?
It doesnt seem that using Level is a good indicator as alot of the trash at POP levels are higher level than bosses from say Velious.
Its possible that I could use HP itself as an indicator i suppose...

something like

Update npc_types set ac = (ac * 0.6) where hp > 30000;
Update npc_types set mindmg = (mindmg * 0.5) where hp >30000;
Update npc_types set maxdmg = (maxdmg * 0.5) where hp >30000;
Update npc_types set hp_regen_rate = (hp_regen_rate * 0.3) where hp >30000;
Update npc_types set hp = (hp * 0.7) where hp > 30000 and hp < 60000;
Update npc_types set hp = (hp * 0.4) where hp > 60000 and hp < 90000;
Update npc_types set hp = (hp * 0.2) where hp > 90000;

****DISCLAIMER**** I am aware the above code would probably not run I literally only wrote it to show what I had in mind.

What would be a good way to ensure my code only gets ran on creatures that are raid or boss targets...

Also another question.

I create an NPC using the #spawn command.

If i do not enter anything for Priweapon or Secweapon i cannot seem to use #npcedit do change that after.
using #wc 7 1 for instance only makes them hold it til restart or repop.

Is there a command im missing that can do this or is database editing the only option then?
Reply With Quote
  #2  
Old 09-19-2015, 11:49 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Hello,

I've spent a ton of time on my database relative to how long I've been part of the community. (I'm part of it, right?) But, your second question is easier for me to answer.

I haven't used the in-game #spawn enough to understand it's intricacies. If I want a duplicate of and existing mob, I will use #dbspawn <npc_types.id> then I think #npcspawn create to give it a spawngroupid. I haven't used it much so you may want to check the wiki pages on this http://wiki.eqemulator.org/p?How_to_..._NPCs&frm=Main

I use HeidiSQL to make the vast majority changes to my DB.

Your first question is difficult to answer because I am not aware of anything in the table `npc_types` that distinguishes a raid boss from a non-raid boss. If I were doing something like what you want to do and I wanted to be accurate, unfortunately, I would probably have to go on memory and other sources and hand pick these.

To make hand picking easier, I would write some queries to make searching for these mobs a lot easier. As far as I know, doing it either way will still take some time to sift through the npcs you want to include as a raid boss. Now, if someone had a list, injecting this list into a table and checking npc_types against this table would be "simple".

The answer to your question will be determined by how much time you want to spend on this minus a list someone already has formulated.
Reply With Quote
  #3  
Old 09-19-2015, 11:57 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default npc_types.raid_target

I learned something new.

There is a column called `raid_target` in the `npc_types` table.

Code:
select * from `npc_types` where `raid_target` > 0;
I'm unsure the accuracy of the values in this column as I have never used it to make selections.

EDIT: It appears my database does not have any values outside of the default value in this column. Your DB version will determine if you have values in this column. I have the last cavedude DB from February which has values of 1 for some/all? raid_targets.

EDIT2: The list is incomplete from the February DB. It lists npcs from PoP and GoD. Not all npcs in this list are actual raid bosses indicating, if this column is used in the source, that it may be used for resting regen instead of merely identifying the npcs. It's a start for you though.
Reply With Quote
  #4  
Old 09-19-2015, 12:50 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

You can also do this:
Code:
SELECT * FROM `npc_types` WHERE `name` LIKE '##%';
Reply With Quote
  #5  
Old 09-19-2015, 01:05 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Oh, that's good to know. Is ## considered an unofficial standard (will I find non raid mobs with ##)? I've seen many npcs involved in quest scripts with #, but it's definitely not a standard.

EDIT: nevermind, the list isn't huge so picking through is easy - I also don't advise changing the names of these because they are likely used in a script - I made this mistake as a noob - ##a_Bat_with_Herpes yikes!
Reply With Quote
  #6  
Old 09-19-2015, 01:24 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

# And ## are boss mobs usually.
Reply With Quote
  #7  
Old 09-19-2015, 03:00 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

AdrianD - Thank you for the response I was not aware of the Raid_target field nor for some reason did I see it when I looked at the database.

In the end I ended up running my sqls which surprisingly ran pretty much as is. Then i ended up running the last query a few more times to catch stragglers who had an extremely large amount of hp to begin with.

It is good to know and consider the ## factor though and I will keep that in mind I appreciate your assistance again as well Kingly.


as for the Adding a Weapon to an NPC to hold it seems I am at a loss there and will attempt to just add them into the database im guessing a simple query would work

as in to update the spawn based on id and d_melee_texture or something.

hopefully i get some time to lookinto that later it just seemed that that there isnt a simple command to be able to type #HOLDTHIS "itemid" seems much more straight forward. Im wondering If i could add one to the database by creating a new GM command that would run a query into the db by selecting the clients target as the ID and the input "14383"(Innoruuk's curse for example) and then put it in the db.

I suppose though you may have to use the texture id such as 152 for IC or something instead.

I was attempting to get #npcedit priweapon (id) or #npcedit priweapon (modelid) to work but they return no error but do nothing.

Guess its time to start looking:P


Edited instead of double posting.


Looking in the command.cpp files i find this.
Code:
c->Message(0, "#npcedit weapon - Sets an NPC's primary and secondary weapon model"); 

	if (strcasecmp(sep->arg[1], "weapon") == 0) {
        c->Message(15,"NPCID %u will have item graphic %i set to his primary and item graphic %i set to his secondary on repop.",   npcTypeID, atoi(sep->arg[2]), atoi(sep->arg[3]));
		std::string query = StringFormat("UPDATE npc_types SET d_melee_texture1 = %i, d_melee_texture2 = %i WHERE id = %i",  atoi(sep->arg[2]), atoi(sep->arg[3]), npcTypeID);
		database.QueryDatabase(query);
		return;
	}
When my DB is done sourcing back into Mysql(Sql dump and cmd line sourcing is taking like 2 hours!!) I am gonna give that a shot. It looks like from that command you can only set BOTH at once. Or maybe actually requires NPCID(Target) Modelid1 Modelid2 format for Dual wield. But we will see:P

Last edited by Trackye; 09-19-2015 at 03:11 PM.. Reason: Formatting...
Reply With Quote
  #8  
Old 09-19-2015, 03:12 PM
Soak
Sarnak
 
Join Date: Mar 2015
Posts: 33
Default

Adding weapons to NPCs - I have found it easiest to use EOC. Search the NPC by name (or pull up the zone). Then click the green "Edit NPC" icon to the left of the NPC name. Simply search and click the item you want want their right and left hands.
Reply With Quote
  #9  
Old 09-19-2015, 04:09 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

If the weapon held is not just a graphic and it is something you will/can loot you can easily change the DB. The table `lootdrop_entries` has a column called `equip_item`. The value 1 is on and will make the npc wield a weapon or equip armor.

A query could be written to equip anything that is equippable by joining items and loottable_entries. I haven't done this but know it's possible.
Reply With Quote
  #10  
Old 09-19-2015, 04:21 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Quote:
Originally Posted by Soak View Post
Adding weapons to NPCs - I have found it easiest to use EOC. Search the NPC by name (or pull up the zone). Then click the green "Edit NPC" icon to the left of the NPC name. Simply search and click the item you want want their right and left hands.
Where would one find this EOC? I searched on this forum but it returned nothing.

NVm found it:P Thanks
Reply With Quote
  #11  
Old 09-20-2015, 04:43 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

For anyone wondering in case a search sends them to this post.

#npcedit weapon modelid modelid

Does infact work as well ingame.

It requires you use the ModelID though not the Itemid.

You can find Model ids if you dont know how by going to Lucy searching for the item and clicking RAW on the top right of the screen then searching for the part that begins with IT. For example innoruuk's curse is IT145 so if you wanted him to wield that item you target the NPC and type #npcedit weapon 145 0

If you wanted him to dual wield Warrior epics it would be #npcedit weapon 141 142.

Im sure many of you already knew this but it would be rude to solve my own question and not post the findings here.

Thanks again for the help.
Reply With Quote
  #12  
Old 09-20-2015, 06:26 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Solved this in a much better way for my purposes don't want to keep posting in this thread so I will post it in the code submission section.

link to that here http://www.eqemulator.org/forums/sho...355#post243355
Thanks again.
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 01:40 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