Model Switcher

02/19/2017 14:39 khaledmajdoub#1
hello :)
can anyone help me or give me a link to how to make Model Switcher for weapons in vSro ?
i read other treads but all buggy or missing codes and lines

Thank you
Peace
02/22/2017 22:24 sherio_3x#2
Try this its working well with me but after some edits
Notice: Its not my work :)
Quote:
refobjCommon
1 125892 ITEM_ROVER_CHANGE_WEAPON_STYLE ???????????(???) xxx SN_ITEM_ROVER_CHANGE_WEAPON_APVP1 SN_ITEM_ROVER_CHANGE_WEAPON_APVP1_TT_DESC 1 0 3 3 13 14 180000 3 0 1 1 1 255 0 1 0 0 129 0 0 0 0 0 0 0 -1 0 -1 0 -1 0 -1 0 -1 0 0 0 0 0 0 0 100 0 0 0 xxx item\etc\drop_mall_scroll.bsr JOBium\etc\JOB.ddj xxx xxx 2236414



refobjItem

2236414 1 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000 ????(?) 1 [USU1:SKILL_MALL_JOB] -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx -1 xxx 0 0 0



Create New Procedure --_NOVA_SWITCHER
----------------------
AS
BEGIN
--//---------------------------------------------------------------



DECLARE @INVSIZE TINYINT,
@Top1Wep int,
@OldItm int

Set @InvSize = (select InventorySize from sro_vt_shard.._char where charid = @charid)
set @Top1Wep = (select top 1 inv.itemid from sro_vt_shard.._inventory inv inner join sro_vt_shard.._items itm on inv.itemid = itm.id64
where itm.refitemid in (select ItemID from _ModelSwitcher) and itm.serial64 > 0 and inv.itemid <> 0 and inv.slot between 13 and @InvSize and inv.charid = @charid )
Set @OldItm = (select top 1 refitemid from sro_vt_shard.._items where id64 <> 0 and id64 = @Top1Wep and serial64 > 0)
if @Top1Wep > 0
Begin
Declare @NewItm int = case
When @olditm in (select ItemID from _ModelSwitcher)
then (select top 1 Newitemid from _ModelSwitcher where ItemID = @olditm )
end /* will destroy any item that he tries to switch if he dont have required items */
update sro_vt_shard.._items set RefItemID = @NewItm where RefItemID = @OldItm and ID64 = @Top1Wep and Serial64 > 0
End


END




GO





Create Table
-------------

USE [SRO_VT_SHARDLOG]
GO


/****** Object: Table [dbo].[_ModelSwitcher] Script Date: 6/6/2015 2:43:23 PM ******/
SET ANSI_NULLS ON
GO


SET QUOTED_IDENTIFIER ON
GO


SET ANSI_PADDING ON
GO


CREATE TABLE [dbo].[_ModelSwitcher](
[ItemID] [int] NOT NULL,
[ItemCode] [varchar](max) NOT NULL,
[NewitemID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


GO




_AddLogItem > SRO_VT_SHARDLOG
-----------------------------

if (@ItemRefID = 125892)
BEGIN
EXEC SRO_VT_SHARDLOG.dbo._NOVA_SWITCHER @CharID
END
DONT FORGET TO EDIT SPACES
02/24/2017 14:58 khaledmajdoub#3
Thank you but what should i edit to make it work ?
02/25/2017 15:46 leo2111#4
I saw many ppl are asking about model switch procedure , here is my way:
First create the scroll
RefObjCommon line:
RefObjItem line:
To change the model , I just copied the refobjcommon and refobjitem of the item which I wanted to change the skin and I created a new item
RefObjCommon line :
RefObjItem line:
and changed the .bsr and ddj path
without creating any aditional table.
Now the upgrade procedure:
then add this querry to bottom of your
_AddLogItem querry:

02/26/2017 15:23 khaledmajdoub#5
Quote:
Originally Posted by leo2111 View Post
I saw many ppl are asking about model switch procedure , here is my way:
First create the scroll
RefObjCommon line:
RefObjItem line:
To change the model , I just copied the refobjcommon and refobjitem of the item which I wanted to change the skin and I created a new item
RefObjCommon line :
RefObjItem line:
and changed the .bsr and ddj path
without creating any aditional table.
Now the upgrade procedure:
then add this querry to bottom of your
_AddLogItem querry:

Msg 156, Level 15, State 1, Procedure _ModelSwitch13D, Line 24
Incorrect syntax near the keyword 'Update'.
Msg 137, Level 15, State 2, Procedure _ModelSwitch13D, Line 24
Must declare the scalar variable "@New_CH_TBLADE_ID".
Msg 137, Level 15, State 2, Procedure _ModelSwitch13D, Line 24
Must declare the scalar variable "@weaponslot".
thats what i get
02/26/2017 16:41 leo2111#6
Quote:
Originally Posted by khaledmajdoub View Post
Msg 156, Level 15, State 1, Procedure _ModelSwitch13D, Line 24
Incorrect syntax near the keyword 'Update'.
Msg 137, Level 15, State 2, Procedure _ModelSwitch13D, Line 24
Must declare the scalar variable "@New_CH_TBLADE_ID".
Msg 137, Level 15, State 2, Procedure _ModelSwitch13D, Line 24
Must declare the scalar variable "@weaponslot".
thats what i get
try to fix it , you have the errors list there, try to fix it....
02/26/2017 19:50 khaledmajdoub#7
Quote:
Originally Posted by leo2111 View Post
try to fix it , you have the errors list there, try to fix it....
tried Declare many times works but Update is making a problem . ty for the help lol , and the lines u gave up there wasnt correct btw .
02/27/2017 20:58 leo2111#8
Quote:
Originally Posted by khaledmajdoub View Post
tried Declare many times works but Update is making a problem . ty for the help lol , and the lines u gave up there wasnt correct btw .
@[Only registered and activated users can see links. Click Here To Register...]CH_TBLADE_ID int = 25672 , @[Only registered and activated users can see links. Click Here To Register...]CH_TBLADE_ID int = 42876,
delete that and then execute the procedure. In case that you will add more lines you have to divide every line with comma
< , >
Which lines?
03/06/2017 02:06 leo2111#9
With me works everything perfectly, I'm using sql express 2014.
11/03/2020 15:35 devdash#10
Quote:
Originally Posted by qilera View Post
same error like khaled... need help :(
Provide a screen shot of the error, and also the query you use please, and i will try my best to help you fixing it
11/03/2020 22:03 devdash#11
Quote:
Originally Posted by qilera View Post
Thank u for the fast answere! Here it is...
for some reasons the update is not working, can you upload the query here, so i can take a look
11/04/2020 04:35 Cerigo#12
there is already a coma beside that equal sign @[Only registered and activated users can see links. Click Here To Register...]CH_TBLADE_ID=44145 ,
remove it
11/21/2020 00:24 scorpionskin#13
i hate model switchers, but thanks for providing you're contribution!
11/21/2020 01:57 Devsome#14
#moved