This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You have already received the Apprentice Adventurer's Weapon Exchange Coupon! Trying to trick me, eh? Don't underestimate my memory for faces! (Each character may only receive 1 Apprentice Adventurer's Weapon Exchange Coupon.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Newbie Guide:<br>
Here is the Apprentice Adventurer's Weapon Exchange Coupon.<br>
You can exchange this ticket for the No-Grade Shadow Weapon from the Adventure Guild warehouse. Keep in mind that this Exchange Coupon is reserved only for you. Should you lose either the ticket or the weapon you borrowed, you cannot get a new one. Guard it carefully! You can use the weapon warehouse if you visit the Newbie Guide in each town. I wish you a pleasant and prosperous journey!
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You are not eligible to have the Apprentice Adventurer's Weapon Exchange Coupon! It is reserved especially for new adventurers who are visiting the world of Lineage 2 for the first time. You may not receive the Exchange Coupon if your level is under 6 or you have completed an occupation change. (Only beginners who are between <font color="LEVEL">level 6 and level 19</font> may use it.)
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You have already received the Apprentice Adventurer's Armor Exchange Coupon! Trying to trick me, eh? Don't underestimate my memory for faces! (Each character may only receive 1 Apprentice Adventurer's Armor Exchange Coupon.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Newbie Guide:<br>
Here is the Apprentice Adventurer's Armor Exchange Coupon.<br>
You can exchange this ticket for the No-Grade Shadow Armor from the Adventure Guild warehouse. Keep in mind that this Exchange Coupon is reserved only for you. Should you lose either the ticket or the weapon you borrowed, you cannot get a new one. Guard it carefully! You can use the weapon warehouse if you visit the Newbie Guide in each town. I wish you a pleasant and prosperous journey!
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You are not eligible to receive the Apprentice Adventurer's Armor Exchange Coupon! It is reserved for new adventurers visiting the world of Lineage 2 for the first time. Even then, you can not receive the ticket unless you have completed the first occupation change! (Only beginners who have <font color="LEVEL">completed the first occupation change</font> may use it.)
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You are not eligible to use the warehouse. You may not receive the Exchange Coupon if your level is under 6 or you have completed an occupation change. (Only beginners who are between <font color="LEVEL">level 6 and level 19</font> may use the warehouse.)
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Newbie Guide:<br>
You are not eligible to use the warehouse. You must complete your first class change! (Only <font color="LEVEL">beginners who have completed the first class change</font> may use the warehouse.)
</body></html>

View File

@@ -0,0 +1,9 @@
<html><body>Newbie Guide:<br>
As token of congratulations, the Adventure Guild is pleased to open its warehouse to both apprentice adventurers who have reached level 6 as well as travelers who have completed their first occupation change. At level 6, you can borrow a <font color="LEVEL">No-Grade Shadow Weapon</font> with the <font color="LEVEL">Apprentice Adventurer's Weapon Exchange Coupon</font>. At level 20, you can borrow <font color="LEVEL">Shadow Armor</font> with the <font color="LEVEL">Adventurer's Magic Armor Exchange Coupon</font>. No-Grade Shadow Weapons can be exchanged up to level 19 and Shadow Armor can be exchanged up to level 39.
Now then: how can I help you?<br>
(Note: chaotic characters may not use weapons or armor borrowed from the Adventure Guild.)<br>
<a action="bypass -h Quest NewbieCoupons newbie_give_weapon_coupon">Get the Apprentice Adventurer's Weapon Exchange Coupon.</a><br>
<a action="bypass -h Quest NewbieCoupons newbie_show_weapon">Use the weapon warehouse for apprentice adventurers.</a><br>
<a action="bypass -h Quest NewbieCoupons newbie_give_armor_coupon">Get the Adventurer's Magic Armor Exchange Coupon.</a><br>
<a action="bypass -h Quest NewbieCoupons newbie_show_armor">Use the Magic Armor warehouse for travelers.</a>
</body></html>

View File

@@ -0,0 +1,166 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.NewbieCoupons;
import com.l2jserver.gameserver.datatables.MultisellData;
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;
/**
* Newbie Weapon/Accesories Coupons for the Hellbound opening event.<br>
* Original Jython script by Vice.
* @author Nyaran
*/
public final class NewbieCoupons extends Quest
{
private static final int COUPON_ONE = 7832;
private static final int COUPON_TWO = 7833;
private static final int[] NPCs =
{
30598,
30599,
30600,
30601,
30602,
31076,
31077,
32135
};
private static final int WEAPON_MULTISELL = 305986001;
private static final int ACCESORIES_MULTISELL = 305986002;
// enable/disable coupon give
private static final boolean NEWBIE_COUPONS_ENABLED = true;
/*
* Newbie/one time rewards section Any quest should rely on a unique bit, but it could be shared among quests that were mutually exclusive or race restricted. Bit //1 isn't used for backwards compatibility. This script uses 2 bits, one for newbie coupons and another for travelers These 2 bits
* happen to be the same used by the Miss Queen script
*/
private static final int NEWBIE_WEAPON = 16;
private static final int NEWBIE_ACCESORY = 32;
private NewbieCoupons()
{
super(-1, NewbieCoupons.class.getSimpleName(), "custom");
for (int i : NPCs)
{
addStartNpc(i);
addTalkId(i);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
if (!NEWBIE_COUPONS_ENABLED)
{
return htmltext;
}
QuestState st = getQuestState(player, false);
int newbie = player.getNewbie();
int level = player.getLevel();
int occupation_level = player.getClassId().level();
int pkkills = player.getPkKills();
if (event.equals("newbie_give_weapon_coupon"))
{
/*
* TODO: check if this is the very first character for this account would need a bit of SQL, or a core method to determine it. This condition should be stored by the core in the account_data table upon character creation.
*/
if ((level >= 6) && (level <= 39) && (pkkills == 0) && (occupation_level == 0))
{
// check the player state against this quest newbie rewarding mark.
if ((newbie | NEWBIE_WEAPON) != newbie)
{
player.setNewbie(newbie | NEWBIE_WEAPON);
st.giveItems(COUPON_ONE, 5);
htmltext = "30598-2.htm"; // here's the coupon you requested
}
else
{
htmltext = "30598-1.htm"; // you got a coupon already!
}
}
else
{
htmltext = "30598-3.htm"; // you're not eligible to get a coupon (level caps, pkkills or already changed class)
}
}
else if (event.equals("newbie_give_armor_coupon"))
{
if ((level >= 6) && (level <= 39) && (pkkills == 0) && (occupation_level == 1))
{
// check the player state against this quest newbie rewarding mark.
if ((newbie | NEWBIE_ACCESORY) != newbie)
{
player.setNewbie(newbie | NEWBIE_ACCESORY);
st.giveItems(COUPON_TWO, 1);
htmltext = "30598-5.htm"; // here's the coupon you requested
}
else
{
htmltext = "30598-4.htm"; // you got a coupon already!
}
}
else
{
htmltext = "30598-6.htm"; // you're not eligible to get a coupon (level caps, pkkills or didnt change class yet)
}
}
else if (event.equals("newbie_show_weapon"))
{
if ((level >= 6) && (level <= 39) && (pkkills == 0) && (occupation_level == 0))
{
MultisellData.getInstance().separateAndSend(WEAPON_MULTISELL, player, npc, false);
return null;
}
htmltext = "30598-7.htm"; // you're not eligible to use warehouse
}
else if (event.equals("newbie_show_armor"))
{
if ((level >= 6) && (level <= 39) && (pkkills == 0) && (occupation_level > 0))
{
MultisellData.getInstance().separateAndSend(ACCESORIES_MULTISELL, player, npc, false);
return null;
}
htmltext = "30598-8.htm"; // you're not eligible to use warehouse
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
getQuestState(player, true);
return "30598.htm";
}
public static void main(String args[])
{
new NewbieCoupons();
}
}