Dissidia Posted November 24, 2011 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 535 Reputation: 23 Joined: 11/19/11 Last Seen: June 8, 2023 Share Posted November 24, 2011 after you kill the monster get the x and y coordinate of the monster you killed. this is possible? Quote Link to comment Share on other sites More sharing options...
Kenpachi Posted November 24, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 764 Reputation: 220 Joined: 11/14/11 Last Seen: November 19, 2020 Share Posted November 24, 2011 In ../src/map/mob.c find this function: int mob_dead(struct mob_data *md, struct block_list *src, int type) X: md->bl.x Y; md->bl.y 1 Quote Link to comment Share on other sites More sharing options...
Dissidia Posted November 25, 2011 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 535 Reputation: 23 Joined: 11/19/11 Last Seen: June 8, 2023 Author Share Posted November 25, 2011 (edited) sir in script how to add? example: set @mobcoordinatex,getmobx; set @mobcoordinatey,getmoby; Edited November 25, 2011 by Lionheart Quote Link to comment Share on other sites More sharing options...
Toshiro Posted November 25, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: Yesterday at 05:06 PM Share Posted November 25, 2011 (edited) I'm not at home so I couldn't test if it's actually working. The following changes set the variables killed_x and killed_y when a monster (and player if you like) is killed. It works exactly like killedid, just with the coordinates instead of the id. Find (src/map/map.h:308): SP_KILLEDRID=122, Add after: SP_KILLED_X=123, SP_KILLED_Y=124, Find (src/map/pc.c:6035): case SP_KILLEDRID: val = sd->killedrid; break; Add after: case SP_KILLED_X: val = sd->killed_x; break; case SP_KILLED_Y: val = sd->killed_y; break; Find (src/map/pc.c:6177): case SP_KILLEDRID: sd->killedrid = val; return 1; Add after: case SP_KILLED_X: sd->killed_x = val; return 1; case SP_KILLED_Y: sd->killed_y = val; return 1; Find (src/map/mob.c:2429): pc_setparam(mvp_sd, SP_KILLEDRID, md->class_); Add after: pc_setparam(mvp_sd, SP_KILLED_X, md->bl.x); pc_setparam(mvp_sd, SP_KILLED_Y, md->bl.y); Find (src/map/pc.h:390): int killerrid, killedrid; Add after: int killed_x, killed_y; Find (db/const.txt:296): killedrid 122 1 Add after: killed_x 123 1 killed_y 124 1 (Edit:) Sets the variables for custom mob kill events and killed players as well. Find (src/map/mob.c:2416): pc_setparam(sd, SP_KILLERRID, sd->bl.id); Add after: pc_setparam(sd, SP_KILLED_X, sd->bl.x); pc_setparam(sd, SP_KILLED_Y, sd->bl.y); Find (src/map/mob.c:2421): pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0); Add after: pc_setparam(mvp_sd, SP_KILLED_X, sd?sd->bl.x:0); pc_setparam(mvp_sd, SP_KILLED_Y, sd?sd->bl.y:0); Find (src/map/pc.c:5719): pc_setparam(sd, SP_KILLERRID, src?src->id:0); Add After: pc_setparam(sd, SP_KILLED_X, src?src->x:0); pc_setparam(sd, SP_KILLED_Y, src?src->y:0); (/Edit) If you want to add the x and y coordinates for player kills as well: Find (src/map/pc.c:5778): pc_setparam(ssd, SP_KILLEDRID, sd->bl.id); Add after: pc_setparam(ssd, SP_KILLED_X, sd->bl.x); pc_setparam(ssd, SP_KILLED_Y, sd->bl.y); Edited November 25, 2011 by Toshiro 2 Quote Link to comment Share on other sites More sharing options...
GodLesZ Posted November 25, 2011 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 186 Reputation: 51 Joined: 11/14/11 Last Seen: January 21, 2015 Share Posted November 25, 2011 This isnt possible without the old unit control commands or a new modification. I've made a simple one, allowing to do: OnNPCKillEvent: dispBottom("You killed monster " + getMonsterInfo(killedRID, 0) + " @ " + killedRX + "/" + killedRY); end; €dit: Even if @Toshiro was faster - mine also works for player kills killedrx_killedry.diff 1 Quote Link to comment Share on other sites More sharing options...
Toshiro Posted November 25, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: Yesterday at 05:06 PM Share Posted November 25, 2011 This isnt possible without the old unit control commands or a new modification. I've made a simple one, allowing to do: OnNPCKillEvent: dispBottom("You killed monster " + getMonsterInfo(killedRID, 0) + " @ " + killedRX + "/" + killedRY); end; €dit: Even if @Toshiro was faster - mine also works for player kills You actually didn't add that the variables are set for the killing player, just for the player that was killed. But you added it for custom mob kill event which I previously forgot. Updated my first post with additions for variables for the killed player and custom mob kill events. Quote Link to comment Share on other sites More sharing options...
GodLesZ Posted November 25, 2011 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 186 Reputation: 51 Joined: 11/14/11 Last Seen: January 21, 2015 Share Posted November 25, 2011 You actually didn't add that the variables are set for the killing player, just for the player that was killed. Because if you are the killing player, your position can easily be fetched using getmapxy ^^ Only the target position, the killed player, needs to be attached, checked if still online & then getmapxy, bla. Anyways, we should stay @ one modification to not confuse the poeple :S I dont care if we use mine or yours. Quote Link to comment Share on other sites More sharing options...
Brian Posted November 25, 2011 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted November 25, 2011 This would be useful for the Mob Tombstone system! (Does anyone know how it is on official servers: does the tombstone appear at the x,y where the MVP died? or at the x,y where the player was standing?) Quote Link to comment Share on other sites More sharing options...
Dissidia Posted November 26, 2011 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 535 Reputation: 23 Joined: 11/19/11 Last Seen: June 8, 2023 Author Share Posted November 26, 2011 (edited) thank you sirs.. this is very usefull in tombstone system Edited November 26, 2011 by Lionheart Quote Link to comment Share on other sites More sharing options...
Protimus Posted November 28, 2011 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 198 Reputation: 102 Joined: 11/13/11 Last Seen: May 4, 2014 Share Posted November 28, 2011 (edited) I think you want something like this: http://trac.brathena.org/changeset/929 http://trac.brathena.org/changeset/931 You can study and modify the code, i ask only that you keep the credits. Edited November 28, 2011 by Protimus Quote Link to comment Share on other sites More sharing options...
Angry Mjoo Posted January 21, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 12/17/11 Last Seen: June 30, 2012 Share Posted January 21, 2012 Is there any need of a Tombstone Script to Link with this Mod?.. Quote Link to comment Share on other sites More sharing options...
Question
Dissidia
after you kill the monster get the x and y coordinate of the monster you killed.
this is possible?
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.