How to work with pets

Deazer

Head Developer
Staff member
Format: XML
Location: data/stats/pets/
File: pet_data.xml
Schema: pet_data.dtd

Let's take the Wolf pet as an example and analyze its fields:

XML:
<pet id="12077" max_lvl="81"> <!-- Wolf -->
        <set name="control_item_id" value="2375"/>
        <set name="food_item_id" value="2515"/>
        <set name="is_wolf" value="true" />
        <set name="min_level" value="1"/>
        <set name="exp" value="0 636 798 1236 2158 3836 6598 10836 16998 25596 37198 52436 71998 96636 127158 164436 209398 263036 326398 400596 486798 586236 700198 830036 977158 1143036 1329198 1537236 1768798 2025596 2309398 2622036 2965398 3341436 3752158 4199636 4685998 5213436 5784198 6400596 7064998 7779836 8547598 9370836 10252158 11194236 12199798 13271636 14412598 15625596 17557599 19606656 21777399 24074556 26502939 29922294 33529819 37332294 41336619 45549814 52193622 59172334 66497022 74178934 82229502 93470612 105234462 117537012 130394462 143823252 157840062 176117249 198983024 226778887 259859867 298594764 352320714 412836202 480562077 555934039 639402879"/>
        <set name="hp" value="31 37 45 53 63 73 85 98 113 128 146 157 169 182 195 208 223 238 254 270 287 305 324 343 364 385 406 429 453 477 502 528 554 582 610 639 669 700 731 763 796 830 864 899 935 971 1008 1045 1084 1122 1161 1201 1240 1281 1321 1362 1403 1444 1485 1527 1568 1609 1651 1692 1732 1773 1813 1853 1892 1931 1969 2006 2043 2079 2114 2148 2182 2214 2245 2275 2304"/>
        <set name="hp_regen" value="2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9"/>
        <set name="mp" value="25 30 34 39 44 49 54 59 64 69 74 79 84 90 95 100 106 111 117 122 131 139 148 157 165 174 183 192 201 210 220 229 238 248 257 267 276 286 296 306 323 339 356 373 390 408 425 443 460 478 496 514 532 551 569 588 606 625 644 663 682 702 721 741 760 780 800 820 840 861 881 902 923 944 964 986 1007 1028 1050 1071 1073"/>
        <set name="mp_regen" value="1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4"/>
        <set name="p_atk" value="2 2 2 2 3 3 3 4 4 4 5 5 6 6 11 12 12 13 14 15 15 16 17 19 20 21 22 24 25 27 28 30 32 34 36 38 40 43 45 48 50 53 56 59 62 66 69 72 76 80 84 88 92 96 101 105 110 114 119 124 129 134 139 144 149 154 160 165 170 176 181 186 192 197 202 207 212 217 222 227 228"/>
        <set name="p_def" value="11 11 11 12 12 13 13 14 14 15 16 16 17 17 27 28 28 29 30 30 31 32 32 33 34 35 36 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 59 60 61 62 63 64 66 67 68 69 70 72 73 74 75 76 78 79 80 81 82 84 85 86 87 88 89 91 92 93 94 95"/>
        <set name="m_atk" value="1 1 1 1 2 2 2 2 3 3 3 3 4 4 5 5 5 6 6 7 8 8 9 10 11 11 12 13 14 15 16 18 19 20 22 23 25 26 28 30 31 33 35 37 40 42 44 47 49 52 54 57 60 63 66 69 72 75 78 82 85 88 92 95 99 103 106 110 113 117 121 124 128 132 135 139 142 146 149 152 153"/>
        <set name="m_def" value="8 8 8 9 9 9 10 10 10 11 11 12 12 13 13 13 14 14 15 15 16 16 17 18 18 19 19 20 21 21 22 22 23 24 25 25 26 27 27 28 29 30 30 31 32 33 34 34 35 36 37 38 39 40 40 41 42 43 44 45 46 47 47 48 49 50 51 52 53 54 55 55 56 57 58 59 60 60 61 62 63"/>
        <set name="accuracy" value="38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118"/>
        <set name="evasion" value="33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113"/>
        <set name="critical" value="40"/>
        <set name="speed" value="137"/>
        <set name="atk_speed" value="282"/>
        <set name="cast_speed" value="333"/>
        <set name="feed_max" value="248 244 320 400 512 624 704 808 872 948 1160 1168 1160 1160 1160 1148 1140 1132 1124 1116 1480 1512 1468 1552 1572 1604 1616 1644 1664 1684 2116 2172 2236 2288 2348 2408 2464 2520 2580 2636 3168 3236 3308 3380 3452 3524 3592 3668 3740 3596 4244 4364 4484 4600 4532 4672 4804 4932 5060 4928 5716 5892 6064 6228 6176 6368 6556 6740 6924 7108 7388 7688 7956 8196 8428 8704 8916 9124 9340 9552 9552"/>
        <set name="feed_normal" value="2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 5 6 6 5 7 7 7 7 7 7 8 8 8 8 9 9 10 10 10 10 10 11 11 11 12 12 13 13 14 14 14 15 15 15 15"/>
        <set name="feed_battle" value="2 2 2 3 4 5 5 6 7 7 9 9 9 9 9 9 9 9 9 9 12 12 12 12 13 13 13 13 13 14 17 18 18 19 19 20 20 21 21 21 26 26 27 28 28 29 29 30 31 29 35 36 37 38 37 38 40 41 42 41 47 49 50 51 51 53 54 56 57 59 61 64 66 68 70 72 74 76 77 79 79"/>
        <set name="max_load" value="0"/>
        <set name="add_feed" value="12"/>
        <set name="exp_penalty" value="0.30"/>
        <set name="soulshots" value="2"/>
        <set name="spiritshots" value="2"/>
    </pet>

Title:
<pet id="12077" max_lvl="81"> <!-- Wolf -->
id - ID of the specific pet that will be summoned
max_lvl - the maximum level a pet can get. 81 is level 80 and 100% exp.

Body:
control_item_id - the item with which the pet will be summoned
food_item_id - the item that will be consumed as food for this pet
is_wolf - what type the pet belongs to. Set of all types: is_baby_pet, is_wolf, is_great_wolf, is_hatchling,is_improved_baby_pet, is_strider, is_wyvern, is_improved_baby_buffalo, is_improved_baby_cougar, is_improved_baby_kookaburra
min_level - the minimum pet level it can reach. By default, the minimum pet level is taken from data/npc
exp - experience table for getting the next pet level
hp - health table by pet level
hp_regen - table of health regeneration by pet level
mp - mana table by pet level
mp_regen - table of mana regeneration by pet level
p_atk - table of physical attack by pet level
p_def - table of physical protection by pet level
m_atk - table of magical attack by pet level
m_def - table of magical protection by pet level
accuracy - table of damage accuracy by pet level
evasion - damage evasion table by pet level
critical - table of critical attack chance by pet level
speed - movement speed table by pet level
atk_speed - physical attack speed table by pet level
cast_speed - table of magic attack speed by pet level
feed_max - table of the maximum consumption of the pet food scale by levels
feed_normal - pet food consumption table in normal state - running, afk and so on
feed_battle - food bar consumption table when pet is in combat state
max_load - modifier of the weight carried by the pet. By default, it is calculated by the formula the same as that of the player.
add_feed - how many units of the food scale will be added when using food_item_id
exp_penalty - what percentage of the player's experience will be consumed by the pet. The default is 0.30 which is 30%
soulshots - the amount of consumed physical spirit charges
spiritshots - the amount of consumed magical spirit charges

Now let's move on to the skills of pets and their action Id which is in the game client
For example, take Hatchling of Wind
Code:
        <skills>
            <skill id="4710" level="0" min_lvl="1" action_id="1003"/>
            <skill id="4711" level="0" min_lvl="1" action_id="1004"/>
        </skills>

Where ability (skill) id is 4710 and level is level="0" and min_level - the pet's minimum level is attached to action id 1003 which is incremented in the game client in the actionname-e.dat file and appears in the pet's skill panel.

When you set level="0" the server automatically recalculates the level of the given skill based on the level of the pet. For every 10th level, if he has not reached level 70, + 1 skill level is add, after level 70, the calculation goes for every 5th level of the pet + 1 skill level (official like).

But you don't have to set level 0, you can describe the entire skill table with respect to level="Something of your own" directly to the pet.

At the moment, the entire system of pets and summoned creatures is taken out of the code as much as possible and now you can add any type and kind and their skills without describing them with scripts or writing your own extensions.

If you have any questions - please ask, if I forgot something - I will supplement.
 

Deazer

Head Developer
Staff member
Committed for Interlude, checked. Please, if there are any questions or problems, let me know immediately and I will immediately proceed with the review or corrections
A lot of work has been done, it is likely that I could have missed something or overlooked it. Thank you!
 
Top