Addition of Training with Dandy event.

Contributed by gigilo1968.
This commit is contained in:
MobiusDevelopment 2019-08-28 08:51:57 +00:00
parent 1e118ba514
commit c49b77b31c
6 changed files with 132 additions and 5 deletions

View File

@ -0,0 +1,7 @@
<html><body>Dandy:<br>
My heart! It's still pounding!<br>
It was such a glorious match. Wait, let me pay you back somehow!<br>
Let's cheer together! I'll cheer for you too!<br1>
(You can receive Dandy's Cheers once a day, which gets reset at 06:30.)<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest TrainingWithDandy dandy_buff">"Sure, let's cheer together."</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Dandy:<br>
Now, head up! I'm cheering for you!<br>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Dandy:<br>
I've already cheered for you!<br>
</body></html>

View File

@ -0,0 +1,91 @@
/*
* 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 events.TrainingWithDandy;
import java.util.Calendar;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
/**
* Training with Dandy
* @author Gigi
* @date 2019-08-27 - [17:41:16]
*/
public class TrainingWithDandy extends LongTimeEvent
{
// NPC
private static final int DANDY = 33894;
// Skill
private static final SkillHolder DANDY_CH = new SkillHolder(17186, 1); // Dandy's Cheers
// Misc
private static final String GIVE_DANDI_BUFF_VAR = "GIVE_DANDI_BUFF";
private TrainingWithDandy()
{
addStartNpc(DANDY);
addFirstTalkId(DANDY);
addTalkId(DANDY);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
switch (event)
{
case "33894-1.htm":
{
htmltext = event;
break;
}
case "dandy_buff":
{
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MINUTE, 30);
calendar.set(Calendar.HOUR_OF_DAY, 6);
final long resetTime = calendar.getTimeInMillis();
final long previousDate = player.getVariables().getLong(GIVE_DANDI_BUFF_VAR, 0);
if (previousDate < resetTime)
{
npc.setTarget(player);
npc.doCast(DANDY_CH.getSkill());
player.getVariables().set(GIVE_DANDI_BUFF_VAR, System.currentTimeMillis());
player.broadcastStatusUpdate();
htmltext = "33894-2.htm";
break;
}
htmltext = "33894-3.htm";
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return npc.getId() + "-1.htm";
}
public static void main(String[] args)
{
new TrainingWithDandy();
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<event name="Training with Dandy" active="25 08 2019-31 09 2019" enableShrines="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
<spawnlist>
<add npc="33894" x="-14143" y="123176" z="-3096" heading="30212" /> <!-- Gludio -->
<add npc="33894" x="16354" y="142848" z="-2680" heading="14450" /> <!-- Dion -->
<add npc="33894" x="80814" y="147987" z="-3448" heading="3355" /> <!-- Giran -->
<add npc="33894" x="82008" y="53874" z="-1472" heading="3355" /> <!-- Oren -->
<add npc="33894" x="147457" y="27863" z="-2248" heading="17863" /> <!-- Aden -->
<add npc="33894" x="112172" y="220447" z="-3648" heading="30708" /> <!-- Heine -->
<add npc="33894" x="148195" y="-57368" z="-2752" heading="17863" /> <!-- Goddard -->
<add npc="33894" x="44530" y="-48368" z="-776" heading="14450" /> <!-- Rune -->
<add npc="33894" x="86897" y="-141346" z="-1320" heading="49153" /> <!-- Shutgard -->
<add npc="33894" x="-114822" y="256385" z="-1472" heading="49744" /> <!-- Talking Island -->
<add npc="33894" x="-78832" y="249115" z="-3272" heading="56380" /> <!-- Faeron Village -->
<add npc="33894" x="-80485" y="149537" z="-3016" heading="16383" /> <!-- Gluddin -->
<add npc="33894" x="117380" y="76684" z="-2672" heading="40961" /> <!-- Hunters Village -->
<add npc="33894" x="208499" y="87743" z="-1006" heading="11264" /> <!-- Arcan Village -->
</spawnlist>
<messages>
<add type="onEnd" text="Training with Dandy: Event end!" />
<add type="onEnter" text="Training with Dandy: Event ongoing!" />
</messages>
</event>

View File

@ -827,12 +827,12 @@
<operateType>A2</operateType>
<isMagic>4</isMagic>
<abnormalLvl>5</abnormalLvl>
<abnormalTime>3600</abnormalTime>
<canBeDispelled>false</canBeDispelled>
<effectPoint>1</effectPoint>
<magicCriticalRate>5</magicCriticalRate>
<abnormalTime>7200</abnormalTime>
<abnormalType>TRANSFORM</abnormalType>
<abnormalVisualEffect>CHANGE_DINOS</abnormalVisualEffect>
<hitCancelTime>0</hitCancelTime>
<targetType>SELF</targetType>
<specialLevel>-1</specialLevel>
<targetType>TARGET</targetType>
<affectScope>SINGLE</affectScope>
<effects>
<effect name="PAtk">