Addition of Limited Sayha item handler.
Contributed by Mode.
This commit is contained in:
parent
6dce00307a
commit
5ae03cb588
@ -205,6 +205,7 @@ import handlers.itemhandlers.FishShots;
|
||||
import handlers.itemhandlers.Harvester;
|
||||
import handlers.itemhandlers.ItemSkills;
|
||||
import handlers.itemhandlers.ItemSkillsTemplate;
|
||||
import handlers.itemhandlers.LimitedSayha;
|
||||
import handlers.itemhandlers.Maps;
|
||||
import handlers.itemhandlers.MercTicket;
|
||||
import handlers.itemhandlers.NicknameColor;
|
||||
@ -553,6 +554,7 @@ public class MasterHandler
|
||||
Harvester.class,
|
||||
ItemSkills.class,
|
||||
ItemSkillsTemplate.class,
|
||||
LimitedSayha.class,
|
||||
Maps.class,
|
||||
MercTicket.class,
|
||||
NicknameColor.class,
|
||||
|
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
/**
|
||||
* @author Mode
|
||||
*/
|
||||
public class LimitedSayha implements IItemHandler
|
||||
{
|
||||
@Override
|
||||
public boolean useItem(Playable playable, ItemInstance item, boolean forceUse)
|
||||
{
|
||||
if (!playable.isPlayer())
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.YOUR_PET_CANNOT_CARRY_THIS_ITEM);
|
||||
return false;
|
||||
}
|
||||
|
||||
final PlayerInstance player = playable.getActingPlayer();
|
||||
long time = 0;
|
||||
switch (item.getId())
|
||||
{
|
||||
case 71899:
|
||||
{
|
||||
time = 86400000L * 30;
|
||||
break;
|
||||
}
|
||||
case 71900:
|
||||
{
|
||||
time = 86400000L * 1;
|
||||
break;
|
||||
}
|
||||
case 71901:
|
||||
{
|
||||
time = 86400000L * 7;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
time = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((time > 0) && player.setLimitedSayhaGraceEndTime(System.currentTimeMillis() + time))
|
||||
{
|
||||
player.destroyItem("LimitedSayha potion", item, 1, player, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage("Your Limited Sayha's Grace remaining time is greater than item's.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -601,6 +601,6 @@
|
||||
<set name="is_depositable" val="false" />
|
||||
<set name="is_sellable" val="false" />
|
||||
<set name="is_stackable" val="true" />
|
||||
<set name="time" val="43200" />
|
||||
<set name="handler" val="LimitedSayha" />
|
||||
</item>
|
||||
</list>
|
||||
|
@ -11,14 +11,7 @@
|
||||
<set name="is_depositable" val="false" />
|
||||
<set name="is_sellable" val="false" />
|
||||
<set name="is_stackable" val="true" />
|
||||
<set name="handler" val="ItemSkills" />
|
||||
<set name="commissionItemType" val="SCROLL_OTHER" />
|
||||
<cond addName="1" msgId="113">
|
||||
<player flyMounted="false" />
|
||||
</cond>
|
||||
<skills>
|
||||
<skill id="15678" level="1" /> <!-- Sayha's Blessing -->
|
||||
</skills>
|
||||
<set name="handler" val="LimitedSayha" />
|
||||
</item>
|
||||
<item id="71901" name="Limited Sayha's Blessing" additionalName="7-day" type="EtcItem">
|
||||
<!-- Double-click to get the Limited Sayha's effect for 7 d. If Sayha's Grace is inactive, Acquired XP/ SP +200%, adena's drop rate penalty is decreased. -->
|
||||
@ -31,7 +24,7 @@
|
||||
<set name="is_depositable" val="false" />
|
||||
<set name="is_sellable" val="false" />
|
||||
<set name="is_stackable" val="true" />
|
||||
<set name="time" val="10080" />
|
||||
<set name="handler" val="LimitedSayha" />
|
||||
</item>
|
||||
<item id="71905" name="Silver Strider Rider Scroll" type="EtcItem">
|
||||
<!-- A scroll to learn the skill to mount Silver Strider. -->
|
||||
|
@ -843,18 +843,18 @@
|
||||
<!-- Required level: 1-74. Sayha's Grace points +100%, Acquired XP/ SP +300%. The effect remains after death. Duration: 20 min. Cooldown: 1 min. Available if Sayha's Grace point bar is filled by more than one unit. -->
|
||||
<set name="icon" val="icon.ev_magic_flame_game_wind2" />
|
||||
<set name="default_action" val="SKILL_REDUCE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="is_tradable" val="false" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="is_sellable" val="false" />
|
||||
<set name="is_stackable" val="true" />
|
||||
<set name="handler" val="ItemSkills" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<cond msgId="1902">
|
||||
<player levelRange="1;75" />
|
||||
<player levelRange="1;74" />
|
||||
</cond>
|
||||
<skills>
|
||||
<skill id="54068" level="1" /> <!-- Sayha's Gust - Event -->
|
||||
<skill id="54068" level="1" /> <!-- Sayha's Gust -->
|
||||
</skills>
|
||||
</item>
|
||||
<item id="91777" name="Magic Fire" additionalName="Event" type="EtcItem">
|
||||
|
Loading…
Reference in New Issue
Block a user