[Release] 2 small queries

12/12/2014 07:46 Anonymous-6723#1
Adding total 254 lines in _RefHWANLevel

Code:
DECLARE @lvl varchar(5),
		@titlech varchar(100),
		@titleeu varchar(100)
SET @lvl = 7
WHILE (@lvl < 255)
BEGIN
SET @titlech = 'UIO_SECOND_HWAN_CH_NAME_LEVEL_' + @lvl
SET @titleeu = 'UIO_SECOND_HWAN_EU_NAME_LEVEL_' + @lvl
INSERT INTO _RefHwanLevel (HwanLevel, ParamFourcc1, ParamValue1, ParamFourcc2, ParamValue2, ParamFourcc3, ParamValue3, ParamFourcc4, ParamValue4, ParamFourcc5, ParamValue5, AssocFileObj128, Title_CH70, Title_EU70)
VALUES (@lvl, 1397769301, 200, 1145127506, 35,0,0,0,0,0,0,'xxx',@titlech,@titleeu)
SET @lvl = @lvl + 1
END
Item to mob drop

Code:
DECLARE @RefMonsterID INT,
		@RefItemID INT,
		@DropMin INT,
		@DropMax INT,
		@DropRatio INT,
		@MobCodeName varchar(128),
		@ItemCodeName varchar(128);
-- SETTINGS --
SET @MobCodeName = 'MonsterCodeName' --Which monster will drop the item
SET @ItemCodeName = 'ItemCodeName' --Which item you want to be dropped
SET @DropMin = 0 --Minimum items if it has to drop how many of them they will be
SET @DropMax = 0 --Maximum items if it has to drop how many of them they can be
SET @DropRatio = 1 -- Drop rate (based on % success/fail if it will drop or not the item that is added) 1 = 100% / 0.05 = 5% / 0.5 = 50%
-- SETTINGS --
SELECT @RefMonsterID = ID FROM _RefObjCommon with(NOLOCK) where CodeName128 = @MobCodeName
SELECT @RefItemID = ID FROM _RefObjCommon with(NOLOCK) where codename128 = @ItemCodeName
INSERT INTO _RefMonster_AssignedItemDrop (RefMonsterID,RefItemID,DropGroupType,OptLevel,DropAmountMin,DropAmountMax,DropRatio,RefMagicOptionID1,CustomValue1,RefMagicOptionID2,CustomValue2,RefMagicOptionID3,CustomValue3,RefMagicOptionID4,CustomValue4,RefMagicOptionID5,CustomValue5,RefMagicOptionID6,CustomValue6,RefMagicOptionID7,CustomValue7,RefMagicOptionID8,CustomValue8,RefMagicOptionID9,CustomValue9,RentCodeName) VALUES
(@RefMonsterID,@RefItemID,0,0,@DropMin,@DropMax,@DropRatio,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'xxx')
Might add more later..
12/13/2014 03:06 PortalDark#2
#Approved
12/14/2014 16:15 Kaizen_#3
krall release bro keep going till you hit the wall tralalala
love you menz MUAAAAAA
hahahaha :P
12/14/2014 17:50 Justin1337*#4
Quote:
Originally Posted by Kaizen_ View Post
krall release bro keep going till you hit the wall tralalala
love you menz MUAAAAAA
hahahaha :P
qay. :D
12/15/2014 22:52 Anonymous-6723#5
Trolls.. :D I am trying here to help the "community". But dats hopeless I swear.. :/
12/15/2014 23:30 sarkoplata#6
wow the code bbcode is updated while i wasnt here
12/16/2014 12:02 Anonymous-6723#7
Quote:
Originally Posted by sarkoplata View Post
wow the code bbcode is updated while i wasnt here
Glad you are back :) WB
12/17/2014 02:36 jhoan3d#8
i need query remove spaw mobs from jupiter etc city please help
12/17/2014 13:15 Anonymous-6723#9
Quote:
Originally Posted by jhoan3d View Post
i need query remove spaw mobs from jupiter etc city please help
delete from Tab_refnest where dwTacticsID in (SELECT dwTacticsID FROM Tab_Reftactics where dwobjid in (select ID from _refobjcommon where codename128 like 'MOB_ARABIA%'))

this should work, if we assume that all the arabian mobs start with MOB_ARABIA :)
12/17/2014 15:14 Kadhras_TR#10
Great
12/17/2014 23:06 ​Exo#11
Quote:
Originally Posted by jhoan3d View Post
i need query remove spaw mobs from jupiter etc city please help
PHP Code:
Use this to remove anyshit from RefNest

USE SRO_VT_SHARD
DECLARE      @RefID int
SELECT       
@RefID R.dwTacticsID
FROM   Tab_RefTactics R
JOIN    _RefObjCommon O
ON           O
.ID R.dwObjID
WHERE O
.CodeName128 LIKE 'CodeName128'

DELETE FROM Tab_RefNest WHERE dwTacticsID = @RefID 
12/17/2014 23:30 Syloxx#12
Quote:
Originally Posted by xExorcist View Post
Code:
Use this to remove anyshit from RefNest

USE SRO_VT_SHARD
DECLARE @RefID int
SELECT @RefID = R.dwTacticsID
FROM Tab_RefTactics R
JOIN _RefObjCommon O
ON O.ID = R.dwObjID
WHERE O.CodeName128 LIKE 'CodeName128'
DELETE FROM Tab_RefNest WHERE dwTacticsID = @RefID
never used DELETE and JOIN in 1 statement?

Code:
DECLARE	@CodeName VARCHAR(129) = 'INSERT_CODENAME_HERE'

DELETE	TRN
FROM	Tab_RefTactics TRT
JOIN	_RefObjCommon ROC
ON		TRT.dwObjID = ROC.ID
JOIN	Tab_RefNest TRN
ON		TRT.dwTacticsID = TRN.dwTacticsID
WHERE	ROC.CodeName128 LIKE @CodeName
12/17/2014 23:37 ​Exo#13
Quote:
Originally Posted by Syloxx View Post
never used DELETE and JOIN in 1 statement?

Code:
DECLARE	@CodeName VARCHAR(129) = 'INSERT_CODENAME_HERE'

DELETE	TRN
FROM	Tab_RefTactics TRT
JOIN	_RefObjCommon ROC
ON		TRT.dwObjID = ROC.ID
JOIN	Tab_RefNest TRN
ON		TRT.dwTacticsID = TRN.dwTacticsID
WHERE	ROC.CodeName128 LIKE @CodeName
Bitch please -_- , since there's only 1 ID for every codename there's no problem in using it..
12/17/2014 23:39 Syloxx#14
Quote:
Originally Posted by xExorcist View Post
Bitch please -_- , since there's only 1 ID for every codename there's no problem in using it..
yes but why u use like then?

if i place something like MOB_CH% your query will give a error

smt like "a variable can only contain one value"
12/17/2014 23:45 ​Exo#15
Quote:
Originally Posted by Syloxx View Post
yes but why u use like then?

if i place something like MOB_CH% your query will give a error

smt like "a variable can only contain one value"
Okay then use = instead of like [problem solved] wasn't meant to be used for more than a value, why like? cuz I didn't remember any npc code so i used it @ mine while testing cuz i had a npc with smth like ;crap; so i used LIKE '%CRAP%', laziness ftw!