How to create your own service mob or raid

Format: XML

Path: gameserver/data/npc/

Type: AI

Available AI: UniversalMystic, UniversalFighter
<set name="ai_type" value="UniversalMystic"/> or <set name="ai_type" value="UniversalFighter"/>

Example NPC:

XML:
  <npc id="20001" name="Gremlin" title="">
    <set name="aggroRange" value="0"/>
    <set name="ai_type" value="UniversalMystic"/>
    <set name="baseAtkRange" value="40"/>
    <set name="baseCON" value="43"/>
    <set name="baseCritRate" value="40"/>
    <set name="baseDEX" value="30"/>
    <set name="baseHpMax" value="39.745"/>
    <set name="baseHpRate" value="1"/>
    <set name="baseHpReg" value="2"/>
    <set name="baseINT" value="21"/>
    <set name="baseMAtk" value="3"/>
    <set name="baseMAtkSpd" value="333"/>
    <set name="baseMDef" value="30"/>
    <set name="baseMEN" value="20"/>
    <set name="baseMpMax" value="40"/>
    <set name="baseMpReg" value="0.9"/>
    <set name="basePAtk" value="9"/>
    <set name="basePAtkSpd" value="253"/>
    <set name="basePDef" value="40"/>
    <set name="baseRunSpd" value="50"/>
    <set name="baseSTR" value="40"/>
    <set name="baseShldDef" value="0"/>
    <set name="baseShldRate" value="0"/>
    <set name="baseWIT" value="20"/>
    <set name="baseWalkSpd" value="20"/>
    <set name="collision_height" value="15.0"/>
    <set name="collision_radius" value="10.0"/>
    <set name="level" value="1"/>
    <set name="rewardExp" value="29"/>
    <set name="rewardRp" value="0"/>
    <set name="rewardSp" value="2"/>
    <set name="shots" value="NONE"/>
    <set name="texture" value=""/>
    <set name="type" value="Monster"/>
    <ai_params>
      <set name="flagging_around_players_on_attack" value="true"/>
      <set name="give_to_party_items_reward" value="57;1;6673;1" />
    </ai_params>
    <skills/>
    <attributes>
      <defence attribute="fire" value="0"/>
      <defence attribute="water" value="0"/>
      <defence attribute="wind" value="0"/>
      <defence attribute="earth" value="0"/>
      <defence attribute="holy" value="0"/>
      <defence attribute="unholy" value="0"/>
    </attributes>
  </npc>

<set name="flagging_around_players_on_dead" value="true"/>Flag all players around when the mob or boss dies.
<set name="flagging_around_players_on_attack" value="true"/>Flag all players around when the mob or boss attacks.
<set name="give_nobles_on_main_class" value="true"/>Grant Noblesse status to all players in the party with the main class, who are level 76 or higher when they kill the boss/mob.
<set name="give_nobles_on_sub_class" value="true"/>Grant Noblesse status to all players in the party with the sub class, who are level 76 or higher when they kill the boss/mob.
<set name="give_to_party_premium_account_id" value="1"/>Grant the premium account ID to all players in the party when they kill the boss/mob.
<set name="give_to_party_custom_hero_time_hours" value="24"/>Grant the hero status to the entire party when they kill the boss/mob.
<set name="give_to_party_items_reward" value="57;1" />
<set name="give_to_party_items_reward_level_penalty" value="9" />
Grant items to the entire party when they kill the boss/mob.
Level penalty for item distribution from `give_to_party_items_reward` - default value 9
<set name="give_to_party_subclass_quests" value="true"/>Give the entire party a quest for a subclass
<set name="buff_party_reward" value="1243;6;1" />Apply a buff to the entire party when a mob dies. Description skill_id;skill_level;skill_time_multiplier
You can specify a set, you must specify all 3 parameters for each value="1243;6;1;1204;2;1"
<set name="give_pvp_point" value="1;100"/>Give pvp points to the entire party. 1(count);100(chance)
<set name="give_pk_point" value="1;100"/>Give pk points to the whole party 1(count);100(chance)
<set name="distribution_items_reward" value="57;1"/>
<set name="distribution_items_reward_level_penalty" value="9" />
<set name="distribution_items_reward_chance" value="100" />
Grant items to the entire CC/party/Solo when they kill the boss/mob.
Level penalty for item distribution from `distribution_items_reward_level_penalty` - default value 9
Chance to get an item - can be separated through ; each item from the array. If the quantity does not match - takes the last one

All of these conditions can be used separately or together for different NPC IDs.

If there are sensible suggestions - I will gladly listen and implement.
 
Last edited:
I would like to know if it’s possible to add all these conditions to the other ai_type as well, since some NPCs — especially the Epic Bosses — don’t allow changing the ai_type. I can’t set them as "UniversalFighter", which ends up being limiting.
for example:

<npc id="29020" name="Baium" title="L2 OldTime">
<!-- [baium] -->
<set name="aggroRange" value="1000"/>
<set name="ai_type" value="Baium"/>
.
.
.

<ai_params>
<set name="flagging_around_players_on_attack" value="true"/>
</ai_params>
 
Hello @Deazer quick question,

On this param, <set name="flagging_around_players_on_attack" value="true"/>

I guess that's a task that is being activated every some seconds, right? I mean like server obviously doesn't tick the flag on each hit cause it would create a flood. But I need some clarification about it.

Every how many seconds does it reactivate the task so it can flag the players again?
 
Hello @Deazer quick question,

On this param, <set name="flagging_around_players_on_attack" value="true"/>

I guess that's a task that is being activated every some seconds, right? I mean like server obviously doesn't tick the flag on each hit cause it would create a flood. But I need some clarification about it.

Every how many seconds does it reactivate the task so it can flag the players again?
on attack, yes. once per 3 sec if someone attacks the mob with this AI
 
on attack, yes. once per 3 sec if someone attacks the mob with this AI
In this case, I've conducted some tests regarding that and I've noticed that players were getting unflagged after the flag time was over and they would get flagged again after some seconds. Do you have any idea why this happens? If it was once per 3 seconds shouldn't they stay flagged for the entire time, assuming they were hitting the boss constantly?
 
In this case, I've conducted some tests regarding that and I've noticed that players were getting unflagged after the flag time was over and they would get flagged again after some seconds. Do you have any idea why this happens? If it was once per 3 seconds shouldn't they stay flagged for the entire time, assuming they were hitting the boss constantly?
The AI has a check to avoid flagging already flagged entities, perhaps this is overengineering. if it generally causes players inconvenience, I can remove this check and flag everyone around regardless of whether they are flagged or not. Overall, the operation is not that expensive.
 
The AI has a check to avoid flagging already flagged entities, perhaps this is overengineering. if it generally causes players inconvenience, I can remove this check and flag everyone around regardless of whether they are flagged or not. Overall, the operation is not that expensive.
Sounds like a good idea. Although it would be nice to set the timer (3 seconds) on the command itself so every server can have its own setting, for example <set name="flagging_around_players_on_attack" value="true" tick="3"/> or something similar.
 
Sounds like a good idea. Although it would be nice to set the timer (3 seconds) on the command itself so every server can have its own setting, for example <set name="flagging_around_players_on_attack" value="true" tick="3"/> or something similar.
This doesn't make sense, let's have a more workable idea. Flag everyone around without checking if they are flagged?
 
Well, if there's no risk regarding flood, you can ignore the check if already flagged and just update the already flagged players along with flagging non-flagged players within the range affected.

Also, another "issue" I've found (not related with this topic) is that Fun Zones with config to make flag inside, flags you on enter, being inside it is a chaotic zone, but after sometime you're getting unflagged. I know players can still hit you without CTRL but it would be awesome to implement in the config or inside the zone something like UpdateFlag="true" or MaintainFlag="true" so players no longer getting unflagged while inside the zone.
 
Back
Top