actual freya branch

This commit is contained in:
2026-09-12 15:39:57 +00:00
parent 9fa534b20e
commit 8049e0a882
18540 changed files with 1228200 additions and 0 deletions
@@ -0,0 +1,4 @@
<html><body>Alegria:<br>
Oh! I don't know. What now? I'm a bit out of my depth here.<br>
If you like me, let's get to know each other. Who knows, maybe we'll be able to spend more time together someday. Infortunately, I've got to run now. See you soon!
</body></html>
@@ -0,0 +1,5 @@
<html><body>
Hold on there, buddy. You can't receive a gift unless today's date is your actual birthday.<br>
If you're not sure what day your birthday falls on, try using the <font color="LEVEL">/mybirthday</font> command.<br>
Come back and see me on the yearly anniversary of your creation day, and we will celebrate like there's no tomorrow!
</body></html>
@@ -0,0 +1,4 @@
<html><body>Alegria:<br>
I hope these gifts will make this birthday one you'll never forget!<br>
<font color="LEVEL">Good bye! See you next year...</font>
</body></html>
@@ -0,0 +1,9 @@
<html><body>Alegria:<br>
Howdy-hi, adventurer!!<br>
The word around town is that you're celebrating your birthday today. Hooray!<br>
As a reward for all the time you've spent in this fair land, I'm here to present you with your official birthday gift. For every year of loyalty and dedication you have shown, I will reward you with <font color="LEVEL">one birthday celebration item and a 12-hour vitality replenishing buff</font>. However, you'll want to remember that if you are killed during the next 12 hours, your birthday buff will be gone for good. Or at least until next year.<br>
In addition, <font color="LEVEL">if you switch to a subclass while the buff is still active</font>, you will also lose the buff. So make sure you are on your preferred class before you receive the buff.<br>
I don't mean to be rude, but I've got other people to see, so I can't stay and chat all day. To receive your gifts, please click on the link below.<br><br><br>
<a action="bypass -h Quest CharacterBirthday receive_reward">Receive your birthday gifts.</a><br>
<a action="bypass -h Quest CharacterBirthday 32600-1.htm">Wait! I want to talk to you some more</a>
</body></html>
@@ -0,0 +1,147 @@
/*
* 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 events.CharacterBirthday;
import java.util.Calendar;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.instancemanager.QuestManager;
import com.l2jserver.gameserver.model.L2Skill;
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.model.quest.State;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
/**
* @author Gnacik
*
*/
public class CharacterBirthday extends Quest
{
private static final int _npc = 32600;
private static boolean is_spawned = false;
private final static int[] _gk =
{
30006,30059,30080,30134,30146,30177,30233,30256,30320,30540,
30576,30836,30848,30878,30899,31275,31320,31964,32163
};
public CharacterBirthday(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(_npc);
addFirstTalkId(_npc);
addTalkId(_npc);
for (int id : _gk)
{
addStartNpc(id);
addTalkId(id);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = "";
QuestState st = player.getQuestState(getName());
htmltext = event;
if (event.equalsIgnoreCase("despawn_npc"))
{
npc.doDie(player);
is_spawned = false;
htmltext = null;
}
if (event.equalsIgnoreCase("receive_reward"))
{
// Give Adventurer Hat (Event)
st.giveItems(10250, 1);
// Give Buff
L2Skill skill;
skill = SkillTable.getInstance().getInfo(5950, 1);
if (skill != null)
skill.getEffects(npc, player);
npc.setTarget(player);
npc.broadcastPacket(new MagicSkillUse(player, 5950, 1, 1000, 0));
// Despawn npc
npc.doDie(player);
is_spawned = false;
// Update for next year
Calendar now = Calendar.getInstance();
now.setTimeInMillis(System.currentTimeMillis());
st.set("Birthday", String.valueOf(now.get(Calendar.YEAR)+1));
htmltext = "32600-ok.htm";
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
if(is_spawned)
return null;
QuestState st = player.getQuestState(getName());
if (st == null)
{
Quest q = QuestManager.getInstance().getQuest(getName());
st = q.newQuestState(player);
}
if (st != null && player.checkBirthDay() == 0)
{
player.sendPacket(new PlaySound(1, "HB01", 0, 0, 0, 0, 0));
L2Npc spawned = st.addSpawn(32600, player.getX()+10, player.getY()+10, player.getZ()+10, 0, false, 0, true);
st.setState(State.STARTED);
st.startQuestTimer("despawn_npc", 60000, spawned);
is_spawned = true;
}
else
return "32600-no.htm";
return null;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = "";
QuestState st = player.getQuestState(getName());
if (st == null)
{
Quest q = QuestManager.getInstance().getQuest(getName());
st = q.newQuestState(player);
}
if (player.checkBirthDay() == 0)
htmltext = "32600.htm";
else
htmltext = "32600-no.htm";
return htmltext;
}
public static void main(String[] args)
{
new CharacterBirthday(-1, "CharacterBirthday", "events");
}
}