• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Information on worldstates

Status
Not open for further replies.

DarkAngel

Wiki Author
Hello. I would like to know if anyone has any information regarding world states.
Here is what I have:
Code:
	local packet = CreatePacket(0x2C2, 18) -- HORDE
		packet:WriteULong(mapid]) -- Map
		packet:WriteULong(zoneid) -- Zone
		packet:WriteULong(0)
		packet:WriteUShort(2)
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
	player:SendPacketToPlayer(packet)
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2317) -- ID, total
		packet:WriteULong(maxPoints) -- NeededScore
	player:SendPacketToPlayer(packet)
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2314) -- ID
		packet:WriteULong(teamscore_1) -- Horde Score
	player:SendPacketToPlayer(packet)          
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2313) -- ID
		packet:WriteULong(teamscore_2) -- Alliance Score
	player:SendPacketToPlayer(packet)

I stole the packet structure from Stoneharry's custom bg and updated it for Eluna.

Looking at opcodes.h I found the following opcodes:
743 SMSG_INIT_WORLD_STATES = 0x2C2,
744 SMSG_UPDATE_WORLD_STATE = 0x2C3

Nothing happens when I send the packet to the player.

Any help would be greatly appreciated!

Regards, DarkAngel
 
Last edited:

Tommy

Founder
Hello. I would like to know if anyone has any information regarding world states.
Here is what I have:
Code:
	local packet = CreatePacket(0x2C2, 18) -- HORDE
		packet:WriteULong(mapid]) -- Map
		packet:WriteULong(zoneid) -- Zone
		packet:WriteULong(0)
		packet:WriteUShort(2)
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
	player:SendPacketToPlayer(packet)
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2317) -- ID, total
		packet:WriteULong(maxPoints) -- NeededScore
	player:SendPacketToPlayer(packet)
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2314) -- ID
		packet:WriteULong(teamscore_1) -- Horde Score
	player:SendPacketToPlayer(packet)          
	local packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2313) -- ID
		packet:WriteULong(teamscore_2) -- Alliance Score
	player:SendPacketToPlayer(packet)

I stole the packet structure from Stoneharry's custom bg and updated it for Eluna.

Looking at opcodes.h I found the following opcodes:
743 SMSG_INIT_WORLD_STATES = 0x2C2,
744 SMSG_UPDATE_WORLD_STATE = 0x2C3

Nothing happens when I send the packet to the player.

Any help would be greatly appreciated!

Regards, DarkAngel

I've done custom worldstates many, many times. I made new WorldStates in the WorldStateUI.dbc though, and if I'm not mistaken, you will have to make custom WorldStates for your area & zone too. Unless the client can receive and work with the packet data without your custom dbc edits in WorldStateUI.dbc. But not creating the new WorldState in the WorldStateUI.dbc never worked for me if I tried to send the correct packet data.

Also, you just need to call one 'local packet' instead of doing it over and over:

Code:
	local packet = CreatePacket(0x2C2, 18) -- HORDE
		packet:WriteULong(mapid]) -- Map
		packet:WriteULong(zoneid) -- Zone
		packet:WriteULong(0)
		packet:WriteUShort(2)
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
	player:SendPacketToPlayer(packet)

	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2317) -- ID, total
		packet:WriteULong(maxPoints) -- NeededScore
	player:SendPacketToPlayer(packet)

	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2314) -- ID
		packet:WriteULong(teamscore_1) -- Horde Score
	player:SendPacketToPlayer(packet)   
       
	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2313) -- ID
		packet:WriteULong(teamscore_2) -- Alliance Score
	player:SendPacketToPlayer(packet)
 

DarkAngel

Wiki Author
I've done custom worldstates many, many times. I made new WorldStates in the WorldStateUI.dbc though, and if I'm not mistaken, you will have to make custom WorldStates for your area & zone too. Unless the client can receive and work with the packet data without your custom dbc edits in WorldStateUI.dbc. But not creating the new WorldState in the WorldStateUI.dbc never worked for me if I tried to send the correct packet data.

Also, you just need to call one 'local packet' instead of doing it over and over:

Code:
	local packet = CreatePacket(0x2C2, 18) -- HORDE
		packet:WriteULong(mapid]) -- Map
		packet:WriteULong(zoneid) -- Zone
		packet:WriteULong(0)
		packet:WriteUShort(2)
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
		packet:WriteULong(0) -- ID
		packet:WriteULong(1) -- Value
	player:SendPacketToPlayer(packet)

	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2317) -- ID, total
		packet:WriteULong(maxPoints) -- NeededScore
	player:SendPacketToPlayer(packet)

	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2314) -- ID
		packet:WriteULong(teamscore_1) -- Horde Score
	player:SendPacketToPlayer(packet)   
       
	packet = CreatePacket(0x2C3, 8)
		packet:WriteULong(2313) -- ID
		packet:WriteULong(teamscore_2) -- Alliance Score
	player:SendPacketToPlayer(packet)

Yeah, I don't know why I did that. Adding anything to the DBCs weren't needed on Arcemu but I'll take a look at it!
Thanks for the quick reply
 

Tommy

Founder
Yeah, I don't know why I did that. Adding anything to the DBCs weren't needed on Arcemu but I'll take a look at it!
Thanks for the quick reply

ArcEmu had different things you could do via database, TrinityCore rarely has anything you can do from the database that symbolizes a dbc edit.
 

DarkAngel

Wiki Author
ArcEmu had different things you could do via database, TrinityCore rarely has anything you can do from the database that symbolizes a dbc edit.

Alright, so I tried adding an entry in WorldStateUI.dbc but it still seems not to work.
Using this as reference.

Lets just say I can't get it to work. Can you show me an example?
 

Tommy

Founder
Alright, so I tried adding an entry in WorldStateUI.dbc but it still seems not to work.
Using this as reference.

Lets just say I can't get it to work. Can you show me an example?

Packet wise, I'm not entirely sure. But what I do know is that there's player functions in the TC source that easily handles sending world state data without creating the packet yourself via Lua; however, we don't have it implemented. I'm sure Foereaper, Rochet2 or Laurea can help you better on this seeing they are the Lua people around here. They'll reply soon enough. :/
 

DarkAngel

Wiki Author
Packet wise, I'm not entirely sure. But what I do know is that there's player functions in the TC source that easily handles sending world state data without creating the packet yourself via Lua; however, we don't have it implemented. I'm sure Foereaper, Rochet2 or Laurea can help you better on this seeing they are the Lua people around here. They'll reply soon enough. :/

Thank you Tommy. I was however looking for information regarding the WorldStateUI.dbc, as it seems to me I have screwed up when adding the new WorldStateUI.
I hope they do :)

Regards, DarkAngel
 

Tommy

Founder
Thank you Tommy. I was however looking for information regarding the WorldStateUI.dbc, as it seems to me I have screwed up when adding the new WorldStateUI.
I hope they do :)

Regards, DarkAngel

Well, the columns you only have to edit are:

#0: ID
#1: MapId
#2: ZoneId (0 = everywhere)
#4: WorldState Icon displayed
#5: WorldState String Info, for example, look at mine:

9xoy.png


The Ids 8995, 8993, 8996 and 8994 are used to send the value to the player. For example, I can set 8995 to have 1000 resources and send that to the player and in the center of their screen where it shows the WorldState, it will show 1000/2000.

#22: Hover text
#39: WorldState Id used to show the UI if I remember correctly

And that's all you need to edit, unless you want to edit the other columns for whatever reason.
 

DarkAngel

Wiki Author
Well, the columns you only have to edit are:

#0: ID
#1: MapId
#2: ZoneId (0 = everywhere)
#4: WorldState Icon displayed
#5: WorldState String Info, for example, look at mine:

9xoy.png


The Ids 8995, 8993, 8996 and 8994 are used to send the value to the player. For example, I can set 8995 to have 1000 resources and send that to the player and in the center of their screen where it shows the WorldState, it will show 1000/2000.

#22: Hover text
#39: WorldState Id used to show the UI if I remember correctly

And that's all you need to edit, unless you want to edit the other columns for whatever reason.

Thanks, seems to be just what I needed.
I didn't realise you had to set id's in the string info. When creating the packet I would simply change the value of id 8995(example) e.g.:
Code:
	local packet = CreatePacket(0x2C3, 8)
               packet:WriteULong(8995) -- ID
               packet:WriteULong(1000) -- Score
        k[6]:SendPacketToPlayer(packet)
Will do a test tomorrow, have to get some sleep..

Regards, DarkAngel
 
Status
Not open for further replies.
Top