Dissidia Posted November 24, 2011 Posted November 24, 2011 after you kill the monster get the x and y coordinate of the monster you killed. this is possible? Quote
Kenpachi Posted November 24, 2011 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
Dissidia Posted November 25, 2011 Author 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
Toshiro Posted November 25, 2011 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
GodLesZ Posted November 25, 2011 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
Toshiro Posted November 25, 2011 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
GodLesZ Posted November 25, 2011 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
Brian Posted November 25, 2011 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
Dissidia Posted November 26, 2011 Author Posted November 26, 2011 (edited) thank you sirs.. this is very usefull in tombstone system Edited November 26, 2011 by Lionheart Quote
Protimus Posted November 28, 2011 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
Angry Mjoo Posted January 21, 2012 Posted January 21, 2012 Is there any need of a Tombstone Script to Link with this Mod?.. Quote
Question
Dissidia
after you kill the monster get the x and y coordinate of the monster you killed.
this is possible?
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.