Lord Ganja Posted November 14, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Share 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 Link to comment Share on other sites More sharing options...
0 Haziel Posted November 14, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share 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 Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 14, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 16, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share Posted November 16, 2015 bump** Quote Link to comment Share on other sites More sharing options...
0 clydelion Posted November 17, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share 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 Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 17, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 Stolao Posted November 17, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: April 9 Share 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 Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 17, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 Stolao Posted November 17, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: April 9 Share Posted November 17, 2015 disable mob spawns for poring and add versions that have your event label attached.. Quote Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 17, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 clydelion Posted November 18, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share 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 Link to comment Share on other sites More sharing options...
0 Lord Ganja Posted November 18, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
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 GanjaLink to comment
Share on other sites
11 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.