Use _LinkRefRegion procedure if you want to create the links. I could explain what each column of that table does but its senseless, for 99% of the cases the generated code by the procedure works for what yo want to do.
Will i find _LinkRefRegion in SRO_VT_SHARD ??, coz i didn't find it there.. can u tell me where can i find it
? and i appreciate ur help buddy
Its an stored procedure, I'm not sure if it was exactly called like that, but it was something similar, find it on Programability<Stored Procedures, not on tables.
That procedure link regions automatically, if you can read SQL code you will understand how it works, but by default _RefRegion table works so its fine if you leave it by default. The procedure is only useful when adding new regions that have no links defined.
Its an stored procedure, I'm not sure if it was exactly called like that, but it was something similar, find it on Programability<Stored Procedures, not on tables.
That procedure link regions automatically, if you can read SQL code you will understand how it works, but by default _RefRegion table works so its fine if you leave it by default. The procedure is only useful when adding new regions that have no links defined.
Thanks buddy, i'll check that and i'll answer back
so u mean bro, it's automatically connected ?? to _LinkRefRegion, sorry but im a newbie
and that what i found inside _LinkRefRegion, can u describe it for me ?
Thanks buddy, i'll check that and i'll answer back
so u mean bro, it's automatically connected ?? to _LinkRefRegion, sorry but im a newbie
and that what i found inside _LinkRefRegion, can u describe it for me ?
if u have skype add me : branzdraike
That code generate the links for the _RefRegion.LinkedRegion_#. The linked region columns define the regions that are around the region defined on wRegionID.
as u see there's much nulls these nulls are LinkedRegion_#, so i only put it in _RefRegion
and don't change any other thing ? sorry for pushing but just coz im newbie still learning
this line comes from "Constantinople FTW" Media and as u know nobody gives Cons FTW Lines only files so what should i do to, i want to put Cons FTW lines i have brought them from Media but the problem comes from nulls
as u see there's much nulls these nulls are LinkedRegion_#, so i only put it in _RefRegion
and don't change any other thing ? sorry for pushing but just coz im newbie still learning
this line comes from "Constantinople FTW" Media and as u know nobody gives Cons FTW Lines only files so what should i do to, i want to put Cons FTW lines i have brought them from Media but the problem comes from nulls
Run this while the line with the nulls is inserted on _RefRegion
Code:
begin TRANSACTION
begin
declare @LinkNum int
declare @this_region int
declare @region_x int
declare @region_z int
declare @wRegionID smallint
declare @wTempRID smallint
declare @col_link varchar(256)
declare @query varchar(256)
declare @db_id_to_link smallint
-- clear all existing region link
set @LinkNum = 1
while (@LinkNum <= 10)
begin
set @query = 'update _RefRegion set LinkedRegion_' + cast(@LinkNum as varchar(10)) + ' = 0'
execute (@query)
set @LinkNum = @LinkNum + 1
end
-- loop all region
declare region_cursor CURSOR FOR
select wRegionID
from _RefRegion
OPEN region_cursor
FETCH NEXT FROM region_cursor INTO @wRegionID
WHILE @@FETCH_STATUS = 0
begin
if (@@error = 0 and @wRegionID <> 0)
begin
-- 던전은 스킵!
if (@wRegionID > 0)
begin
set @LinkNum = 8
while (@LinkNum >= 0)
begin
set @region_z = (@wRegionID & 0xff00) / 256
set @region_x = (@wRegionID & 0x0ff)
set @wTempRID = 0;
if (@LinkNum = 0)
begin
set @region_x = @region_x - 1
set @col_link = 'LinkedRegion_1'
end
else if (@LinkNum = 1)
begin
set @region_x = @region_x - 1
set @region_z = @region_z + 1
set @col_link = 'LinkedRegion_2'
end
else if (@LinkNum = 2)
begin
set @region_z = @region_z + 1
set @col_link = 'LinkedRegion_3'
end
else if (@LinkNum = 3)
begin
set @region_x = @region_x + 1
set @region_z = @region_z + 1
set @col_link = 'LinkedRegion_4'
end
else if (@LinkNum = 4)
begin
set @region_x = @region_x + 1
set @col_link = 'LinkedRegion_5'
end
else if (@LinkNum = 5)
begin
set @region_x = @region_x + 1
set @region_z = @region_z - 1
set @col_link = 'LinkedRegion_6'
end
else if (@LinkNum = 6)
begin
set @region_z = @region_z - 1
set @col_link = 'LinkedRegion_7'
end
else if (@LinkNum = 7)
begin
set @region_x = @region_x - 1
set @region_z = @region_z - 1
set @col_link = 'LinkedRegion_8'
end
set @wTempRID = (@region_z & 0x00ff) * 256
set @wTempRID = @wTempRID + (@region_x & 0x00ff)
select @db_id_to_link = wRegionID
from _RefRegion
where wRegionID = @wTempRID
if (@@ROWCOUNT <> 0)
begin
set @query = 'update _RefRegion set ' + @col_link + ' = ' + cast(@db_id_to_link as varchar(10)) + ' where wRegionID = ' + cast(@wRegionID as varchar(10))
end
else -- 존재하지 않는 region link 는 0으로 채운다
begin
set @query = 'update _RefRegion set ' + @col_link + ' = 0 where wRegionID = ' + cast(@wRegionID as varchar(10))
end
execute(@query)
set @LinkNum = @LinkNum - 1
end
end
end
FETCH NEXT FROM region_cursor INTO @wRegionID
end
CLOSE region_cursor
DEALLOCATE region_cursor
COMMIT TRANSACTION