Jump to content
  • 0

Getting the GID of a killed mob summoned via monster script


Question

Posted (edited)

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

2 answers to this question

Recommended Posts

  • 0
Posted

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.... 

  • 0
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...