RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.activity.impl.VorkathActivity Class Reference

The activity for Vorkath. More...

Inheritance diagram for com.runehive.content.activity.impl.VorkathActivity:
Collaboration diagram for com.runehive.content.activity.impl.VorkathActivity:

Public Member Functions

boolean canTeleport (Player player)
 Called when the player attempts to teleport.
void cleanup ()
 Cleans up the activity when finished.
ActivityDeathType deathType ()
void finish ()
 Finishes the activity.
ActivityType getType ()
void onDeath (Mob mob)
 Called when the player die.
void onLogout (Player player)
 Called when the player logs out.
void onRegionChange (Player player)
 Called when the player changes region.
Public Member Functions inherited from com.runehive.content.activity.Activity
 Activity (int cooldown, int instance)
 Constructs a new SequencedMinigame object.
void add (Mob mob)
 Adds a mob to the activity.
boolean canDrinkPotions (Player player)
boolean canEat (Player player, FoodData foodType)
boolean canEquipItem (Player player, Item item, EquipmentType type)
boolean canLogout (Player player)
boolean canSpellCast (Player player)
boolean canUsePrayer (Player player)
boolean canUseSpecial (Player player)
void cooldown (int cooldown)
 Applies a cooldown.
int getInstance ()
 Gets this activity's instance level.
Optional< Activity_PanelgetPanel ()
 Gets an optional of the activity panel.
int getTicks ()
 Gets the current ticks.
boolean onEvent (Player player, InteractionEvent interactionEvent)
boolean onStep (Mob mob)
void remove (Mob mob)
 Removes a mob from the activity.
void removeAll (Mob... mobs)
 Removes all mobs from the activity.
void sequence ()
 Sequences the activity.
void setInstance (int instance)
void setPanel (Activity_Panel panel)
 Sets the activity panel.
void setPause (boolean pause)
 Sets the pause state of the activity.
void update ()
 The update method.

Static Public Member Functions

static VorkathActivity create (Player player)
 Creates a new Vorkath activity for the player.
Static Public Member Functions inherited from com.runehive.content.activity.Activity
static boolean evaluate (Mob mob, Predicate< Activity > predicate)
static void forActivity (Mob mob, Consumer< Activity > consumer)
static< T extends Activity > Optional< T > search (Player player, Class< T > clazz)

Protected Member Functions

boolean clickNpc (Player player, NpcInteractionEvent event)
void start ()
 Starts the next activity stage.
Protected Member Functions inherited from com.runehive.content.activity.Activity
boolean clickButton (Player player, ClickButtonInteractionEvent event)
boolean clickItem (Player player, ItemInteractionEvent event)
boolean clickObject (Player player, ObjectInteractionEvent event)
final void finishCooldown ()
 Sets the cooldown flag to FINISH.
Optional<? extends ActivityListener<? extends Activity > > getListener ()
 Gets an Optional of the ActivityListener for this activity.
final boolean isPaused ()
 Checks if the cooldown is paused.
boolean itemContainerAction (Player player, ItemContainerInteractionEvent event)
final void pause ()
 Sets the cooldown flag to PAUSE.
boolean pickupItem (Player player, PickupItemInteractionEvent event)
final void resetCooldown ()
 Resets the remaining ticks to the cached cooldown ticks.
void restart (int delay, Runnable runnable)
boolean useItem (Player player, ItemOnItemInteractionEvent event)
boolean useItem (Player player, ItemOnObjectInteractionEvent event)

Private Member Functions

 VorkathActivity (Player player, int instance)
 Constructs a new VorkathActivity.

Private Attributes

final Player player
 The player instance for the activity.
boolean summoned
 Flag if Vorkath has been summoned.
Npc vorkath = new Npc(8059, new Position(2269, 4062))
 The Vorkath npc instance.

Additional Inherited Members

Static Protected Attributes inherited from com.runehive.content.activity.Activity
static final int FINISH = -1
 The 'finish' cooldown id.
static final int PAUSE = -2
 The 'pause' cooldown id.
static final int START = 0
 The 'start' cooldown id.

Detailed Description

The activity for Vorkath.

Author
Daniel.

Definition at line 24 of file VorkathActivity.java.

Constructor & Destructor Documentation

◆ VorkathActivity()

com.runehive.content.activity.impl.VorkathActivity.VorkathActivity ( Player player,
int instance )
private

Constructs a new VorkathActivity.

Definition at line 36 of file VorkathActivity.java.

36 {
37 super(1, instance);
38 this.player = player;
39 }

References com.runehive.content.activity.Activity.instance, and player.

Referenced by create().

Here is the caller graph for this function:

Member Function Documentation

◆ canTeleport()

boolean com.runehive.content.activity.impl.VorkathActivity.canTeleport ( Player player)

Called when the player attempts to teleport.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 138 of file VorkathActivity.java.

138 {
139 return true;
140 }

References player.

◆ cleanup()

void com.runehive.content.activity.impl.VorkathActivity.cleanup ( )

Cleans up the activity when finished.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 81 of file VorkathActivity.java.

81 {
82 remove(vorkath);
83 }

References vorkath.

Referenced by finish(), onLogout(), and onRegionChange().

Here is the caller graph for this function:

◆ clickNpc()

boolean com.runehive.content.activity.impl.VorkathActivity.clickNpc ( Player player,
NpcInteractionEvent event )
protected

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 86 of file VorkathActivity.java.

86 {
87 if (event.getOpcode() == 0 && event.getNpc().id == 8059 && !summoned) {
88 summoned = true;
89 player.animate(827);
90 vorkath.animate(7950);
91
92 World.schedule(7, () -> {
93 vorkath.transform(8060, true);
94 World.schedule(1, () -> {
95 vorkath.face(player);
96 vorkath.blockInteract = false;
97 vorkath.blockFace = false;
98 vorkath.locking.unlock();
99 player.gameRecord.start();
100 });
101
102 });
103 return true;
104 }
105 return false;
106 }

References player, com.runehive.game.world.World.schedule(), summoned, and vorkath.

Here is the call graph for this function:

◆ create()

VorkathActivity com.runehive.content.activity.impl.VorkathActivity.create ( Player player)
static

Creates a new Vorkath activity for the player.

Definition at line 42 of file VorkathActivity.java.

42 {
43 VorkathActivity activity = new VorkathActivity(player, player.playerAssistant.instance());
44 activity.pause();
45 activity.add(player);
46 activity.add(activity.vorkath);
47 activity.vorkath.blockInteract = true;
48 activity.vorkath.blockFace = true;
49 activity.vorkath.locking.lock();
50 return activity;
51 }

References player, and VorkathActivity().

Referenced by finish(), and com.runehive.game.world.entity.mob.player.PlayerAssistant.setActivity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deathType()

ActivityDeathType com.runehive.content.activity.impl.VorkathActivity.deathType ( )

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 133 of file VorkathActivity.java.

133 {
134 return ActivityDeathType.PURCHASE;
135 }

References com.runehive.content.activity.ActivityDeathType.PURCHASE.

◆ finish()

void com.runehive.content.activity.impl.VorkathActivity.finish ( )

Finishes the activity.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 58 of file VorkathActivity.java.

58 {
59 boolean successfull = vorkath.isDead();
60
61 cleanup();
62 remove(player);
63
64 if (successfull) {
65 player.activityLogger.add(ActivityLog.VORKATH);
66 AchievementHandler.activate(player, AchievementKey.VORKATH);
67 player.message("Congratulations, you have killed the Vorkath. Fight duration: @red@" + Utility.getTime(player.gameRecord.end(ActivityType.VORKATH)) + "</col>.");
68
69
70 restart(10, () -> {
71 if (Area.inVorkath(player)) {
72 create(player);
73 } else {
74 remove(player);
75 }
76 });
77 }
78 }

References com.runehive.content.achievement.AchievementHandler.activate(), cleanup(), create(), com.runehive.util.Utility.getTime(), com.runehive.game.world.position.Area.inVorkath(), player, com.runehive.content.activity.Activity.restart(), com.runehive.content.achievement.AchievementKey.VORKATH, com.runehive.content.activity.ActivityType.VORKATH, com.runehive.content.ActivityLog.VORKATH, and vorkath.

Here is the call graph for this function:

◆ getType()

ActivityType com.runehive.content.activity.impl.VorkathActivity.getType ( )

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 143 of file VorkathActivity.java.

143 {
144 return ActivityType.VORKATH;
145 }

References com.runehive.content.activity.ActivityType.VORKATH.

◆ onDeath()

void com.runehive.content.activity.impl.VorkathActivity.onDeath ( Mob mob)

Called when the player die.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 115 of file VorkathActivity.java.

115 {
116 if (mob.isNpc() && mob.getNpc().equals(vorkath)) {
117 World.schedule(new NpcDeath(mob.getNpc(), this::finish));
118 return;
119 }
120
121 super.onDeath(mob);
122 }

References com.runehive.game.world.entity.mob.npc.Npc.equals(), com.runehive.game.world.entity.mob.Mob.getNpc(), com.runehive.game.world.entity.mob.Mob.isNpc(), com.runehive.game.world.World.schedule(), and vorkath.

Here is the call graph for this function:

◆ onLogout()

void com.runehive.content.activity.impl.VorkathActivity.onLogout ( Player player)

Called when the player logs out.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 109 of file VorkathActivity.java.

109 {
110 cleanup();
111 remove(player);
112 }

References cleanup(), and player.

Here is the call graph for this function:

◆ onRegionChange()

void com.runehive.content.activity.impl.VorkathActivity.onRegionChange ( Player player)

Called when the player changes region.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 125 of file VorkathActivity.java.

125 {
126 if (!Area.inVorkath(player)) {
127 cleanup();
128 remove(player);
129 }
130 }

References cleanup(), com.runehive.game.world.position.Area.inVorkath(), and player.

Here is the call graph for this function:

◆ start()

void com.runehive.content.activity.impl.VorkathActivity.start ( )
protected

Starts the next activity stage.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 54 of file VorkathActivity.java.

54 {
55 }

Member Data Documentation

◆ player

final Player com.runehive.content.activity.impl.VorkathActivity.player
private

The player instance for the activity.

Definition at line 27 of file VorkathActivity.java.

Referenced by canTeleport(), clickNpc(), create(), finish(), onLogout(), onRegionChange(), and VorkathActivity().

◆ summoned

boolean com.runehive.content.activity.impl.VorkathActivity.summoned
private

Flag if Vorkath has been summoned.

Definition at line 33 of file VorkathActivity.java.

Referenced by clickNpc().

◆ vorkath

Npc com.runehive.content.activity.impl.VorkathActivity.vorkath = new Npc(8059, new Position(2269, 4062))
private

The Vorkath npc instance.

Definition at line 30 of file VorkathActivity.java.

Referenced by cleanup(), clickNpc(), finish(), and onDeath().


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