L2JMobius

Dwelling of Spirits Daily Hunting Missions

Rovenzard · 1 · 3516

Offline Rovenzard

  • Vassal
  • *
    • Posts: 9
Currently the daily hunting missions are updated whenever a player kills a monster of the appropriate range no matter if the mission is considered locked, if the previous one in chain (Daily Hunting I, II, III...) is completed or if the player meets level requierement.

To sovle the later I added a condition check to function onAttackableKill in MonsterDailyMissionHandler.java

Code: [Select]
final PlayerInstance player = event.getAttacker();
if ((player.getLevel() < _minLevel) || (player.getLevel() > _maxLevel))
{
return;
}

As for the status check of previous mission, my idea so far is to add a new attribute in DailyMisssion.xsd

Code: [Select]
<xs:attribute type="xs:int" name="previousRewardID" />

Which will be a new param in DailyMission.xml, taking the id of previous reward in chain or null if it's the first in chain.

Back to MonsterDailyMissionHandler.java, adding the following

Code: [Select]
...
private final int _status;
...
_status = holder.getParams().getInt("previousRewardID");
...

Then my idea of implementation would be to check if _status is not null (not Daily Hunting I), then check if status of reward id is not 3 in database (so previous mission not completed) then return.

Am not sure if it'd be the proper way of doing it, I've only been messing around these projects for about a week, so any feedback is welcome!