Add sand to daily task indicator

This commit is contained in:
ShaunDreclin
2018-09-02 12:59:36 -04:00
parent f00a2aac39
commit e207106e29
3 changed files with 40 additions and 0 deletions

View File

@@ -346,6 +346,11 @@ public enum Varbits
KINGDOM_COFFER(74),
THRONE_OF_MISCELLANIA_QUEST(359),
/**
* The Hand in the Sand quest status
*/
QUEST_THE_HAND_IN_THE_SAND(1527),
/**
* Daily Tasks (Collection availability)
*/
@@ -353,6 +358,7 @@ public enum Varbits
DAILY_STAVES_COLLECTED(4539),
DAILY_ESSENCE_COLLECTED(4547),
DAILY_RUNES_COLLECTED(4540),
DAILY_SAND_COLLECTED(4549),
/**
* Fairy Ring

View File

@@ -76,4 +76,15 @@ public interface DailyTasksConfig extends Config
{
return true;
}
@ConfigItem(
position = 5,
keyName = "showSand",
name = "Show Claimable Sand",
description = "Show a message when you can collect your daily sand from Bert."
)
default boolean showSand()
{
return true;
}
}

View File

@@ -64,6 +64,9 @@ public class DailyTasksPlugin extends Plugin
private static final String RUNES_MESSAGE = "You have random runes waiting to be collected from Lundail.";
private static final String SAND_MESSAGE = "You have sand waiting to be collected from Bert.";
private static final int SAND_QUEST_COMPLETE = 160;
private static final String RELOG_MESSAGE = " (Requires relog)";
@Inject
@@ -133,6 +136,11 @@ public class DailyTasksPlugin extends Plugin
{
checkRunes(dailyReset);
}
if (config.showSand())
{
checkSand(dailyReset);
}
}
}
@@ -197,6 +205,21 @@ public class DailyTasksPlugin extends Plugin
}
}
private void checkSand(boolean dailyReset)
{
if (client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE)
{
if (client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0)
{
sendChatMessage(SAND_MESSAGE);
}
else if (dailyReset)
{
sendChatMessage(SAND_MESSAGE + RELOG_MESSAGE);
}
}
}
private void sendChatMessage(String chatMessage)
{
final String message = new ChatMessageBuilder()