-----------------Mastery Scroll Start--------------------
IF (@Operation=41 AND @ItemRefID BETWEEN 44086 AND 44091) ---------------- European Mastery Scrolls -------------------
BEGIN
IF EXISTS (SELECT * FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE MasteryID='513')
BEGIN
DECLARE @Wizard INT,@Warrior INT,@Rog INT,@Warlock INT,@Bard INT,@Cleric INT
SELECT @Wizard=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='514'
SELECT @Warrior=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='513'
SELECT @Rog=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='515'
SELECT @Warlock=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='516'
SELECT @Bard=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='517'
SELECT @Cleric=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='518'
IF (@Wizard+@Warrior+@Rog+@Warlock+@Bard+@Cleric<='280')
BEGIN
DECLARE @EuropeanMasteryType INT;
SET @EuropeanMasteryType = CASE
WHEN @ItemRefID=44086 --------------- Wizard
THEN 514
WHEN @ItemRefID=44087 --------------- Warrior
THEN 513
WHEN @ItemRefID=44088 --------------- Rouge
THEN 515
WHEN @ItemRefID=44089 --------------- Cleric
THEN 518
WHEN @ItemRefID=44090 --------------- Bard
THEN 517
WHEN @ItemRefID=44091 --------------- Warlock
THEN 516
END
UPDATE SRO_VT_SHARD.dbo._CharSkillMastery SET [Level]='110' WHERE CharID=@CharID AND MasteryID=@EuropeanMasteryType
INSERT SRO_VT_SHARD.dbo._CharSkill SELECT @CharID,SkillID,'1' FROM SRO_VT_LOG.dbo._CharacterSkills WHERE MasteryID=@EuropeanMasteryType
END
END
END
IF (@Operation=41 AND @ItemRefID BETWEEN 44079 AND 44085) ---------------- Chinese Mastery Scrolls -------------------
BEGIN
IF EXISTS (SELECT * FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE MasteryID='257')
BEGIN
DECLARE
@sword INT,@Spear INT,@Bow INT,@Cold INT,@Lightning INT,@Fire INT,@Water INT
SELECT @Sword=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='257'
SELECT @Spear=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='258'
SELECT @Bow=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='259'
SELECT @Cold=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='273'
SELECT @Lightning=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='274'
SELECT @Fire=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='275'
SELECT @Water=[Level] FROM SRO_VT_SHARD.dbo._CharSkillMastery WHERE CharID=@CharID AND MasteryID='276'
IF (@Sword+@Spear+@Bow+@Cold+@Lightning+@Fire+@Water <='490')
BEGIN
DECLARE @ChineseMasteryType INT;
SET @ChineseMasteryType = Case
WHEN @ItemRefID=44081 --------------- Bacheon
THEN 257
WHEN @ItemRefID=44080 --------------- Heuksal
THEN 258
WHEN @ItemRefID=44079 --------------- Pacheon
THEN 259
WHEN @ItemRefID=44084 --------------- Cold
THEN 273
WHEN @ItemRefID=44083 --------------- Lightning
THEN 274
WHEN @ItemRefID=44082 --------------- Fire
THEN 275
WHEN @ItemRefID=44085 --------------- Force
THEN 276
END
UPDATE SRO_VT_SHARD.dbo._CharSkillMastery SET [Level]='110' WHERE CharID=@CharID AND MasteryID=@ChineseMasteryType
INSERT SRO_VT_SHARD.dbo._CharSkill SELECT @CharID,SkillID,'1' FROM SRO_VT_LOG.dbo._CharacterSkills WHERE MasteryID=@ChineseMasteryType
END
END
END
-----------------Mastery Scroll End--------------------
-- À¯·á ¾ÆÀÌÅÛ ±¸ÀÔÀ̸é!
-- #define LOG_ITEMEVENT_BUY_CASHITEM (BYTE)35
if (@Operation = 35)
begin
return -1
end