Lord Ganja Posted November 14, 2015 Posted November 14, 2015 (edited) Is there any src or script that is triggered when a specific mob (specified by GID) is being attacked(received any kind of damage physical or magic type) ? or is attacking(attack players)? Edited November 14, 2015 by Lord Ganja Quote
0 Haziel Posted November 14, 2015 Posted November 14, 2015 I suppose you already know how to get a monster GID, so, you can try to use this method for specific monsters after it's summoned. 1 Quote
0 Lord Ganja Posted November 14, 2015 Author Posted November 14, 2015 (edited) I suppose you already know how to get a monster GID, so, you can try to use this method for specific monsters after it's summoned. Damn. Haven't think of that. Thanks. Anyway it uses Timer before comparing the current hp of the monster. I was thinking about creating an event "OnMobDamaged" and insert it on mob.c under mob_damage which is called when a mob received damage, but I don't want it to be triggered on all mobs. So I came up with an idea to filter the mob's attached event(e.g strnpcinfo(0)+"::OnThisMob).. All mobs that has an event label of "OnThisMob" will ONLY trigger the script. The thing is, I don't know how to filter the event name that is currently attached to a monster. I was trying to do it like this, but I knew it that it will fail since im noob at src. mob.c under mob_damage if( compare(npc_event,"OnThisMob") ) npc_script_event( md, NPCE_MOBDAMAGED ); can you help me how to filter and compare the event attached to the mob? Thanks in advance! Edited November 14, 2015 by Lord Ganja Quote
0 clydelion Posted November 17, 2015 Posted November 17, 2015 <map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} See the <event> field, that's what you are looking for. Quote
0 Lord Ganja Posted November 17, 2015 Author Posted November 17, 2015 <map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} See the <event> field, that's what you are looking for. Hi. clydelion, I was trying to filter the EVENT NAME that is currently attached to the monster but Idk how to do it. I was about to create an npcevent that is triggered when a mob received damage. OnMobDamagedEvent, just like OnNPCKillEvent but this time when the mob only receive damage. And I don't want all mobs to trigger it coz it might cause server lag. So I was trying to create that event to only trigger to the monsters that has attached OnThisMob event label to trigger OnMobDamagedEvent.. e.g monster "prontera",150,150,"Poring",1002,1,"Test::OnThisMob"; ^ when this poring received any damage, the OnMobDamagedEvent will be triggered. but for the normal porings without OnThisMob event label, it won't be triggered. Can you give me ideas how to make this work? Quote
0 Stolao Posted November 17, 2015 Posted November 17, 2015 <map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} See the <event> field, that's what you are looking for. Hi. clydelion, I was trying to filter the EVENT NAME that is currently attached to the monster but Idk how to do it. I was about to create an npcevent that is triggered when a mob received damage. OnMobDamagedEvent, just like OnNPCKillEvent but this time when the mob only receive damage. And I don't want all mobs to trigger it coz it might cause server lag. So I was trying to create that event to only trigger to the monsters that has attached OnThisMob event label to trigger OnMobDamagedEvent.. e.g monster "prontera",150,150,"Poring",1002,1,"Test::OnThisMob"; ^ when this poring received any damage, the OnMobDamagedEvent will be triggered. but for the normal porings without OnThisMob event label, it won't be triggered. Can you give me ideas how to make this work? You would have to replace all your proings with ones that have this label its not hard Quote
0 Lord Ganja Posted November 17, 2015 Author Posted November 17, 2015 You would have to replace all your proings with ones that have this label its not hard Hi. Stolao, what do you mean by replace all porings? Quote
0 Stolao Posted November 17, 2015 Posted November 17, 2015 disable mob spawns for poring and add versions that have your event label attached.. Quote
0 Lord Ganja Posted November 17, 2015 Author Posted November 17, 2015 disable mob spawns for poring and add versions that have your event label attached.. I mean, the event will be triggered after the poring is killed right? I need an event npc that is triggered when the mob received damage or got hit/attacked(physical or magical damage) Quote
0 clydelion Posted November 18, 2015 Posted November 18, 2015 Clue: npc_event(mvp_sd,md->npc_event,0); What I would do if I were you: 1. Make a new scriptcommand so you don't have to edit every script that uses *monster script command. 2. Add a new char in mob_data struct, or just a flag to indicate that it is a OnMobAttacked event. 3. Look into battle.c to force run the script everytime it encounters a flagged attack. Quote
0 Lord Ganja Posted November 18, 2015 Author Posted November 18, 2015 Clue: npc_event(mvp_sd,md->npc_event,0); What I would do if I were you: 1. Make a new scriptcommand so you don't have to edit every script that uses *monster script command. 2. Add a new char in mob_data struct, or just a flag to indicate that it is a OnMobAttacked event. 3. Look into battle.c to force run the script everytime it encounters a flagged attack. Can you give me more clue about this? I'm just actually bad at src. I can create some scripts but just based from other scripts. So kinda like copy paste stuff XD Thanks btw. Quote
Question
Lord Ganja
Is there any src or script that is triggered when a specific mob (specified by GID) is being attacked(received any kind of damage physical or magic type) ? or is attacking(attack players)?
Edited by Lord Ganja11 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.