View Single Post
  #3  
Old 11-27-2012, 10:39 AM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default

Quote:
Originally Posted by Tabasco View Post
You're right, I didn't dig into it deep enough, but in every other case in SetStartingItems charges is set, so it might be worth a try to specify your charges.

You could also revert and just do this:

Code:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE IF NOT EXISTS `starting_items` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `race` int(11) NOT NULL DEFAULT '0',
  `class` int(11) NOT NULL DEFAULT '0',
  `deityid` int(11) NOT NULL DEFAULT '0',
  `zoneid` int(11) NOT NULL DEFAULT '0',
  `itemid` int(11) NOT NULL DEFAULT '0',
  `item_charges` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `gm` tinyint(1) NOT NULL DEFAULT '0',
  `slot` mediumint(9) NOT NULL DEFAULT '-1',
  PRIMARY KEY (`id`,`race`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

INSERT INTO `starting_items` (`id`, `race`, `class`, `deityid`, `zoneid`, `itemid`, `item_charges`, `gm`, `slot`) VALUES
('', 0, 0, 0, 0, <itemid for stuff everyone gets>, 1, 0, -1),
('', 0, 1, 0, 0, <itemid for stuff warriors get>, 1, 0, -1),
etc;
The charges field in starting_items is type tinyint, if I wanted to start with a clicky item I would have to set it to zero anyway. I tried -1 as the parameter before I posted earlier. I have to say there seems to be an overriding assumption here that * I am wrong * and I should just do it some other way. If I find a bug good, I will save some folks some time in the future, if it is my error, even better, I learned something new.
__________________
Drajor regards you indifferently -- what would you like your tombstone to say?
Reply With Quote