Jump to content
  • 0

[Help] XP/SP


Question

4 answers to this question

Recommended Posts

  • 0
Posted

here is enterworld.java what i have to change?

/*

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

 

import com.l2jesios.Config;

import com.l2jesios.gameserver.Announcements;

import com.l2jesios.gameserver.GameTimeController;

import com.l2jesios.gameserver.SevenSigns;

import com.l2jesios.gameserver.ThreadPoolManager;

import com.l2jesios.gameserver.cache.HtmCache;

import com.l2jesios.gameserver.datatables.AdminCommandAccessRights;

import com.l2jesios.gameserver.datatables.CharSchemesTable;

import com.l2jesios.gameserver.datatables.GmListTable;

import com.l2jesios.gameserver.datatables.MapRegionTable;

import com.l2jesios.gameserver.datatables.SkillTable.FrequentSkill;

import com.l2jesios.gameserver.instancemanager.ClanHallManager;

import com.l2jesios.gameserver.instancemanager.CoupleManager;

import com.l2jesios.gameserver.instancemanager.DimensionalRiftManager;

import com.l2jesios.gameserver.instancemanager.PetitionManager;

import com.l2jesios.gameserver.instancemanager.QuestManager;

import com.l2jesios.gameserver.instancemanager.SiegeManager;

import com.l2jesios.gameserver.instancemanager.SiegeReward;

import com.l2jesios.gameserver.model.L2Clan;

import com.l2jesios.gameserver.model.L2World;

import com.l2jesios.gameserver.model.actor.L2Character;

import com.l2jesios.gameserver.model.actor.instance.L2PcInstance;

import com.l2jesios.gameserver.model.addons.L2AccountManager;

import com.l2jesios.gameserver.model.addons.PvPColorSystem;

import com.l2jesios.gameserver.model.addons.StartupSystem;

import com.l2jesios.gameserver.model.addons.VipEngine;

import com.l2jesios.gameserver.model.entity.ClanHall;

import com.l2jesios.gameserver.model.entity.Couple;

import com.l2jesios.gameserver.model.entity.Siege;

import com.l2jesios.gameserver.model.olympiad.Olympiad;

import com.l2jesios.gameserver.model.quest.Quest;

import com.l2jesios.gameserver.model.quest.QuestState;

import com.l2jesios.gameserver.network.SystemMessageId;

import com.l2jesios.gameserver.network.serverpackets.CreatureSay;

import com.l2jesios.gameserver.network.serverpackets.Die;

import com.l2jesios.gameserver.network.serverpackets.EtcStatusUpdate;

import com.l2jesios.gameserver.network.serverpackets.ExShowScreenMessage;

import com.l2jesios.gameserver.network.serverpackets.ExStorageMaxCount;

import com.l2jesios.gameserver.network.serverpackets.FriendList;

import com.l2jesios.gameserver.network.serverpackets.HennaInfo;

import com.l2jesios.gameserver.network.serverpackets.ItemList;

import com.l2jesios.gameserver.network.serverpackets.NpcHtmlMessage;

import com.l2jesios.gameserver.network.serverpackets.PledgeShowMemberListAll;

import com.l2jesios.gameserver.network.serverpackets.PledgeShowMemberListUpdate;

import com.l2jesios.gameserver.network.serverpackets.PledgeSkillList;

import com.l2jesios.gameserver.network.serverpackets.PledgeStatusChanged;

import com.l2jesios.gameserver.network.serverpackets.QuestList;

import com.l2jesios.gameserver.network.serverpackets.ShortCutInit;

import com.l2jesios.gameserver.network.serverpackets.SkillCoolTime;

import com.l2jesios.gameserver.network.serverpackets.SystemMessage;

import com.l2jesios.gameserver.network.serverpackets.UserInfo;

 

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Calendar;

 

import javolution.text.TextBuilder;

 

 

 

 

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.warning("EnterWorld failed! activeChar is null...");

getClient().closeNow();

return;

}

 

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

{

if (Config.DEBUG)

_log.warning("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);

}

 

if(Config.PVP_COLOR_ENABLED)

{

PvPColorSystem pvpcolor = new PvPColorSystem();

pvpcolor.updateNameColor(activeChar);

pvpcolor.updateTitleColor(activeChar);

}

 

if(SiegeReward.ACTIVATED_SYSTEM && !SiegeReward.REWARD_ACTIVE_MEMBERS_ONLY)

SiegeReward.getInstance().processWorldEnter(activeChar);

 

if(Config.VIP_ENABLE)

VipEngine.onEnterVip(activeChar);

VipEngine.onEnterVipMessage(activeChar);

 

if (Config.AIO_ENABLE)

VipEngine.onEnterAio(activeChar);

 

if(Config.STARTUP_SYSTEM_ENABLED)

StartupSystem.startIt(activeChar);

 

// Set dead status if applies

if (activeChar.getCurrentHp() < 0.5)

activeChar.setIsDead(true);

 

if (activeChar.getClan() != null)

{

activeChar.sendPacket(new PledgeSkillList(activeChar.getClan()));

notifyClanMembers(activeChar);

notifySponsorOrApprentice(activeChar);

 

// Add message at connexion if clanHall not paid.

ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan());

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.getIsInProgress())

continue;

 

if (siege.checkIsAttacker(activeChar.getClan()))

activeChar.setSiegeState((byte) 1);

else if (siege.checkIsDefender(activeChar.getClan()))

activeChar.setSiegeState((byte) 2);

}

 

activeChar.sendPacket(new PledgeShowMemberListAll(activeChar.getClan(), activeChar));

activeChar.sendPacket(new PledgeStatusChanged(activeChar.getClan()));

}

 

// 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());

 

// buff and status icons

if (Config.STORE_SKILL_COOLTIME)

activeChar.restoreEffects();

 

// 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_EFFECT_APPLIES).addSkillName(294));

else

activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DAY_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.sendPacket(new EtcStatusUpdate(activeChar));

activeChar.sendSkillList();

 

        if (Config.ALLOW_SCREEN_MESSAGE)

        activeChar.sendPacket(new ExShowScreenMessage(Config.SCREEN_MESSAGE, 6000));

       

        if(Config.ALLOW_ACCOUNT_MAILER)

        {

        if (!L2AccountManager.hasSubEmail(activeChar))

        ThreadPoolManager.getInstance().scheduleGeneral(new entermail(activeChar), 20000);

        }

        if (Config.ALLOW_ENTER_MESSAGES)

        {

        CreatureSay np = new CreatureSay(0, Say2.PARTY,Config.PREFIX, Config.MESSAGE_1);

        activeChar.sendPacket(np);

        CreatureSay nd = new CreatureSay(0, Say2.PARTY,Config.PREFIX, Config.MESSAGE_2);

        activeChar.sendPacket(nd);

        CreatureSay ns = new CreatureSay(0, Say2.PARTY,Config.PREFIX, Config.MESSAGE_3);

        activeChar.sendPacket(ns);

        }

       

        if (Config.ALLOW_LAST_VISIT_INFORMATION)

    {

        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");

        Calendar calendar = Calendar.getInstance();

        calendar.setTimeInMillis(activeChar.getLastAccess());

        if (activeChar.getUptime() > 1)

            activeChar.sendMessage("Your last visit was at " + formatter.format(calendar.getTime()));

        }

       

Quest.playerEnter(activeChar);

if (!Config.DISABLE_TUTORIAL)

loadTutorial(activeChar);

 

if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)

    if (!activeChar.isAio())

    activeChar.checkAllowedSkills();

 

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

{

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

quest.notifyEnterWorld(activeChar);

}

activeChar.sendPacket(new QuestList());

 

if (Config.SERVER_NEWS)

{

String serverNews = HtmCache.getInstance().getHtm("data/html/servnews.htm");

if (serverNews != null)

sendPacket(new NpcHtmlMessage(1, serverNews));

}

 

if ( Config.TEST_SERVER || Config.SERVER_GMONLY)

{

activeChar.sendMessage("This Server uses L2j Esios Pack.");

        activeChar.sendMessage("www.l2jesios.org");

}

 

        if(activeChar.getClan() != null)

        {

        if(activeChar.getClan().getClanMes() != null)

        {

        CreatureSay np = new CreatureSay(0, Say2.ALLIANCE,activeChar.getClan().getLeader().getName() , activeChar.getClan().getClanMes());

        activeChar.sendPacket(np);

        }

        }

       

        if (Config.NPCBUFFER_FEATURE_ENABLED)

        CharSchemesTable.getInstance().onPlayerLogin(activeChar.getObjectId());

       

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(L2Character.ZONE_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());

}

}

}

 

class entermail implements Runnable{

private L2PcInstance p;

   

public entermail(L2PcInstance player)

{

  p = player;

}

   

@Override

public void run()

{

subhtml(p);

}

 

}

 

public void subhtml(L2PcInstance player)

{

TextBuilder tb = new TextBuilder();

NpcHtmlMessage html = new NpcHtmlMessage(1);

       

tb.append("<html><head><title>Submit your Email</title></head>");

tb.append("<body>");     

tb.append("<center>");

tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");

tb.append("<tr>");

tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");

tb.append("<td valign=\"top\"><font color=\"FF6600\">Email submitance</font>");

tb.append("<br1><font color=\"00FF00\">"+player.getName()+"</font>, please submit here your REAL email address.</td></tr></table></center>");

tb.append("<center>");

tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");

tb.append("</center>");

tb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");

tb.append("<tr>");

tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");

tb.append("<td valign=\"top\">Please enter your Email:<multiedit var=\"email1\" width=180 height=15>");

tb.append("<br1>We need this to be your real one.</td>");

tb.append("</tr>");

tb.append("</table>");

tb.append("<br>");

tb.append("<center>");

tb.append("<button value=\"Submit\" action=\"bypass -h submitemail $email1\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");

tb.append("</center>");

tb.append("<center>");

tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");

tb.append("<font color=\"FF6600\">By Elfocrash</font>");

tb.append("</center>");

tb.append("</body></html>");

       

html.setHtml(tb.toString());

player.sendPacket(html);

}

 

private static void notifyClanMembers(L2PcInstance activeChar)

{

L2Clan clan = activeChar.getClan();

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

 

SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN);

msg.addPcName(activeChar);

 

clan.broadcastToOtherOnlineMembers(msg, activeChar);

clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar);

 

msg = null;

}

 

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("Tutorial");

if (qs != null)

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

}

 

@Override

protected boolean triggersOnActionRequest()

{

return false;

}

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...