[HELP]How make a perfect lapisia?

05/26/2015 19:36 AxelMac#16
Quote:
Originally Posted by SnickQ View Post
[Only registered and activated users can see links. Click Here To Register...]
this script working but how can use in warehouse?
05/26/2015 19:49 SkuulCandy#17
"All what you need is put on 1 slot weap/armor and 2 slot "Perfect lapasia" and relog"
05/26/2015 20:12 AxelMac#18
Quote:
Originally Posted by SkuulCandy View Post
"All what you need is put on 1 slot weap/armor and 2 slot "Perfect lapasia" and relog"
yeah, but i use in inventory this, i want use in warehouse.....
05/26/2015 21:38 SkuulCandy#19
Change variable (for inventory) to wharehouse.
I maje the code after if you want.
05/26/2015 21:45 AxelMac#20
Quote:
Originally Posted by SkuulCandy View Post
Change variable (for inventory) to wharehouse.
I maje the code after if you want.
what i need edit for this ?
05/26/2015 22:13 SkuulCandy#21
An good text editor (for example: NotPad++) or your sql query and check all variables (alter to bag and inventory) and replace by wharehouse (stored table)
PS: the first slot of whare house is a slot 0 (for the inventory the first slot is 1) ;)
05/27/2015 07:36 nubness#22
Quote:
Originally Posted by SkuulCandy View Post
An good text editor (for example: NotPad++) or your sql query and check all variables (alter to bag and inventory) and replace by wharehouse (stored table)
PS: the first slot of whare house is a slot 0 (for the inventory the first slot is 1) ;)
UserStoredItems (warehouse) has only one column defining the location of an item, [Slot], and the first slot is 0.
CharItems (inventory) has 2 columns defining the location of an item, [Bag] and [Slot]. Bag = 0 stands for the equipped items, followed by the 5 inventory bags. Every bag starts with Slot = 0.

Please stop posting misleading information.
05/27/2015 07:54 SkuulCandy#23
I wanted to say that we should not mix the slot of the bag if it is on it does not work and many come here to complain
07/02/2015 10:44 auferhousethe#24
@SkullCandy: i think it should a little edit for enchant Weapon or Armor level 0 because Weapon enchant value is 00 -> 01 but Armor enchant value is 00 -> 51 to take effect.
Quote:
USE [PS_GameData]
GO
/****** Object: Trigger [dbo].[GM_Enchant] Script Date: 7/2/2015 2:44:24 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER TRIGGER [dbo].[GM_Enchant]
ON [dbo].[CharQuests]
AFTER INSERT
AS
BEGIN

SET NOCOUNT ON;

DECLARE @QuestID INT = (SELECT QuestID FROM INSERTED)
IF(@QuestID = 1970)
BEGIN

DECLARE @CharID INT = (SELECT CharID FROM inserted)
DECLARE @UserUID INT = (SELECT UserUID FROM Chars WHERE CharID = @CharID)

DECLARE @ItemType TINYINT
DECLARE @EnchantItemId INT

DECLARE @EnchantItem TABLE (EnchantID INT)
DECLARE @GearTypes TABLE (GearTypes TINYINT)
DECLARE @ArmorTypes TABLE (ArmorTypes TINYINT)
DECLARE @WeaponTypes TABLE (WeaponTypes TINYINT)

SET @ItemType = (SELECT Type FROM UserStoredItems WHERE UserUID = @UserUID AND Slot = 0)
SET @EnchantItemId = (SELECT ItemID FROM UserStoredItems WHERE UserUID = @UserUID AND Slot = 1)
-- The perfect lapisia itemid, change it for you needs
INSERT INTO @EnchantItem VALUES (100230),(100001)
-- Add all the gear types you want to use here
INSERT INTO @ArmorTypes VALUES (16),(17),(18),(19),(20),(21),(24),(31),(32),(33), (34),(35),(36),(39)
INSERT INTO @WeaponTypes VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12) ,(13),(14),(15),(45),
(46),(47),(48),(49),(50),(41),(52),(53),(54),(55), (56),(57),(58),(59),(60),(61),(62),(63),(64),(65)

IF ((@ItemType IN (SELECT ArmorTypes FROM @ArmorTypes) OR (@ItemType IN (SELECT WeaponTypes FROM @WeaponTypes))) AND (@EnchantItemID IN (SELECT EnchantID FROM @EnchantItem)))
BEGIN
DECLARE @Enchant TINYINT = (SELECT CAST(SUBSTRING(Craftname, 19, 2) AS TINYINT) FROM UserStoredItems WHERE UserUID = @UserUID AND Slot = 0)
--- max enchant its [10]
IF @Enchant > = 60
GOTO FAIL
ELSE IF @Enchant > = 10 AND @Enchant < 50
GOTO FAIL
SET @Enchant += 1 -- this will increase the enchant by 1

DECLARE @EnchantString CHAR(2) = @Enchant
IF (@ItemType IN (SELECT ArmorTypes FROM @ArmorTypes))
BEGIN
IF LEN(@EnchantString) = 1
SET @EnchantString = '5' + @EnchantString
END
IF (@ItemType IN (SELECT WeaponTypes FROM @WeaponTypes))
BEGIN
IF LEN(@EnchantString) = 1
SET @EnchantString = '0' + @EnchantString
END

UPDATE UserStoredItems
SET Craftname = SUBSTRING(Craftname, 1, 18) + @EnchantString
WHERE UserUID = @UserUID AND Slot = 0

END
ELSE GOTO FAIL
UPDATE UserStoredItems SET [Count] -= 1 WHERE UserUID = @UserUID AND Slot = 1

DELETE FROM UserStoredItems WHERE UserUID = @UserUID AND Slot = 1 AND [Count] = 0

FAIL:
DELETEQUEST:
DELETE FROM CharQuests
WHERE CharID = @CharID AND QuestID = @QuestID
END
END
07/02/2015 10:55 AxelMac#25
Quote:
Originally Posted by auferhousethe View Post
@SkullCandy: i think it should a little edit for enchant Weapon or Armor level 0 because Weapon enchant value is 00 -> 01 but Armor enchant value is 00 -> 51 to take effect.
this is with quest, i have need without quest, with a item that have 100%