Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN
- SET @xp = NEW.exp;
- SET @maxId = NEW.id + 1;
- IF (@xp >= 30111208) THEN
- SELECT COUNT(Id) INTO @c FROM rewards_granted WHERE rewards_granted.playerId = NEW.id AND rewards_granted.exp = 30111208;
- IF (@c = 0) THEN
- SELECT MAX(mail.mailUniqueId) + 1 INTO @temp FROM mail;
- IF (@temp > @maxId) THEN
- SELECT @temp INTO @maxId;
- END IF;
- SELECT MAX(inventory.itemUniqueId) + 1 INTO @temp FROM inventory;
- IF (@temp > @maxId) THEN
- SELECT @temp INTO @maxId;
- END IF;
- SELECT MAX(legions.id) + 1 INTO @temp FROM legions;
- IF (@temp > @maxId) THEN
- SELECT @temp INTO @maxId;
- END IF;
- SET @itemId = 187000001;
- IF (NEW.race = 'ASMODIANS') THEN
- SET @itemId = 187000003;
- END IF;
- INSERT INTO inventory(itemUniqueId, enchant, itemId, itemCount, itemColor, itemOwner, isEquiped, slot, itemLocation, isSoulBound)
- VALUES(@maxId, 0, @itemId, 1, 0, NEW.id, 0, 0, 127, 0);
- INSERT INTO mail (mailUniqueId, mailRecipientId, senderName, mailTitle, mailMessage, unread, attachedItemId, attachedKinahCount, express)
- VALUES(@maxId + 1, NEW.id, 'AionWorld.eu', 'Reward',
- 'Here is your reward, as we promised. New wings are attached. Use them sparingly.', 1, @maxId, 0, 1);
- INSERT INTO rewards_granted (playerId, exp) VALUES(NEW.id, 30111208);
- END IF;
- END IF;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement