actual freya branch
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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 custom.HeroWeapon;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
|
||||
public class HeroWeapon extends Quest
|
||||
{
|
||||
private final static int[] npcIds =
|
||||
{
|
||||
31690,31769,31770,31771,31772
|
||||
};
|
||||
|
||||
private final static int[] weaponIds =
|
||||
{
|
||||
6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,9388,9389,9390
|
||||
};
|
||||
|
||||
public HeroWeapon(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
for (int i : npcIds)
|
||||
{
|
||||
addStartNpc(i);
|
||||
addTalkId(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
|
||||
int weaponId = Integer.valueOf(event);
|
||||
if (Util.contains(weaponIds, weaponId))
|
||||
st.giveItems(weaponId, 1);
|
||||
|
||||
st.exitQuest(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
newQuestState(player);
|
||||
|
||||
if (player.isHero())
|
||||
{
|
||||
if (hasHeroWeapon(player))
|
||||
{
|
||||
htmltext = "already_have_weapon.htm";
|
||||
st.exitQuest(true);
|
||||
}
|
||||
else
|
||||
htmltext = "weapon_list.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "no_hero.htm";
|
||||
st.exitQuest(true);
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private boolean hasHeroWeapon(L2PcInstance player)
|
||||
{
|
||||
for (int i : weaponIds)
|
||||
{
|
||||
if (player.getInventory().getItemByItemId(i) != null)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new HeroWeapon(-1, "HeroWeapon", "custom");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Monument of Heroes:<br>
|
||||
You've already received a weapon and cannot have another one.<br>
|
||||
<a action="bypass -h npc_%objectId%_Chat 0">Back</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Monument of Heroes:<br>
|
||||
You do not meet the requirements. You must become a Hero first!<br>
|
||||
<a action="bypass -h npc_%objectId%_Chat 0">Back</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<html><body>Monument of Heroes:<br>
|
||||
You are eligible to wield these weapons. Choose only one of the following 14 weapons. Be sure to choose wisely -- you cannot change weapons once you have made your selection!<br>
|
||||
<a action="bypass -h Quest HeroWeapon 6611" msg="1484;">Infinity Blade (One-Handed Sword).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6612" msg="1484;">Infinity Cleaver (Two-Handed Sword).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6613" msg="1484;">Infinity Axe (One-Handed Blunt Weapon).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6614" msg="1484;">Infinity Rod (One-Handed Blunt Weapon).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6615" msg="1484;">Infinity Crusher (Two-Handed Blunt Weapon).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6616" msg="1484;">Infinity Scepter (Two-Handed Staff).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6617" msg="1484;">Infinity Stringer (Dagger).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6618" msg="1484;">Infinity Fang (Fist Weapon).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6619" msg="1484;">Infinity Bow (Bow).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6620" msg="1484;">Infinity Wing (Dualsword).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 6621" msg="1484;">Infinity Spear (Pole Arm).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 9388" msg="2234;">Infinity Rapier (Kamael-Exclusive Short Sword).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 9389" msg="2234;">Infinity Sword (Kamael-Exclusive Ancient Sword).</a><br>
|
||||
<a action="bypass -h Quest HeroWeapon 9390" msg="2234;">Infinity Shooter (Kamael-Exclusive Crossbow).</a>
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user