قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة[ قسم متخصص فى شروحات و البرامج في عمل السيرفرات الخاصة ] [ يرجى عدم وضع الأسئلة والاستفسارات في هذا القسم ]
• الـهـوايـة » Private server developing and designing [ 2D -3D - Pk2 ]
• اسـم الـسـيـرفـر » Private Server
• الـجـنـس » Male
• نقـاط التقييم » 89
3271
Query add drops to mobs by city name
بما انى لقيت كذا حد عايز يضيف Drops للوحوش بإسم المدينة
قررت أعملها وأفيدهم بيها
إتفضلوا
كود PHP:
USE SRO_VT_SHARD
DECLARE @Place VARCHAR(MAX),@Drop VARCHAR(MAX),@Rate real,@rows int = 0,@MinAmount int,@MaxAmount int,@RowsCount int
,@MobCode varchar(max),@ID int,@ItemID int
-------------------------------------------------------------------------------
SET @Place = 'JG' -- your desired area Jangan = JG, Donwhang = DW, Hotan = HT, Alex = AX, JobTemple = TP
SET @Drop = 'ITEM_' --Item CodeName
SET @Rate = '1' -- Drop Rate
SET @MinAmount = '1' --Minimum amount of item
SET @MaxAmount = '1' --Max amount of item
-------------------------------------------------------------------------------
IF @Place = 'JG'
BEGIN
SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in
(select dwobjid from Tab_RefTactics where dwTacticsID in
(select dwTacticsID from Tab_RefNest where nRegionDBID in
(select wregionid from _refregion where ContinentName like 'CHINA'))) and CodeName128 like '%MOB_%')
while (@rows < @RowsCount) BEGIN
set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows)
set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode)
set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop)
INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
END
Print ''+@Drop+' has been added to Jangan Mobs Successfully!'
END
ELSE IF @Place = 'DW'
BEGIN
SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in
(select dwobjid from Tab_RefTactics where dwTacticsID in
(select dwTacticsID from Tab_RefNest where nRegionDBID in
(select wregionid from _refregion where ContinentName like 'West_China'))) and CodeName128 like '%MOB_%')
while (@rows < @RowsCount) BEGIN
set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows)
set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode)
set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop)
INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
END
Print ''+@Drop+' has been added to Donwhang Mobs Successfully!'
END
ELSE IF @Place = 'HT'
BEGIN
SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in
(select dwobjid from Tab_RefTactics where dwTacticsID in
(select dwTacticsID from Tab_RefNest where nRegionDBID in
(select wregionid from _refregion where ContinentName like 'Oasis_Kingdom'))) and CodeName128 like '%MOB_%')
while (@rows < @RowsCount) BEGIN
set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows)
set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode)
set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop)
INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
END
END
ELSE IF @Place = 'AX'
BEGIN
SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in
(select dwobjid from Tab_RefTactics where dwTacticsID in
(select dwTacticsID from Tab_RefNest where nRegionDBID in
(select wregionid from _refregion where ContinentName like '%DELTA%' or ContinentName like '%SD%' or ContinentName like '%Pharaoh%' or ContinentName like '%KingsValley%'))) and CodeName128 like '%MOB_%')
while (@rows < @RowsCount) BEGIN
set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows)
set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode)
set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop)
INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
END
Print ''+@Drop+' has been added to Alexandria Mobs Successfully!'
END
ELSE IF @Place = 'TP'
BEGIN
SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in
(select dwobjid from Tab_RefTactics where dwTacticsID in
(select dwTacticsID from Tab_RefNest where nRegionDBID in
(select wregionid from _refregion where ContinentName like '%TEMPLE%'))) and CodeName128 like '%MOB_%')
while (@rows < @RowsCount) BEGIN
set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows)
set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode)
set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop)
INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
END
Print ''+@Drop+' has been added to Temple Mobs Successfully!'
END
ELSE
PRINT 'You wrote a wrong place name'
ممكن حضرتك تقولى اعدل اية فى الكوير يعنى اكتب كود الايتم فين النسبة
يعنى انا مثلا فى الجزء دة اعدل فى حاجة ولا اسيبو زى ماهو
كود PHP:
IF @Place = 'JG' BEGIN SET @RowsCount = (SELECT COUNT(CodeName128) From _RefObjCommon where id in (select dwobjid from Tab_RefTactics where dwTacticsID in (select dwTacticsID from Tab_RefNest where nRegionDBID in (select wregionid from _refregion where ContinentName like 'CHINA'))) and CodeName128 like '%MOB_%') while (@rows < @RowsCount) BEGIN set @MobCode = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @rows) set @ID = (select ID from _refobjcommon where CodeName128 = @MobCode) set @ItemID = (Select id from _RefObjCommon where CodeName128 = @Drop) INSERT _RefMonster_AssignedItemDrop VALUES (@ID,@ItemID,0,0,@MinAmount,@MaxAmount,@Rate,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx') END Print ''+@Drop+' has been added to Jangan Mobs Successfully!' END