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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2012, 06:11 PM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default Need help adjusting prices of spells via SQL

I'm looking for a SQL script and since I'm pretty new at writing scripts I'm asking for help. I want to alter the price of all spells by this equation: Manacost * 40.
Reply With Quote
  #2  
Old 04-20-2012, 04:09 AM
louis1016
Hill Giant
 
Join Date: Dec 2009
Posts: 157
Default

the mana cost isnt stored in the spell scroll item, its stored in the spell table itself so im not sure if this is actually doable this way
Reply With Quote
  #3  
Old 04-20-2012, 04:47 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, I think that should be doable. I haven't tested it, but the query should be something like this:

Code:
UPDATE items, spells_new SET items.price = (spells_new.mana * 40) WHERE items.scrolleffect = spells_new.id;
As always, it is recommended to do a DB or at least items table backup before running any queries you are not 100% sure about. If using Navicat, you can just right click the items table and make a copy of it from there (copy and paste), so you will have a backup in case something goes wrong with the price changes.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 04-20-2012, 08:24 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

Quote:
Originally Posted by trevius View Post
Yeah, I think that should be doable. I haven't tested it, but the query should be something like this:

Code:
UPDATE items, spells_new SET items.price = (spells_new.mana * 40) WHERE items.scrolleffect = spells_new.id;
As always, it is recommended to do a DB or at least items table backup before running any queries you are not 100% sure about. If using Navicat, you can just right click the items table and make a copy of it from there (copy and paste), so you will have a backup in case something goes wrong with the price changes.
Thanks Trevius. I knew it was doable, just wasn't sure how. Will this pull the individual mana costs of each item and not just the first one?
Reply With Quote
  #5  
Old 04-26-2012, 02:24 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yes, it basically looks for a spell ID that matches the spell ID in the scrolleffect field of the item, and then uses the mana for that spell to set the price of the item. If there is no matching spell id for the scrolleffect field (such as items that are not scrolls), the price shouldn't be affected by that query. This particular query will update all scrolls at once, but you could specify more stuff in the WHERE clause to limit it in any way you want such as certain item or spell IDs or whatever.
__________________
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 05: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