Skip to content

effect_spec_server_packet

EffectSpecServerPacket

Bases: Packet

Taking spike or tp drain damage

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
class EffectSpecServerPacket(Packet):
    """
    Taking spike or tp drain damage
    """
    _byte_size: int = 0
    _map_damage_type: MapDamageType = None # type: ignore [assignment]
    _map_damage_type_data: 'EffectSpecServerPacket.MapDamageTypeData' = None

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def map_damage_type(self) -> MapDamageType:
        return self._map_damage_type

    @map_damage_type.setter
    def map_damage_type(self, map_damage_type: MapDamageType) -> None:
        self._map_damage_type = map_damage_type

    @property
    def map_damage_type_data(self) -> 'EffectSpecServerPacket.MapDamageTypeData':
        """
        EffectSpecServerPacket.MapDamageTypeData: Gets or sets the data associated with the `map_damage_type` field.
        """
        return self._map_damage_type_data

    @map_damage_type_data.setter
    def map_damage_type_data(self, map_damage_type_data: 'EffectSpecServerPacket.MapDamageTypeData') -> None:
        self._map_damage_type_data = map_damage_type_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    def write(self, writer):
        """
        Serializes and writes this packet to the provided EoWriter.

        Args:
            writer (EoWriter): the writer that this packet will be written to.
        """
        EffectSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket): The data to serialize.
        """
        if data._map_damage_type is None:
            raise SerializationError("map_damage_type must be provided.")
        writer.add_char(int(data._map_damage_type))
        if data._map_damage_type == MapDamageType.TpDrain:
            if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataTpDrain):
                raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataTpDrain for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
            EffectSpecServerPacket.MapDamageTypeDataTpDrain.serialize(writer, data._map_damage_type_data)
        elif data._map_damage_type == MapDamageType.Spikes:
            if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataSpikes):
                raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataSpikes for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
            EffectSpecServerPacket.MapDamageTypeDataSpikes.serialize(writer, data._map_damage_type_data)

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket":
        """
        Deserializes an instance of `EffectSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket: The data to serialize.
        """
        data: EffectSpecServerPacket = EffectSpecServerPacket()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._map_damage_type = MapDamageType(reader.get_char())
            if data._map_damage_type == MapDamageType.TpDrain:
                data._map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataTpDrain.deserialize(reader)
            elif data._map_damage_type == MapDamageType.Spikes:
                data._map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataSpikes.deserialize(reader)
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectSpecServerPacket(byte_size={repr(self._byte_size)}, map_damage_type={repr(self._map_damage_type)}, map_damage_type_data={repr(self._map_damage_type_data)})"

    MapDamageTypeData = Union['EffectSpecServerPacket.MapDamageTypeDataTpDrain', 'EffectSpecServerPacket.MapDamageTypeDataSpikes', None]
    MapDamageTypeData.__doc__ = \
        """
        Data associated with different values of the `map_damage_type` field.
        """

    class MapDamageTypeDataTpDrain:
        """
        Data associated with map_damage_type value MapDamageType.TpDrain
        """
        _byte_size: int = 0
        _tp_damage: int = None # type: ignore [assignment]
        _tp: int = None # type: ignore [assignment]
        _max_tp: int = None # type: ignore [assignment]

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size

        @property
        def tp_damage(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._tp_damage

        @tp_damage.setter
        def tp_damage(self, tp_damage: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._tp_damage = tp_damage

        @property
        def tp(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._tp

        @tp.setter
        def tp(self, tp: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._tp = tp

        @property
        def max_tp(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._max_tp

        @max_tp.setter
        def max_tp(self, max_tp: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._max_tp = max_tp

        @staticmethod
        def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
            """
            Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
            """
            if data._tp_damage is None:
                raise SerializationError("tp_damage must be provided.")
            writer.add_short(data._tp_damage)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)

        @staticmethod
        def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
            """
            Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
            """
            data: EffectSpecServerPacket.MapDamageTypeDataTpDrain = EffectSpecServerPacket.MapDamageTypeDataTpDrain()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._tp_damage = reader.get_short()
                data._tp = reader.get_short()
                data._max_tp = reader.get_short()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"EffectSpecServerPacket.MapDamageTypeDataTpDrain(byte_size={repr(self._byte_size)}, tp_damage={repr(self._tp_damage)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)})"

    class MapDamageTypeDataSpikes:
        """
        Data associated with map_damage_type value MapDamageType.Spikes
        """
        _byte_size: int = 0
        _hp_damage: int = None # type: ignore [assignment]
        _hp: int = None # type: ignore [assignment]
        _max_hp: int = None # type: ignore [assignment]

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size

        @property
        def hp_damage(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._hp_damage

        @hp_damage.setter
        def hp_damage(self, hp_damage: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._hp_damage = hp_damage

        @property
        def hp(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._hp

        @hp.setter
        def hp(self, hp: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._hp = hp

        @property
        def max_hp(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._max_hp

        @max_hp.setter
        def max_hp(self, max_hp: int) -> None:
            """
            Note:
              - Value range is 0-64008.
            """
            self._max_hp = max_hp

        @staticmethod
        def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
            """
            Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
            """
            if data._hp_damage is None:
                raise SerializationError("hp_damage must be provided.")
            writer.add_short(data._hp_damage)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)

        @staticmethod
        def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
            """
            Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
            """
            data: EffectSpecServerPacket.MapDamageTypeDataSpikes = EffectSpecServerPacket.MapDamageTypeDataSpikes()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._hp_damage = reader.get_short()
                data._hp = reader.get_short()
                data._max_hp = reader.get_short()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"EffectSpecServerPacket.MapDamageTypeDataSpikes(byte_size={repr(self._byte_size)}, hp_damage={repr(self._hp_damage)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

map_damage_type: MapDamageType property writable

map_damage_type_data: EffectSpecServerPacket.MapDamageTypeData property writable

EffectSpecServerPacket.MapDamageTypeData: Gets or sets the data associated with the map_damage_type field.

MapDamageTypeData = Union['EffectSpecServerPacket.MapDamageTypeDataTpDrain', 'EffectSpecServerPacket.MapDamageTypeDataSpikes', None] class-attribute instance-attribute

MapDamageTypeDataTpDrain

Data associated with map_damage_type value MapDamageType.TpDrain

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
class MapDamageTypeDataTpDrain:
    """
    Data associated with map_damage_type value MapDamageType.TpDrain
    """
    _byte_size: int = 0
    _tp_damage: int = None # type: ignore [assignment]
    _tp: int = None # type: ignore [assignment]
    _max_tp: int = None # type: ignore [assignment]

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def tp_damage(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._tp_damage

    @tp_damage.setter
    def tp_damage(self, tp_damage: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._tp_damage = tp_damage

    @property
    def tp(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._tp

    @tp.setter
    def tp(self, tp: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._tp = tp

    @property
    def max_tp(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._max_tp

    @max_tp.setter
    def max_tp(self, max_tp: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._max_tp = max_tp

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
        """
        if data._tp_damage is None:
            raise SerializationError("tp_damage must be provided.")
        writer.add_short(data._tp_damage)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
        """
        Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
        """
        data: EffectSpecServerPacket.MapDamageTypeDataTpDrain = EffectSpecServerPacket.MapDamageTypeDataTpDrain()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._tp_damage = reader.get_short()
            data._tp = reader.get_short()
            data._max_tp = reader.get_short()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectSpecServerPacket.MapDamageTypeDataTpDrain(byte_size={repr(self._byte_size)}, tp_damage={repr(self._tp_damage)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

tp_damage: int property writable

Note
  • Value range is 0-64008.

tp: int property writable

Note
  • Value range is 0-64008.

max_tp: int property writable

Note
  • Value range is 0-64008.

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapDamageTypeDataTpDrain

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
    """
    if data._tp_damage is None:
        raise SerializationError("tp_damage must be provided.")
    writer.add_short(data._tp_damage)
    if data._tp is None:
        raise SerializationError("tp must be provided.")
    writer.add_short(data._tp)
    if data._max_tp is None:
        raise SerializationError("max_tp must be provided.")
    writer.add_short(data._max_tp)

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MapDamageTypeDataTpDrain

EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
    """
    Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
    """
    data: EffectSpecServerPacket.MapDamageTypeDataTpDrain = EffectSpecServerPacket.MapDamageTypeDataTpDrain()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._tp_damage = reader.get_short()
        data._tp = reader.get_short()
        data._max_tp = reader.get_short()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapDamageTypeDataSpikes

Data associated with map_damage_type value MapDamageType.Spikes

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
class MapDamageTypeDataSpikes:
    """
    Data associated with map_damage_type value MapDamageType.Spikes
    """
    _byte_size: int = 0
    _hp_damage: int = None # type: ignore [assignment]
    _hp: int = None # type: ignore [assignment]
    _max_hp: int = None # type: ignore [assignment]

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def hp_damage(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._hp_damage

    @hp_damage.setter
    def hp_damage(self, hp_damage: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._hp_damage = hp_damage

    @property
    def hp(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._hp

    @hp.setter
    def hp(self, hp: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._hp = hp

    @property
    def max_hp(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._max_hp

    @max_hp.setter
    def max_hp(self, max_hp: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._max_hp = max_hp

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
        """
        if data._hp_damage is None:
            raise SerializationError("hp_damage must be provided.")
        writer.add_short(data._hp_damage)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
        """
        Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
        """
        data: EffectSpecServerPacket.MapDamageTypeDataSpikes = EffectSpecServerPacket.MapDamageTypeDataSpikes()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._hp_damage = reader.get_short()
            data._hp = reader.get_short()
            data._max_hp = reader.get_short()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectSpecServerPacket.MapDamageTypeDataSpikes(byte_size={repr(self._byte_size)}, hp_damage={repr(self._hp_damage)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

hp_damage: int property writable

Note
  • Value range is 0-64008.

hp: int property writable

Note
  • Value range is 0-64008.

max_hp: int property writable

Note
  • Value range is 0-64008.

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket.MapDamageTypeDataSpikes to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapDamageTypeDataSpikes

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
    """
    if data._hp_damage is None:
        raise SerializationError("hp_damage must be provided.")
    writer.add_short(data._hp_damage)
    if data._hp is None:
        raise SerializationError("hp must be provided.")
    writer.add_short(data._hp)
    if data._max_hp is None:
        raise SerializationError("max_hp must be provided.")
    writer.add_short(data._max_hp)

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket.MapDamageTypeDataSpikes from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MapDamageTypeDataSpikes

EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
    """
    Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
    """
    data: EffectSpecServerPacket.MapDamageTypeDataSpikes = EffectSpecServerPacket.MapDamageTypeDataSpikes()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._hp_damage = reader.get_short()
        data._hp = reader.get_short()
        data._max_hp = reader.get_short()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

family() staticmethod

Returns the packet family associated with this packet.

Returns:

Name Type Description
PacketFamily PacketFamily

The packet family associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
52
53
54
55
56
57
58
59
60
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

action() staticmethod

Returns the packet action associated with this packet.

Returns:

Name Type Description
PacketAction PacketAction

The packet action associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
62
63
64
65
66
67
68
69
70
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
72
73
74
75
76
77
78
79
def write(self, writer):
    """
    Serializes and writes this packet to the provided EoWriter.

    Args:
        writer (EoWriter): the writer that this packet will be written to.
    """
    EffectSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket): The data to serialize.
    """
    if data._map_damage_type is None:
        raise SerializationError("map_damage_type must be provided.")
    writer.add_char(int(data._map_damage_type))
    if data._map_damage_type == MapDamageType.TpDrain:
        if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataTpDrain):
            raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataTpDrain for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
        EffectSpecServerPacket.MapDamageTypeDataTpDrain.serialize(writer, data._map_damage_type_data)
    elif data._map_damage_type == MapDamageType.Spikes:
        if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataSpikes):
            raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataSpikes for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
        EffectSpecServerPacket.MapDamageTypeDataSpikes.serialize(writer, data._map_damage_type_data)

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Name Type Description
EffectSpecServerPacket EffectSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket":
    """
    Deserializes an instance of `EffectSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket: The data to serialize.
    """
    data: EffectSpecServerPacket = EffectSpecServerPacket()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._map_damage_type = MapDamageType(reader.get_char())
        if data._map_damage_type == MapDamageType.TpDrain:
            data._map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataTpDrain.deserialize(reader)
        elif data._map_damage_type == MapDamageType.Spikes:
            data._map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataSpikes.deserialize(reader)
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode