Jump to content
  • 0

Getting the GID of a killed mob summoned via monster script


aadritch2

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  04/29/13
  • Last Seen:  

Hello, is this possible in the current rathena or do I need to source edit.
My question is this, for example i summoned a monster:

    monster     .@map$,.@mapx,.@mapy,getmonsterinfo(mobid,MOB_NAME),mobid,1,"Mob Spawner::OnMobDeath";

If I am right, upon the mob's death, it will trigger OnMobDeath label from the Mob Spawner NPC.
Now I want to know if its possible that upon the execution OnMobDeath label, i will refer to the dying monster specifically, not just its id from killedid.
I know that it will be possible once I can get hold of its GID, so is there any way to do it? (for example like getmobGID() but this function doesnt exist)

I've already encounter this get_monster_gid but the way I see it, I can only use its GID after I summon it, not when it dies.


TL;DR: Get a monster GID upon its death


 

Edited by aadritch2
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

store the GID to a variable upon summon it ....attach each monster with their own event to trigger upon death.

what you gonna do with the GID as the monster already died.... 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  04/29/13
  • Last Seen:  

I am working on something like a mob hunting npc. So I kind of want that when that particular summoned monster dies, it finishes the quest for the player who "owns" the monster. /heh
I cant really on mob class because it is possible for 2 players to have to spawn/hunt the same mob in the same map....

EDIT: an example of what i want to do:
         a.) A character ABC summons an mvp via NPC.
         b.) The mvp mob dies
         c.) How can I trace back character ABC, regardless of who killed the mob?

I sense, what I want is to "attach" the character's id to the "summoned mob" only. So when it dies, I use a variable to refer to "summoner" not the killer.

EDIT: Nevermind, figured out a way to detect which monster died. Thanks! /lv

Edited by aadritch2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...