So it turns out that this script is no longer working as intended, because it also blocks you from deleting existing characters. This isn't exactly a bad thing, assuming you're combining it with a starter kit like me, which means they can't abuse the starter kit at creation by delting/recreating repeatedly for additional loot.
The following is my code, maybe someone can help me figure out why it's blocking me from deleting characters now for in the event I want to actually allow it:
- Code: Select all
BEGIN
SET @characterCount = (SELECT COUNT(*) FROM `character` ch WHERE ch.AccountID = NEW.AccountID);
IF @characterCount > 1 THEN
SET @msg = "Cannot create more than 1 characters per account";
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = @msg;
END IF;
SET @sack = f_createContainer(NEW.RootContainerID, 459, 0);
SET @temp = f_insertNewItemInventory(@sack, 555, 50, 1, 50000, 50000, NULL, NULL); /* practice sword */
SET @temp = f_insertNewItemInventory(@sack, 41, 100, 1, 50000, 50000, NULL, NULL); /* primitive shovel */
SET @temp = f_insertNewItemInventory(@sack, 43, 100, 1, 50000, 50000, NULL, NULL); /* primitive hammer */
SET @temp = f_insertNewItemInventory(@sack, 45, 100, 1, 50000, 50000, NULL, NULL); /* primitive axe */
SET @temp = f_insertNewItemInventory(@sack, 50, 100, 1, 50000, 50000, NULL, NULL); /* primitive saw */
SET @temp = f_insertNewItemInventory(@sack, 30, 100, 1, 50000, 50000, NULL, NULL); /* primitive sickle */
SET @temp = f_insertNewItemInventory(@sack, 47, 100, 1, 50000, 50000, NULL, NULL); /* primitive pickaxe */
SET @temp = f_insertNewItemInventory(@sack, 289, 100, 1, 50000, 50000, NULL, NULL); /* primitive knife */
SET @temp = f_insertNewItemInventory(@sack, 974, 50, 25, 50000, 50000, NULL, NULL); /* 25x q50 Apple Buns */
SET @temp = f_insertNewItemInventory(@sack, 1028, 50, 1, 15000, 15000, NULL, NULL); /* primitive cooking pot */
END