Jump to content

Question

Posted
Good afternoon, mxc, I'm trying to adapt the acys quest to jfrozen, however, I'm trying to put the file straight into the kernel instead of properties, I'm having the following error:
2upsqdi.png
 
Code:

/*
 * 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 net.l2jpx.gameserver.ai.special;
 
import java.util.HashMap;
import java.util.List;
 
import net.l2jpx.gameserver.model.actor.instance.L2PcInstance;
import net.l2jpx.gameserver.model.quest.Quest;
import net.l2jpx.gameserver.network.serverpackets.PlaySound;
import net.l2jpx.gameserver.model.actor.instance.L2NpcInstance;
 
public class PartyDrop extends Quest
{
private static final String qn = "PartyDrop";
 
private static final int[] PARTYMOBS =
{
10505
};
 
boolean _canReward = false;
static HashMap<String, Integer> playerIps = new HashMap<>();
 
public PartyDrop()
{
super(-1, qn, "custom");
 
addKillId(PARTYMOBS);
}
 
@Override
public String onKill(L2NpcInstance npc, L2PcInstance player, boolean isPet)
{
if (player.isInParty())
{
List<L2PcInstance> party = player.getParty().getPartyMembers();
 
for (L2PcInstance member : party)
            {
String pIp = member.getClient().getConnection().getInetAddress().getHostAddress();
                    
if (!playerIps.containsKey(pIp))
                {
playerIps.put(pIp, 1);
_canReward = true;
                }
else
{
int count = playerIps.get(pIp);
                
if (count < 1)
                    {
playerIps.remove(pIp);
playerIps.put(pIp, count + 1);
_canReward = true;
                    }
else
                    {
member.sendMessage("Already 1 member of your ip have been rewarded, so this character won't be rewarded.");
_canReward = false;
                    }
}
if (_canReward)
{
if (member.isInsideRadius(npc, 1000, false, false))
   {
   member.addItem("Luck Box", 9509, 1, member, true);
member.addItem("Ace Coin", 9500, 5000, member, true);
member.addItem("Mochi Token", 9515, 100, member, true);
   member.broadcastPacket(new PlaySound("ItemSound.quest_finish"));
   }
   else
   {
   member.sendMessage("You are too far to be rewarded.");
   }
}
            }
playerIps.clear();   
}
else
{
player.addItem("Luck Box", 9509, 1, player, true);
player.addItem("Ace Coin", 9500, 5000, player, true);
player.addItem("Mochi Token", 9515, 100, player, true);
player.broadcastPacket(new PlaySound("ItemSound.quest_finish"));
}
 
return null;
}
 
public static void main(String[] args)
{
new PartyDrop();
}
}

 
Actually I do not know if I will succeed, the code is above, I am open to corrections ..

 

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


×
×
  • Create New...