How to edit the server to place misceffects at map coords

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
nmaligec
Novice
Novice
Posts: 253
Joined: Thu Apr 08, 2010 2:55 am

How to edit the server to place misceffects at map coords

Post by nmaligec » Thu Jun 02, 2011 2:35 pm

Right now the only way to place a particle effect through scripting is to attach it directly to an npc, or a player.

I was told that the new 0.5.2 client handles a manaserve packet to place effects directly at a map location:
GPMSG_CREATE_EFFECT_POS:
0x0320 + 2 Byte effect id + 2 Byte position X + 2 Byte position Y

My question is how can tmwAthena be modified to send the proper packet. I will denote the script command that exposes this feature as mapeffect(). Here are a few of the issues I am stumped with.
1. How does the client know which map to place it on.
2. How to give clif_send() a block_list when there might not be any RID attached to the npc which calls mapeffect().
User avatar
o11c
Knight
Knight
Posts: 2262
Joined: Sun Feb 20, 2011 10:09 pm
Location: ^ ^

Re: How to edit the server to place misceffects at map coord

Post by o11c » Thu Jun 02, 2011 10:56 pm

That's a manaserv packet so the client won't handle it for tmwA anyway.

But anyway...
(this discussion based on my rewritten version which is quite a bit saner)

clif_send() can have a NULL struct block_list *bl iff type = Whom::ALL_CLIENT. But you want it to be sent for all clients players in a certain area of a certain map. So you need a struct block_list.
(In order for the effect to also appear for players who enter the area after it has started (but before it disappears) you need to have it saved on the server anyway.)

So just create some struct (possibly with the floor item backend?) that contains a struct bl* along with whatever necessary information is required to recreate the effect, and set bl.m, bl.x, bl.y, and call clif_send with the bl, with type = Whom::AREA, with some packet that describes how to actually do the effect.

Then, modify the appropriate map_foreachinmovearea callbacks to make it appear/disappear when player walks out of range.

Note, however, that the whole point of the problem and the "fake NPC" solution is that the client doesn't interpret any such packet for tmwA.
Former programmer for the TMWA server.
Post Reply