RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.net.packet.out.SendSkill Class Reference

Sends a skill to a client. More...

Inheritance diagram for com.runehive.net.packet.out.SendSkill:
Collaboration diagram for com.runehive.net.packet.out.SendSkill:

Public Member Functions

boolean encode (Player player)
 SendSkill (int id, int level, int experience)
 SendSkill (Skill skill)
Public Member Functions inherited from com.runehive.net.packet.OutgoingPacket
void execute (Player player)
 OutgoingPacket (int opcode, int capacity)
 OutgoingPacket (int opcode, PacketType type)
 OutgoingPacket (int opcode, PacketType type, int size)

Private Attributes

final int experience
final int id
final int level

Additional Inherited Members

Protected Attributes inherited from com.runehive.net.packet.OutgoingPacket
final PacketBuilder builder

Detailed Description

Sends a skill to a client.

Author
Michael | Chex

Definition at line 13 of file SendSkill.java.

Constructor & Destructor Documentation

◆ SendSkill() [1/2]

com.runehive.net.packet.out.SendSkill.SendSkill ( int id,
int level,
int experience )

Definition at line 19 of file SendSkill.java.

19 {
20 super(134, 6);
21 this.id = id;
22 this.level = level;
23 this.experience = experience;
24 }

References experience, id, and level.

◆ SendSkill() [2/2]

com.runehive.net.packet.out.SendSkill.SendSkill ( Skill skill)

Definition at line 26 of file SendSkill.java.

26 {
27 this(skill.getSkill(), skill.getLevel(), skill.getRoundedExperience());
28 }

References com.runehive.game.world.entity.skill.Skill.getLevel(), com.runehive.game.world.entity.skill.Skill.getRoundedExperience(), and com.runehive.game.world.entity.skill.Skill.getSkill().

Here is the call graph for this function:

Member Function Documentation

◆ encode()

boolean com.runehive.net.packet.out.SendSkill.encode ( Player player)

Reimplemented from com.runehive.net.packet.OutgoingPacket.

Definition at line 31 of file SendSkill.java.

31 {
32 final int color = player.settings.prestigeColors ? player.prestige.getPrestigeColor(id) : 0xFFFF00;
33 player.send(new SendColor(Skill.INTERFACE_DATA[id][0], color));
34 player.send(new SendColor(Skill.INTERFACE_DATA[id][1], color));
35 builder.writeByte(id)
36 .writeInt(experience, ByteOrder.ME)
37 .writeByte(level);
38 return true;
39 }

References com.runehive.net.packet.OutgoingPacket.builder, experience, com.runehive.content.prestige.Prestige.getPrestigeColor(), com.runehive.game.world.entity.skill.Skill.INTERFACE_DATA, level, com.runehive.net.codec.ByteOrder.ME, com.runehive.game.world.entity.mob.player.Player.prestige, and com.runehive.game.world.entity.mob.player.Player.send().

Here is the call graph for this function:

Member Data Documentation

◆ experience

final int com.runehive.net.packet.out.SendSkill.experience
private

Definition at line 17 of file SendSkill.java.

Referenced by encode(), and SendSkill().

◆ id

final int com.runehive.net.packet.out.SendSkill.id
private

Definition at line 15 of file SendSkill.java.

Referenced by SendSkill().

◆ level

final int com.runehive.net.packet.out.SendSkill.level
private

Definition at line 16 of file SendSkill.java.

Referenced by encode(), and SendSkill().


The documentation for this class was generated from the following file: