Перейти к содержанию
Авторизация  
Ferrari

Enterworld

Рекомендуемые сообщения

Хочу добавить этот код,ант даёт ошибки,добавляю это в ентер ворлд,ну логически,помогите кто нибуть,не давно этим занимаюсть(основа acis)

else

 

{

activeChar.setClanPrivileges(0);

}

if (activeChar.getPremiumService() > 0L) {

if (System.currentTimeMillis() > activeChar.getPremiumService())

{

activeChar.setPremiumService(0L);

}

else

{

activeChar.setPremiumService(activeChar.getPremiumService());

if (Config.SHOW_PREMIUM_STATE_ON_ENTER) {

activeChar.showPremiumState(false);

}

}

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

скачай среду разработки intellej IDEA вроде так было . Там сразу все ошибки высвечиваются нот пады эти блокноты в окно бросай

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Покажи ошибки ant'а и полный код EnterWorld.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

вот EnterWorld

 

/*

* 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 l2s.gameserver.network.clientpackets;

 

import l2s.commons.configuration.Config;

import l2s.gameserver.Announcements;

import l2s.gameserver.GameTimeController;

import l2s.gameserver.SevenSigns;

import l2s.gameserver.communitybbs.Manager.MailBBSManager;

import l2s.gameserver.datatables.AdminCommandAccessRights;

import l2s.gameserver.datatables.GmListTable;

import l2s.gameserver.datatables.MapRegionTable;

import l2s.gameserver.datatables.SkillTable.FrequentSkill;

import l2s.gameserver.instancemanager.ClanHallManager;

import l2s.gameserver.instancemanager.CoupleManager;

import l2s.gameserver.instancemanager.DimensionalRiftManager;

import l2s.gameserver.instancemanager.PetitionManager;

import l2s.gameserver.instancemanager.QuestManager;

import l2s.gameserver.instancemanager.SiegeManager;

import l2s.gameserver.model.L2Clan;

import l2s.gameserver.model.L2Clan.SubPledge;

import l2s.gameserver.model.L2World;

import l2s.gameserver.model.actor.instance.L2PcInstance;

import l2s.gameserver.model.entity.ClanHall;

import l2s.gameserver.model.entity.Couple;

import l2s.gameserver.model.entity.Siege;

import l2s.gameserver.model.olympiad.Olympiad;

import l2s.gameserver.model.quest.Quest;

import l2s.gameserver.model.quest.QuestState;

import l2s.gameserver.model.zone.ZoneId;

import l2s.gameserver.network.SystemMessageId;

import l2s.gameserver.network.serverpackets.Die;

import l2s.gameserver.network.serverpackets.EtcStatusUpdate;

import l2s.gameserver.network.serverpackets.ExMailArrived;

import l2s.gameserver.network.serverpackets.ExStorageMaxCount;

import l2s.gameserver.network.serverpackets.FriendList;

import l2s.gameserver.network.serverpackets.HennaInfo;

import l2s.gameserver.network.serverpackets.ItemList;

import l2s.gameserver.network.serverpackets.NpcHtmlMessage;

import l2s.gameserver.network.serverpackets.PlaySound;

import l2s.gameserver.network.serverpackets.PledgeShowMemberListAll;

import l2s.gameserver.network.serverpackets.PledgeShowMemberListUpdate;

import l2s.gameserver.network.serverpackets.PledgeSkillList;

import l2s.gameserver.network.serverpackets.PledgeStatusChanged;

import l2s.gameserver.network.serverpackets.QuestList;

import l2s.gameserver.network.serverpackets.ShortCutInit;

import l2s.gameserver.network.serverpackets.SkillCoolTime;

import l2s.gameserver.network.serverpackets.SystemMessage;

import l2s.gameserver.network.serverpackets.UserInfo;

 

public class EnterWorld extends L2GameClientPacket

{

@Override

protected void readImpl()

{

// this is just a trigger packet. it has no content

}

 

@Override

protected void runImpl()

{

final L2PcInstance activeChar = getClient().getActiveChar();

if (activeChar == null)

{

_log.warn("EnterWorld failed! activeChar is null...");

getClient().closeNow();

return;

}

 

if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)

{

if (Config.DEBUG)

{

_log.warn("User already exist in OID map! User " + activeChar.getName() + " is character clone.");

}

}

 

if (activeChar.isGM())

{

if (Config.GM_STARTUP_INVULNERABLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel()))

{

activeChar.setIsInvul(true);

}

 

if (Config.GM_STARTUP_INVISIBLE && AdminCommandAccessRights.getInstance().hasAccess("admin_hide", activeChar.getAccessLevel()))

{

activeChar.getAppearance().setInvisible();

}

 

if (Config.GM_STARTUP_SILENCE && AdminCommandAccessRights.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel()))

{

activeChar.setInRefusalMode(true);

}

 

if (Config.GM_STARTUP_AUTO_LIST && AdminCommandAccessRights.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel()))

{

GmListTable.getInstance().addGm(activeChar, false);

}

else

{

GmListTable.getInstance().addGm(activeChar, true);

}

}

 

// Set dead status if applies

if (activeChar.getCurrentHp() < 0.5)

{

activeChar.setIsDead(true);

}

 

final L2Clan clan = activeChar.getClan();

if (clan != null)

{

activeChar.sendPacket(new PledgeSkillList(clan));

notifyClanMembers(activeChar);

notifySponsorOrApprentice(activeChar);

 

// Add message at connexion if clanHall not paid.

final ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(clan);

if (clanHall != null)

{

if (!clanHall.getPaid())

{

activeChar.sendPacket(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);

}

}

 

for (Siege siege : SiegeManager.getSieges())

{

if (!siege.isInProgress())

{

continue;

}

 

if (siege.checkIsAttacker(clan))

{

activeChar.setSiegeState((byte) 1);

}

else if (siege.checkIsDefender(clan))

{

activeChar.setSiegeState((byte) 2);

}

}

 

activeChar.sendPacket(new PledgeShowMemberListAll(clan, 0));

 

for (SubPledge sp : clan.getAllSubPledges())

{

activeChar.sendPacket(new PledgeShowMemberListAll(clan, sp.getId()));

}

 

activeChar.sendPacket(new UserInfo(activeChar));

activeChar.sendPacket(new PledgeStatusChanged(clan));

}

 

// Updating Seal of Strife Buff/Debuff

if (SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) != SevenSigns.CABAL_NULL))

{

int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId());

if (cabal != SevenSigns.CABAL_NULL)

{

if (cabal == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))

{

activeChar.addSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());

}

else

{

activeChar.addSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());

}

}

}

else

{

activeChar.removeSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());

activeChar.removeSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());

}

 

if (Config.PLAYER_SPAWN_PROTECTION > 0)

{

activeChar.setProtection(true);

}

 

activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

 

// engage and notify Partner

if (Config.ALLOW_WEDDING)

{

engage(activeChar);

}

 

// Announcements, welcome & Seven signs period messages

activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE);

SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);

Announcements.getInstance().showAnnouncements(activeChar);

 

// if player is DE, check for shadow sense skill at night

if (activeChar.getRace().ordinal() == 2)

{

// If player got the skill (exemple : low level DEs haven't it)

if (activeChar.getSkillLevel(294) == 1)

{

if (GameTimeController.getInstance().isNowNight())

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NIGHT_S1_EFFECT_APPLIES).addSkillName(294));

}

else

{

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DAY_S1_EFFECT_DISAPPEARS).addSkillName(294));

}

}

}

 

activeChar.getMacroses().sendUpdate();

activeChar.sendPacket(new UserInfo(activeChar));

activeChar.sendPacket(new HennaInfo(activeChar));

activeChar.sendPacket(new FriendList(activeChar));

// activeChar.queryGameGuard();

activeChar.sendPacket(new ItemList(activeChar, false));

activeChar.sendPacket(new ShortCutInit(activeChar));

activeChar.sendPacket(new ExStorageMaxCount(activeChar));

activeChar.updateEffectIcons();

activeChar.sendPacket(new EtcStatusUpdate(activeChar));

activeChar.sendSkillList();

 

Quest.playerEnter(activeChar);

if (!Config.DISABLE_TUTORIAL)

{

loadTutorial(activeChar);

}

 

for (Quest quest : QuestManager.getInstance().getAllManagedScripts())

{

if ((quest != null) && quest.getOnEnterWorld())

{

quest.notifyEnterWorld(activeChar);

}

}

activeChar.sendPacket(new QuestList());

 

// Unread mails make a popup appears.

if (Config.ENABLE_COMMUNITY_BOARD && (MailBBSManager.getInstance().checkUnreadMail(activeChar) > 0))

{

activeChar.sendPacket(SystemMessageId.NEW_MAIL);

activeChar.sendPacket(new PlaySound("systemmsg_e.1233"));

activeChar.sendPacket(ExMailArrived.STATIC_PACKET);

}

 

// Clan notice, if active.

if (Config.ENABLE_COMMUNITY_BOARD && (clan != null) && clan.isNoticeEnabled())

{

NpcHtmlMessage notice = new NpcHtmlMessage(0);

notice.setFile("data/html-en/clan_notice.htm");

notice.replace("%clan_name%", clan.getName());

notice.replace("%notice_text%", clan.getNotice().replaceAll("\r\n", "<br>").replaceAll("action", "").replaceAll("bypass", ""));

sendPacket(notice);

}

else if (Config.SERVER_NEWS)

{

NpcHtmlMessage html = new NpcHtmlMessage(0);

html.setFile("data/html-en/servnews.htm");

sendPacket(html);

}

 

PetitionManager.getInstance().checkPetitionMessages(activeChar);

 

// no broadcast needed since the player will already spawn dead to others

if (activeChar.isAlikeDead())

{

sendPacket(new Die(activeChar));

}

 

activeChar.onPlayerEnter();

 

sendPacket(new SkillCoolTime(activeChar));

 

// If player logs back in a stadium, port him in nearest town.

if (Olympiad.getInstance().playerInStadia(activeChar))

{

activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);

}

 

if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))

{

DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);

}

 

if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())

{

activeChar.sendPacket(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED);

}

 

// Attacker or spectator logging into a siege zone will be ported at town.

if (!activeChar.isGM() && (!activeChar.isInSiege() || (activeChar.getSiegeState() < 2)) && activeChar.isInsideZone(ZoneId.SIEGE))

{

activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);

}

}

 

private static void engage(L2PcInstance cha)

{

int _chaid = cha.getObjectId();

 

for (Couple cl : CoupleManager.getInstance().getCouples())

{

if ((cl.getPlayer1Id() == _chaid) || (cl.getPlayer2Id() == _chaid))

{

if (cl.getMaried())

{

cha.setMarried(true);

}

 

cha.setCoupleId(cl.getId());

}

}

}

else

{

activeChar.setPledgeRank(1);

activeChar.setClanPrivileges(8388606);

}

}

 

else

{

activeChar.setClanPrivileges(0);

}

if (activeChar.getPremiumService() > 0L) {

if (System.currentTimeMillis() > activeChar.getPremiumService())

{

activeChar.setPremiumService(0L);

}

else

{

activeChar.setPremiumService(activeChar.getPremiumService());

if (Config.SHOW_PREMIUM_STATE_ON_ENTER) {

activeChar.showPremiumState(false);

}

}

 

private static void notifyClanMembers(L2PcInstance activeChar)

{

final L2Clan clan = activeChar.getClan();

 

// Refresh player instance.

clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar);

 

final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN).addPcName(activeChar);

final PledgeShowMemberListUpdate update = new PledgeShowMemberListUpdate(activeChar);

 

// Send packet to others members.

for (L2PcInstance member : clan.getOnlineMembers())

{

if (member == activeChar)

{

continue;

}

 

member.sendPacket(msg);

member.sendPacket(update);

}

}

 

private static void notifySponsorOrApprentice(L2PcInstance activeChar)

{

if (activeChar.getSponsor() != 0)

{

L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor());

if (sponsor != null)

{

sponsor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN).addPcName(activeChar));

}

}

else if (activeChar.getApprentice() != 0)

{

L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice());

if (apprentice != null)

{

apprentice.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN).addPcName(activeChar));

}

}

}

 

private static void loadTutorial(L2PcInstance player)

{

QuestState qs = player.getQuestState("Q255_Tutorial");

if (qs != null)

{

qs.getQuest().notifyEvent("UC", null, player);

}

}

 

@Override

protected boolean triggersOnActionRequest()

{

return false;

}

}

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ant

 

[javac] Compiling 1760 source files to C:\source\build-ant-core\classes

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:328: error: illegal start of type

[javac] else

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:328: error: ';' expected

[javac] else

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:330: error: <identifier> expected

[javac] activeChar.setPledgeRank(1);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:330: error: illegal start of type

[javac] activeChar.setPledgeRank(1);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:331: error: <identifier> expected

[javac] activeChar.setClanPrivileges(8388606);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:331: error: illegal start of type

[javac] activeChar.setClanPrivileges(8388606);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:333: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:338: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:343: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:347: error: class, interface, or enum expected

[javac] if (Config.SHOW_PREMIUM_STATE_ON_ENTER) {

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:349: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:354: error: class, interface, or enum expected

[javac] final L2Clan clan = activeChar.getClan();

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:357: error: class, interface, or enum expected

[javac] clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:359: error: class, interface, or enum expected

[javac] final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN).addPcName(activeChar);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:360: error: class, interface, or enum expected

[javac] final PledgeShowMemberListUpdate update = new PledgeShowMemberListUpdate(activeChar);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:363: error: class, interface, or enum expected

[javac] for (L2PcInstance member : clan.getOnlineMembers())

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:368: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:371: error: class, interface, or enum expected

[javac] member.sendPacket(update);

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:372: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:380: error: class, interface, or enum expected

[javac] if (sponsor != null)

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:383: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:388: error: class, interface, or enum expected

[javac] if (apprentice != null)

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:391: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:398: error: class, interface, or enum expected

[javac] if (qs != null)

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:401: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:405: error: class, interface, or enum expected

[javac] protected boolean triggersOnActionRequest()

[javac] ^

[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:408: error: class, interface, or enum expected

[javac] }

[javac] ^

[javac] 27 errors

 

BUILD FAILED

C:\source\build_core.xml:30: Compile failed; see the compiler error output for details.

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Не пойму, что за условие у тебя:

else
 {
 activeChar.setPledgeRank(1);
 activeChar.setClanPrivileges(8388606);
 }
}
else
{
 activeChar.setClanPrivileges(0);
}

 

А без него:

 

 

/*
* 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 <[url="http://www.gnu.org/licenses/%3E."]http://www.gnu.org/licenses/>.[/url]
*/
package l2s.gameserver.network.clientpackets;

import l2s.commons.configuration.Config;
import l2s.gameserver.Announcements;
import l2s.gameserver.GameTimeController;
import l2s.gameserver.SevenSigns;
import l2s.gameserver.communitybbs.Manager.MailBBSManager;
import l2s.gameserver.datatables.AdminCommandAccessRights;
import l2s.gameserver.datatables.GmListTable;
import l2s.gameserver.datatables.MapRegionTable;
import l2s.gameserver.datatables.SkillTable.FrequentSkill;
import l2s.gameserver.instancemanager.ClanHallManager;
import l2s.gameserver.instancemanager.CoupleManager;
import l2s.gameserver.instancemanager.DimensionalRiftManager;
import l2s.gameserver.instancemanager.PetitionManager;
import l2s.gameserver.instancemanager.QuestManager;
import l2s.gameserver.instancemanager.SiegeManager;
import l2s.gameserver.model.L2Clan;
import l2s.gameserver.model.L2Clan.SubPledge;
import l2s.gameserver.model.L2World;
import l2s.gameserver.model.actor.instance.L2PcInstance;
import l2s.gameserver.model.entity.ClanHall;
import l2s.gameserver.model.entity.Couple;
import l2s.gameserver.model.entity.Siege;
import l2s.gameserver.model.olympiad.Olympiad;
import l2s.gameserver.model.quest.Quest;
import l2s.gameserver.model.quest.QuestState;
import l2s.gameserver.model.zone.ZoneId;
import l2s.gameserver.network.SystemMessageId;
import l2s.gameserver.network.serverpackets.Die;
import l2s.gameserver.network.serverpackets.EtcStatusUpdate;
import l2s.gameserver.network.serverpackets.ExMailArrived;
import l2s.gameserver.network.serverpackets.ExStorageMaxCount;
import l2s.gameserver.network.serverpackets.FriendList;
import l2s.gameserver.network.serverpackets.HennaInfo;
import l2s.gameserver.network.serverpackets.ItemList;
import l2s.gameserver.network.serverpackets.NpcHtmlMessage;
import l2s.gameserver.network.serverpackets.PlaySound;
import l2s.gameserver.network.serverpackets.PledgeShowMemberListAll;
import l2s.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
import l2s.gameserver.network.serverpackets.PledgeSkillList;
import l2s.gameserver.network.serverpackets.PledgeStatusChanged;
import l2s.gameserver.network.serverpackets.QuestList;
import l2s.gameserver.network.serverpackets.ShortCutInit;
import l2s.gameserver.network.serverpackets.SkillCoolTime;
import l2s.gameserver.network.serverpackets.SystemMessage;
import l2s.gameserver.network.serverpackets.UserInfo;

public class EnterWorld extends L2GameClientPacket
{
@Override
protected void readImpl()
{
// this is just a trigger packet. it has no content
}

@Override
protected void runImpl()
{
final L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
_log.warn("EnterWorld failed! activeChar is null...");
getClient().closeNow();
return;
}

if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)
{
if (Config.DEBUG)
{
_log.warn("User already exist in OID map! User " + activeChar.getName() + " is character clone.");
}
}

if (activeChar.isGM())
{
if (Config.GM_STARTUP_INVULNERABLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel()))
{
activeChar.setIsInvul(true);
}

if (Config.GM_STARTUP_INVISIBLE && AdminCommandAccessRights.getInstance().hasAccess("admin_hide", activeChar.getAccessLevel()))
{
activeChar.getAppearance().setInvisible();
}

if (Config.GM_STARTUP_SILENCE && AdminCommandAccessRights.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel()))
{
activeChar.setInRefusalMode(true);
}

if (Config.GM_STARTUP_AUTO_LIST && AdminCommandAccessRights.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel()))
{
GmListTable.getInstance().addGm(activeChar, false);
}
else
{
GmListTable.getInstance().addGm(activeChar, true);
}
}

// Set dead status if applies
if (activeChar.getCurrentHp() < 0.5)
{
activeChar.setIsDead(true);
}

final L2Clan clan = activeChar.getClan();
if (clan != null)
{
activeChar.sendPacket(new PledgeSkillList(clan));
notifyClanMembers(activeChar);
notifySponsorOrApprentice(activeChar);

// Add message at connexion if clanHall not paid.
final ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(clan);
if (clanHall != null)
{
if (!clanHall.getPaid())
{
 activeChar.sendPacket(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
}
}

for (Siege siege : SiegeManager.getSieges())
{
if (!siege.isInProgress())
{
 continue;
}

if (siege.checkIsAttacker(clan))
{
 activeChar.setSiegeState((byte) 1);
}
else if (siege.checkIsDefender(clan))
{
 activeChar.setSiegeState((byte) 2);
}
}

activeChar.sendPacket(new PledgeShowMemberListAll(clan, 0));

for (SubPledge sp : clan.getAllSubPledges())
{
activeChar.sendPacket(new PledgeShowMemberListAll(clan, sp.getId()));
}

activeChar.sendPacket(new UserInfo(activeChar));
activeChar.sendPacket(new PledgeStatusChanged(clan));
}

// Updating Seal of Strife Buff/Debuff
if (SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) != SevenSigns.CABAL_NULL))
{
int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId());
if (cabal != SevenSigns.CABAL_NULL)
{
if (cabal == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))
{
 activeChar.addSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());
}
else
{
 activeChar.addSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());
}
}
}
else
{
activeChar.removeSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());
activeChar.removeSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());
}

if (Config.PLAYER_SPAWN_PROTECTION > 0)
{
activeChar.setProtection(true);
}

activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

// engage and notify Partner
if (Config.ALLOW_WEDDING)
{
engage(activeChar);
}

// Announcements, welcome & Seven signs period messages
activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE);
SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
Announcements.getInstance().showAnnouncements(activeChar);

// if player is DE, check for shadow sense skill at night
if (activeChar.getRace().ordinal() == 2)
{
// If player got the skill (exemple : low level DEs haven't it)
if (activeChar.getSkillLevel(294) == 1)
{
if (GameTimeController.getInstance().isNowNight())
{
 activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NIGHT_S1_EFFECT_APPLIES).addSkillName(294));
}
else
{
 activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DAY_S1_EFFECT_DISAPPEARS).addSkillName(294));
}
}
}

activeChar.getMacroses().sendUpdate();
activeChar.sendPacket(new UserInfo(activeChar));
activeChar.sendPacket(new HennaInfo(activeChar));
activeChar.sendPacket(new FriendList(activeChar));
// activeChar.queryGameGuard();
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.sendPacket(new ShortCutInit(activeChar));
activeChar.sendPacket(new ExStorageMaxCount(activeChar));
activeChar.updateEffectIcons();
activeChar.sendPacket(new EtcStatusUpdate(activeChar));
activeChar.sendSkillList();

Quest.playerEnter(activeChar);
if (!Config.DISABLE_TUTORIAL)
{
loadTutorial(activeChar);
}

for (Quest quest : QuestManager.getInstance().getAllManagedScripts())
{
if ((quest != null) && quest.getOnEnterWorld())
{
quest.notifyEnterWorld(activeChar);
}
}
activeChar.sendPacket(new QuestList());

// Unread mails make a popup appears.
if (Config.ENABLE_COMMUNITY_BOARD && (MailBBSManager.getInstance().checkUnreadMail(activeChar) > 0))
{
activeChar.sendPacket(SystemMessageId.NEW_MAIL);
activeChar.sendPacket(new PlaySound("systemmsg_e.1233"));
activeChar.sendPacket(ExMailArrived.STATIC_PACKET);
}

// Clan notice, if active.
if (Config.ENABLE_COMMUNITY_BOARD && (clan != null) && clan.isNoticeEnabled())
{
NpcHtmlMessage notice = new NpcHtmlMessage(0);
notice.setFile("data/html-en/clan_notice.htm");
notice.replace("%clan_name%", clan.getName());
notice.replace("%notice_text%", clan.getNotice().replaceAll("\r\n", "<br>").replaceAll("action", "").replaceAll("bypass", ""));
sendPacket(notice);
}
else if (Config.SERVER_NEWS)
{
NpcHtmlMessage html = new NpcHtmlMessage(0);
html.setFile("data/html-en/servnews.htm");
sendPacket(html);
}

PetitionManager.getInstance().checkPetitionMessages(activeChar);

// no broadcast needed since the player will already spawn dead to others
if (activeChar.isAlikeDead())
{
sendPacket(new Die(activeChar));
}

activeChar.onPlayerEnter();

sendPacket(new SkillCoolTime(activeChar));

// If player logs back in a stadium, port him in nearest town.
if (Olympiad.getInstance().playerInStadia(activeChar))
{
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
}

if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))
{
DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);
}

if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
{
activeChar.sendPacket(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED);
}

// Attacker or spectator logging into a siege zone will be ported at town.
if (!activeChar.isGM() && (!activeChar.isInSiege() || (activeChar.getSiegeState() < 2)) && activeChar.isInsideZone(ZoneId.SIEGE))
{
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
}

if (activeChar.getPremiumService() > 0L)
{
if (System.currentTimeMillis() > activeChar.getPremiumService())
{
activeChar.setPremiumService(0L);
}
else
{
activeChar.setPremiumService(activeChar.getPremiumService());
if (Config.SHOW_PREMIUM_STATE_ON_ENTER)
{
 activeChar.showPremiumState(false);
}
}
}
}

private static void engage(L2PcInstance cha)
{
int _chaid = cha.getObjectId();

for (Couple cl : CoupleManager.getInstance().getCouples())
{
if ((cl.getPlayer1Id() == _chaid) || (cl.getPlayer2Id() == _chaid))
{
if (cl.getMaried())
{
 cha.setMarried(true);
}

cha.setCoupleId(cl.getId());
}
}
}

private static void notifyClanMembers(L2PcInstance activeChar)
{
final L2Clan clan = activeChar.getClan();

// Refresh player instance.
clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar);

final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN).addPcName(activeChar);
final PledgeShowMemberListUpdate update = new PledgeShowMemberListUpdate(activeChar);

// Send packet to others members.
for (L2PcInstance member : clan.getOnlineMembers())
{
if (member == activeChar)
{
continue;
}

member.sendPacket(msg);
member.sendPacket(update);
}
}

private static void notifySponsorOrApprentice(L2PcInstance activeChar)
{
if (activeChar.getSponsor() != 0)
{
L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor());
if (sponsor != null)
{
sponsor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN).addPcName(activeChar));
}
}
else if (activeChar.getApprentice() != 0)
{
L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice());
if (apprentice != null)
{
apprentice.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN).addPcName(activeChar));
}
}
}

private static void loadTutorial(L2PcInstance player)
{
QuestState qs = player.getQuestState("Q255_Tutorial");
if (qs != null)
{
qs.getQuest().notifyEvent("UC", null, player);
}
}

@Override
protected boolean triggersOnActionRequest()
{
return false;
}
}

 

 

Изменено пользователем SoFace

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

теперь такая ошибка

[javac] Compiling 1760 source files to C:\source\build-ant-core\classes
[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:314: error: method setPremiumService in class L2Character cannot be applied to given types;
[javac] activeChar.setPremiumService(0L);
[javac]		 ^
[javac] required: int
[javac] found: long
[javac] reason: actual argument long cannot be converted to int by method invocation conversion
[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:319: error: cannot find symbol
[javac] if (Config.SHOW_PREMIUM_STATE_ON_ENTER)
[javac]		 ^
[javac] symbol: variable SHOW_PREMIUM_STATE_ON_ENTER
[javac] location: class Config
[javac] C:\source\java\l2s\gameserver\network\clientpackets\EnterWorld.java:321: error: cannot find symbol
[javac]		 activeChar.showPremiumState(false);
[javac]				 ^
[javac] symbol: method showPremiumState(boolean)
[javac] location: variable activeChar of type L2PcInstance
[javac] 3 errors
BUILD FAILED
C:\source\build_core.xml:30: Compile failed; see the compiler error output for details.
Total time: 11 seconds

Изменено пользователем Ferrari

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Не пойму, что за условие у тебя:

else
 {
 activeChar.setPledgeRank(1);
 activeChar.setClanPrivileges(8388606);
 }
}
else
{
 activeChar.setClanPrivileges(0);
}

 

А без него:

 

 

/*
* 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 <[url="http://www.gnu.org/licenses/%3E."]http://www.gnu.org/licenses/>.[/url]
*/
package l2s.gameserver.network.clientpackets;

import l2s.commons.configuration.Config;
import l2s.gameserver.Announcements;
import l2s.gameserver.GameTimeController;
import l2s.gameserver.SevenSigns;
import l2s.gameserver.communitybbs.Manager.MailBBSManager;
import l2s.gameserver.datatables.AdminCommandAccessRights;
import l2s.gameserver.datatables.GmListTable;
import l2s.gameserver.datatables.MapRegionTable;
import l2s.gameserver.datatables.SkillTable.FrequentSkill;
import l2s.gameserver.instancemanager.ClanHallManager;
import l2s.gameserver.instancemanager.CoupleManager;
import l2s.gameserver.instancemanager.DimensionalRiftManager;
import l2s.gameserver.instancemanager.PetitionManager;
import l2s.gameserver.instancemanager.QuestManager;
import l2s.gameserver.instancemanager.SiegeManager;
import l2s.gameserver.model.L2Clan;
import l2s.gameserver.model.L2Clan.SubPledge;
import l2s.gameserver.model.L2World;
import l2s.gameserver.model.actor.instance.L2PcInstance;
import l2s.gameserver.model.entity.ClanHall;
import l2s.gameserver.model.entity.Couple;
import l2s.gameserver.model.entity.Siege;
import l2s.gameserver.model.olympiad.Olympiad;
import l2s.gameserver.model.quest.Quest;
import l2s.gameserver.model.quest.QuestState;
import l2s.gameserver.model.zone.ZoneId;
import l2s.gameserver.network.SystemMessageId;
import l2s.gameserver.network.serverpackets.Die;
import l2s.gameserver.network.serverpackets.EtcStatusUpdate;
import l2s.gameserver.network.serverpackets.ExMailArrived;
import l2s.gameserver.network.serverpackets.ExStorageMaxCount;
import l2s.gameserver.network.serverpackets.FriendList;
import l2s.gameserver.network.serverpackets.HennaInfo;
import l2s.gameserver.network.serverpackets.ItemList;
import l2s.gameserver.network.serverpackets.NpcHtmlMessage;
import l2s.gameserver.network.serverpackets.PlaySound;
import l2s.gameserver.network.serverpackets.PledgeShowMemberListAll;
import l2s.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
import l2s.gameserver.network.serverpackets.PledgeSkillList;
import l2s.gameserver.network.serverpackets.PledgeStatusChanged;
import l2s.gameserver.network.serverpackets.QuestList;
import l2s.gameserver.network.serverpackets.ShortCutInit;
import l2s.gameserver.network.serverpackets.SkillCoolTime;
import l2s.gameserver.network.serverpackets.SystemMessage;
import l2s.gameserver.network.serverpackets.UserInfo;

public class EnterWorld extends L2GameClientPacket
{
@Override
protected void readImpl()
{
// this is just a trigger packet. it has no content
}

@Override
protected void runImpl()
{
final L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
_log.warn("EnterWorld failed! activeChar is null...");
getClient().closeNow();
return;
}

if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)
{
if (Config.DEBUG)
{
_log.warn("User already exist in OID map! User " + activeChar.getName() + " is character clone.");
}
}

if (activeChar.isGM())
{
if (Config.GM_STARTUP_INVULNERABLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel()))
{
activeChar.setIsInvul(true);
}

if (Config.GM_STARTUP_INVISIBLE && AdminCommandAccessRights.getInstance().hasAccess("admin_hide", activeChar.getAccessLevel()))
{
activeChar.getAppearance().setInvisible();
}

if (Config.GM_STARTUP_SILENCE && AdminCommandAccessRights.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel()))
{
activeChar.setInRefusalMode(true);
}

if (Config.GM_STARTUP_AUTO_LIST && AdminCommandAccessRights.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel()))
{
GmListTable.getInstance().addGm(activeChar, false);
}
else
{
GmListTable.getInstance().addGm(activeChar, true);
}
}

// Set dead status if applies
if (activeChar.getCurrentHp() < 0.5)
{
activeChar.setIsDead(true);
}

final L2Clan clan = activeChar.getClan();
if (clan != null)
{
activeChar.sendPacket(new PledgeSkillList(clan));
notifyClanMembers(activeChar);
notifySponsorOrApprentice(activeChar);

// Add message at connexion if clanHall not paid.
final ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(clan);
if (clanHall != null)
{
if (!clanHall.getPaid())
{
 activeChar.sendPacket(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
}
}

for (Siege siege : SiegeManager.getSieges())
{
if (!siege.isInProgress())
{
 continue;
}

if (siege.checkIsAttacker(clan))
{
 activeChar.setSiegeState((byte) 1);
}
else if (siege.checkIsDefender(clan))
{
 activeChar.setSiegeState((byte) 2);
}
}

activeChar.sendPacket(new PledgeShowMemberListAll(clan, 0));

for (SubPledge sp : clan.getAllSubPledges())
{
activeChar.sendPacket(new PledgeShowMemberListAll(clan, sp.getId()));
}

activeChar.sendPacket(new UserInfo(activeChar));
activeChar.sendPacket(new PledgeStatusChanged(clan));
}

// Updating Seal of Strife Buff/Debuff
if (SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) != SevenSigns.CABAL_NULL))
{
int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId());
if (cabal != SevenSigns.CABAL_NULL)
{
if (cabal == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))
{
 activeChar.addSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());
}
else
{
 activeChar.addSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());
}
}
}
else
{
activeChar.removeSkill(FrequentSkill.THE_VICTOR_OF_WAR.getSkill());
activeChar.removeSkill(FrequentSkill.THE_VANQUISHED_OF_WAR.getSkill());
}

if (Config.PLAYER_SPAWN_PROTECTION > 0)
{
activeChar.setProtection(true);
}

activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

// engage and notify Partner
if (Config.ALLOW_WEDDING)
{
engage(activeChar);
}

// Announcements, welcome & Seven signs period messages
activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE);
SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
Announcements.getInstance().showAnnouncements(activeChar);

// if player is DE, check for shadow sense skill at night
if (activeChar.getRace().ordinal() == 2)
{
// If player got the skill (exemple : low level DEs haven't it)
if (activeChar.getSkillLevel(294) == 1)
{
if (GameTimeController.getInstance().isNowNight())
{
 activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NIGHT_S1_EFFECT_APPLIES).addSkillName(294));
}
else
{
 activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DAY_S1_EFFECT_DISAPPEARS).addSkillName(294));
}
}
}

activeChar.getMacroses().sendUpdate();
activeChar.sendPacket(new UserInfo(activeChar));
activeChar.sendPacket(new HennaInfo(activeChar));
activeChar.sendPacket(new FriendList(activeChar));
// activeChar.queryGameGuard();
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.sendPacket(new ShortCutInit(activeChar));
activeChar.sendPacket(new ExStorageMaxCount(activeChar));
activeChar.updateEffectIcons();
activeChar.sendPacket(new EtcStatusUpdate(activeChar));
activeChar.sendSkillList();

Quest.playerEnter(activeChar);
if (!Config.DISABLE_TUTORIAL)
{
loadTutorial(activeChar);
}

for (Quest quest : QuestManager.getInstance().getAllManagedScripts())
{
if ((quest != null) && quest.getOnEnterWorld())
{
quest.notifyEnterWorld(activeChar);
}
}
activeChar.sendPacket(new QuestList());

// Unread mails make a popup appears.
if (Config.ENABLE_COMMUNITY_BOARD && (MailBBSManager.getInstance().checkUnreadMail(activeChar) > 0))
{
activeChar.sendPacket(SystemMessageId.NEW_MAIL);
activeChar.sendPacket(new PlaySound("systemmsg_e.1233"));
activeChar.sendPacket(ExMailArrived.STATIC_PACKET);
}

// Clan notice, if active.
if (Config.ENABLE_COMMUNITY_BOARD && (clan != null) && clan.isNoticeEnabled())
{
NpcHtmlMessage notice = new NpcHtmlMessage(0);
notice.setFile("data/html-en/clan_notice.htm");
notice.replace("%clan_name%", clan.getName());
notice.replace("%notice_text%", clan.getNotice().replaceAll("\r\n", "<br>").replaceAll("action", "").replaceAll("bypass", ""));
sendPacket(notice);
}
else if (Config.SERVER_NEWS)
{
NpcHtmlMessage html = new NpcHtmlMessage(0);
html.setFile("data/html-en/servnews.htm");
sendPacket(html);
}

PetitionManager.getInstance().checkPetitionMessages(activeChar);

// no broadcast needed since the player will already spawn dead to others
if (activeChar.isAlikeDead())
{
sendPacket(new Die(activeChar));
}

activeChar.onPlayerEnter();

sendPacket(new SkillCoolTime(activeChar));

// If player logs back in a stadium, port him in nearest town.
if (Olympiad.getInstance().playerInStadia(activeChar))
{
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
}

if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))
{
DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);
}

if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
{
activeChar.sendPacket(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED);
}

// Attacker or spectator logging into a siege zone will be ported at town.
if (!activeChar.isGM() && (!activeChar.isInSiege() || (activeChar.getSiegeState() < 2)) && activeChar.isInsideZone(ZoneId.SIEGE))
{
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
}

if (activeChar.getPremiumService() > 0L)
{
if (System.currentTimeMillis() > activeChar.getPremiumService())
{
activeChar.setPremiumService(0L);
}
else
{
activeChar.setPremiumService(activeChar.getPremiumService());
if (Config.SHOW_PREMIUM_STATE_ON_ENTER)
{
 activeChar.showPremiumState(false);
}
}
}
}

private static void engage(L2PcInstance cha)
{
int _chaid = cha.getObjectId();

for (Couple cl : CoupleManager.getInstance().getCouples())
{
if ((cl.getPlayer1Id() == _chaid) || (cl.getPlayer2Id() == _chaid))
{
if (cl.getMaried())
{
 cha.setMarried(true);
}

cha.setCoupleId(cl.getId());
}
}
}

private static void notifyClanMembers(L2PcInstance activeChar)
{
final L2Clan clan = activeChar.getClan();

// Refresh player instance.
clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar);

final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN).addPcName(activeChar);
final PledgeShowMemberListUpdate update = new PledgeShowMemberListUpdate(activeChar);

// Send packet to others members.
for (L2PcInstance member : clan.getOnlineMembers())
{
if (member == activeChar)
{
continue;
}

member.sendPacket(msg);
member.sendPacket(update);
}
}

private static void notifySponsorOrApprentice(L2PcInstance activeChar)
{
if (activeChar.getSponsor() != 0)
{
L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor());
if (sponsor != null)
{
sponsor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN).addPcName(activeChar));
}
}
else if (activeChar.getApprentice() != 0)
{
L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice());
if (apprentice != null)
{
apprentice.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN).addPcName(activeChar));
}
}
}

private static void loadTutorial(L2PcInstance player)
{
QuestState qs = player.getQuestState("Q255_Tutorial");
if (qs != null)
{
qs.getQuest().notifyEvent("UC", null, player);
}
}

@Override
protected boolean triggersOnActionRequest()
{
return false;
}
}

 

 

ты что не компилил не разу? )))) там у него кодировка другая utf 8 быть не должно

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ты что не компилил не разу? )))) там у него кодировка другая utf 8 быть не должно

делал премиум нормально компилил,без проблем

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ты что не компилил не разу? )))) там у него кодировка другая utf 8 быть не должно

Может тебе сначала следует взглянуть на код ?

  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Может тебе сначала следует взглянуть на код ?

class, interface, or enum expected конечно это имелось в веду типиные разработчики интерлюда:D Изменено пользователем amaranthe
  • Upvote 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

class, interface, or enum expected конечно это имелось в веду типиные разработчики интерлюда :D

Обрати внимание на закрытие блоков, разработчик god'а.

Причём тут кодировка вообще ?

pre_1407383390__lnsba1j.png

Изменено пользователем SoFace

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

не кто больше не поможет?=)

Чем помочь ? У тебя getter / setter премиума не реализованы. (Если я правильно выражаюсь)

Изменено пользователем SoFace

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

а если вот такое ?

}

 if (event.equals("premium1"))
 {
  getPremiumState(player);

  if (st.getQuestItemsCount(premiumItemId) >= premiumItemCount)
  {
   st.takeItems(premiumItemId, premiumItemCount);
   addPremiumService(1, player);
   return "PremiumAccount-Success.htm";
  }
  return "PremiumAccount-NoItems.htm";
 }

 if (event.equals("premium2"))
 {
  getPremiumState(player);

  if (st.getQuestItemsCount(premiumItemId) >= (premiumItemCount * 2))
  {
   st.takeItems(premiumItemId, premiumItemCount * 2);
   addPremiumService(3, player);
   return "PremiumAccount-Success.htm";
  }
  return "PremiumAccount-NoItems.htm";
 }

 if (event.equals("premium3"))
 {
  getPremiumState(player);

  if (st.getQuestItemsCount(premiumItemId) >= (premiumItemCount * 3))
  {
   st.takeItems(premiumItemId, premiumItemCount * 3);
   addPremiumService(7, player);
   return "PremiumAccount-Success.htm";
  }
  return "PremiumAccount-NoItems.htm";
 }

 if (event.equals("premium4"))
 {
  getPremiumState(player);

  if (st.getQuestItemsCount(premiumItemId) >= (premiumItemCount * 3))
  {
   st.takeItems(premiumItemId, premiumItemCount * 3);
   addPremiumService(24 * 14, player);
   return "PremiumAccount-Success.htm";
  }
  return "PremiumAccount-NoItems.htm";
 }

 if (event.equals("premium5"))
 {
  getPremiumState(player);

  if (st.getQuestItemsCount(premiumItemId) >= (premiumItemCount * 3))
  {
   st.takeItems(premiumItemId, premiumItemCount * 3);
   addPremiumService(24 * 30, player);
   return "PremiumAccount-Success.htm";
  }
  return "PremiumAccount-NoItems.htm";
 }
 return htmlText;
}

private static void getPremiumState(L2PcInstance player)
{
 try (Connection con = DatabaseFactory.getConnection())
 {
  PreparedStatement statement = con.prepareStatement("SELECT premium_service FROM account_premium WHERE account_name=?");
  statement.setString(1, player.getAccountName());
  ResultSet chars = statement.executeQuery();
  PremiumService = chars.getInt("premium_service");
  chars.close();
  statement.close();
 }
 catch (Exception e)
 {
 }
}

private static void addPremiumService(int hours, L2PcInstance player)
{
 try (Connection con = DatabaseFactory.getConnection())
 {
  Calendar finishtime = Calendar.getInstance();
  finishtime.setTimeInMillis(System.currentTimeMillis());
  finishtime.set(Calendar.SECOND, 0);
  finishtime.add(Calendar.HOUR, hours);

  PreparedStatement statement = con.prepareStatement("UPDATE account_premium SET premium_service=?,enddate=? WHERE account_name=?");
  statement.setInt(1, 1);
  statement.setLong(2, finishtime.getTimeInMillis());
  statement.setString(3, player.getAccountName());
  statement.execute();
  statement.close();
 }
 catch (SQLException e)
 {
  _log.info("EventPremiumNpc:  Could not increase data");
 }
}
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Сказал не посмотрев, прошу прощения. Я так понимаю, сборка Silentium.

Примерное условие на премиум:

player.getPremiumService() == 0

 

Там он уже реализован.

Изменено пользователем SoFace

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Сказал не посмотрев, прошу прощения. Я так понимаю, сборка Silentium.

Примерное условие на премиум:

player.getPremiumService() == 0

 

Там он уже реализован.

прости за не скромный вопрос,а куда это?)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Ребят помогите всунуть такую штуку

 

<html><title>Информация Премиум Сервиса</title><body><br>

<font color="LEVEL">Информация о сервисе:</font><br1>

Статус сервиса: активен <br1>

Дата окончания: %endDate% <br>

 

<font color="LEVEL">Информация о рейтах:</font><br1>

Рейт опыта: %exp%<br1>

Рейт очков: %sp%<br1>

Рейт адены: %adena%<br1>

Рейт спойл: %spoil%<br1>

Рейт дропа: %items%<br1>

</body></html>

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Ребят помогите всунуть такую штуку

 

<html><title>Информация Премиум Сервиса</title><body><br>

<font color="LEVEL">Информация о сервисе:</font><br1>

Статус сервиса: активен <br1>

Дата окончания: %endDate% <br>

 

<font color="LEVEL">Информация о рейтах:</font><br1>

Рейт опыта: %exp%<br1>

Рейт очков: %sp%<br1>

Рейт адены: %adena%<br1>

Рейт спойл: %spoil%<br1>

Рейт дропа: %items%<br1>

</body></html>

 

 

Конкретнее надо писать!

Его можно засунуть как и в ДП так и в Ядро.

%items% и тд. - реализовывается через replace

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Конкретнее надо писать!

Его можно засунуть как и в ДП так и в Ядро.

%items% и тд. - реализовывается через replace

ну и каким образом его засунуть в дп без ядра?если там должны считаться рейты вместе с ПА,и табличка должна появляться только при наличии ПА?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ну и каким образом его засунуть в дп без ядра?если там должны считаться рейты вместе с ПА,и табличка должна появляться только при наличии ПА?

Html закидываешь в ДП.

При входе в игру идет проверка на наличии ПА, если оно есть шлешь html.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

этот html там и находится у меня вот этого нет.

SHOW_PREMIUM_STATE_ON_ENTER = Boolean.parseBoolean(servicesSettings.getProperty("ShowPAStatusOnEnter", "true"));

 

 

 

if (activeChar.getPremiumService() > 0L) {
  if (System.currentTimeMillis() > activeChar.getPremiumService())
  {
    activeChar.setPremiumService(0L);
  }
  else
  {
    activeChar.setPremiumService(activeChar.getPremiumService());
    if (Config.SHOW_PREMIUM_STATE_ON_ENTER) {
	  activeChar.showPremiumState(false);
    }
  }

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...