Jump to content

Recommended Posts

Posted

Index: /TrunK/L2JBrasil_CORE/java/config/L2JBrasil-Custom.properties
===================================================================
--- /TrunK/L2JBrasil_CORE/java/config/L2JBrasil-Custom.properties (revision 59)
+++ /TrunK/L2JBrasil_CORE/java/config/L2JBrasil-Custom.properties (revision 65)
@@ -30,2 +30,15 @@
# Castle Circlets can be equipped only by clan members if they own a castle - default true 
CastleCircletsRestriction = True
+
+#--------------------------------------------------------------- 
+# Donator Config                                               - 
+#---------------------------------------------------------------  
+# Donator Color Name & Title Config  
+# Donator Name Color Enabled?. 
+DonatorNameColorEnabled = False 
+# Donator Color Name Selection 
+DonatorColorName = 00FFFF 
+# Donator Title Color Enabled? 
+DonatorTitleColorEnabled = False 
+# Donator Color Name Selection 
+DonatorTitleColor = 00FF00
Index: /TrunK/L2JBrasil_CORE/java/net/sf/l2j/Config.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/net/sf/l2j/Config.java (revision 59)
+++ /TrunK/L2JBrasil_CORE/java/net/sf/l2j/Config.java (revision 65)
@@ -891,4 +891,8 @@
     public static boolean   CASTLE_CROWN; 
     public static boolean   CASTLE_CIRCLETS; 
+    public static boolean   DONATOR_NAME_COLOR_ENABLED; 
+    public static int               DONATOR_NAME_COLOR; 
+    public static boolean   DONATOR_TITLE_COLOR_ENABLED; 
+    public static int               DONATOR_TITLE_COLOR; 
     /** L2JBRASIL Custom - End */   
     
@@ -1983,5 +1987,10 @@
                is.close(); 
                 
-                CASTLE_SHIELD = Boolean.parseBoolean(L2JBrasilCustom.getProperty("CastleShieldRestriction", "true"));  
+               DONATOR_NAME_COLOR_ENABLED = Boolean.parseBoolean(L2JBrasilCustom.getProperty("DonatorNameColorEnabled", "False")); 
+               DONATOR_NAME_COLOR  = Integer.decode("0x" + L2JBrasilCustom.getProperty("DonatorColorName", "00FFFF")); 
+               DONATOR_TITLE_COLOR_ENABLED = Boolean.parseBoolean(L2JBrasilCustom.getProperty("DonatorTitleColorEnabled", "False")); 
+               DONATOR_TITLE_COLOR = Integer.decode("0x" + L2JBrasilCustom.getProperty("DonatorTitleColor", "00FF00")); 
+
+               CASTLE_SHIELD = Boolean.parseBoolean(L2JBrasilCustom.getProperty("CastleShieldRestriction", "true"));  
                 CLANHALL_SHIELD = Boolean.parseBoolean(L2JBrasilCustom.getProperty("ClanHallShieldRestriction", "true"));  
                 APELLA_ARMORS = Boolean.parseBoolean(L2JBrasilCustom.getProperty("ApellaArmorsRestriction", "true"));  
@@ -1989,5 +1998,5 @@
                 CASTLE_CROWN = Boolean.parseBoolean(L2JBrasilCustom.getProperty("CastleLordsCrownRestriction", "true"));  
                 CASTLE_CIRCLETS = Boolean.parseBoolean(L2JBrasilCustom.getProperty("CastleCircletsRestriction", "true"));                 
-            } 
+           } 
             catch (Exception e) 
             { 
Index: /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java (revision 56)
+++ /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java (revision 65)
@@ -153,5 +153,13 @@
             activeChar.setProtection(true);

-               activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
+        if (activeChar.isdonator()) 
+                    { 
+                             activeChar.getAppearance().setNameColor(Config.DONATOR_NAME_COLOR); 
+                         activeChar.getAppearance().setTitleColor(Config.DONATOR_TITLE_COLOR); 
+                          activeChar.sendMessage("Welcome "+activeChar.getName()+" to our Server!"); 
+                           activeChar.sendMessage("Enjoy your Stay Mate!"); 
+                     } 
+        
+        activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

                if (L2Event.active && L2Event.connectionLossData.containsKey(activeChar.getName()) && L2Event.isOnEvent(activeChar))
Index: /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 57)
+++ /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 65)
@@ -216,6 +216,6 @@
        private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";

-    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";
-    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";
+    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,donator=?  WHERE obj_id=?";
+    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,donator FROM characters WHERE obj_id=?";
     private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
     private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
@@ -453,5 +453,6 @@
        private boolean _noble = false;
        private boolean _hero = false;
-
+       private boolean _donator = false; 
+       
        /** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
        private L2FolkInstance _lastFolkNpc = null;
@@ -5480,5 +5481,5 @@
                                                         "exp,sp,karma,pvpkills,pkkills,clanid,maxload,race,classid,deletetime," +
                                                         "cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace," +
-                                                        "base_class,newbie,nobless,power_grade,last_recom_date) " +
+                                                        "base_class,newbie,nobless,power_grade,last_recom_date,donator) " +
                        "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
                        statement.setString(1, _accountName);
@@ -5539,4 +5540,5 @@
                        statement.setLong(56, 0);
                        statement.setLong(57,System.currentTimeMillis());
+            statement.setInt(58, isdonator() ? 1 :0); 
                        statement.executeUpdate();
                        statement.close();
@@ -5612,5 +5614,6 @@
                                player.setNewbie(rset.getInt("newbie")==1);
                                player.setNoble(rset.getInt("nobless")==1);
-
+                               player.setdonator(rset.getInt("donator")==1); 
+                               
                                player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
                                if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
@@ -6076,5 +6079,6 @@
                        statement.setString(55, getName());
                        statement.setLong(56, getDeathPenaltyBuffLevel());
-            statement.setInt(57, getObjectId());
+            statement.setInt(57, isdonator() ? 1 : 0); 
+            statement.setInt(58, getObjectId()); 

                        statement.execute();
@@ -6207,4 +6211,14 @@
     {
         return _isIn7sDungeon;
+    } 
+     
+    public boolean isdonator() 
+    { 
+        return _donator; 
+    } 
+     
+    public void setdonator(boolean donator) 
+    { 
+        _donator = donator; 
     }

Index: /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminDonator.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminDonator.java (revision 65)
+++ /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminDonator.java (revision 65)
@@ -0,0 +1,165 @@
+/*
+ * 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.handler.admincommandhandlers;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.GmListTable;
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.L2Object;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+/**
+ *
+ * Author Rayan
+ *
+ */
+public class AdminDonator implements IAdminCommandHandler
+{
+       private static String[] _adminCommands =
+       {
+               "admin_setdonator",};
+       private final static Log _log = LogFactory.getLog(AdminDonator.class.getName());
+       private static final int REQUIRED_LEVEL = Config.GM_MENU;
+
+       public boolean useAdminCommand(String command, L2PcInstance activeChar)
+       {
+               if (!Config.ALT_PRIVILEGES_ADMIN)
+               {
+                       if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
+                       {
+                               return false;
+                       }
+               }
+               if (command.startsWith("admin_setdonator"))
+               {
+                       L2Object target = activeChar.getTarget();
+                       L2PcInstance player = null;
+                       SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
+                       if (target instanceof L2PcInstance)
+                       {
+                               player = (L2PcInstance)target;
+                       } else
+                       {
+                               player = activeChar;
+                       }
+
+                       if (player.isdonator())
+                       {
+                               player.setdonator(false);
+                               sm.addString("You are no longer a server donator.");
+                               GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed donator stat of player"+ target.getName());
+                               Connection connection = null;
+                               try
+                               {
+                                       connection = L2DatabaseFactory.getInstance().getConnection();
+
+                                       PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
+                                       statement.setString(1,target.getName());
+                                       ResultSet rset = statement.executeQuery();
+                                       int objId = 0;
+                                       if (rset.next())
+                                       {
+                                               objId = rset.getInt(1);
+                                       }
+                                       rset.close();
+                                       statement.close();
+
+                                       if (objId == 0) {connection.close(); return false;}
+
+                                       statement = connection.prepareStatement("UPDATE characters SET donator=0 WHERE obj_id=?");
+                                       statement.setInt(1, objId);
+                                       statement.execute();
+                                       statement.close();
+                                       connection.close();
+                               }
+                               catch (Exception e)
+                               {
+                                       _log.warn("could not set donator stats of char:", e);
+                               }
+                               finally
+                               {
+                                       try { connection.close(); } catch (Exception e) {}
+                               }
+                       }
+                       else
+                       {
+                               player.setdonator(true);
+                               sm.addString("You are now a server donator, congratulations!");
+                               GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given donator stat for player "+target.getName()+".");
+                               Connection connection = null;
+                               try
+                               {
+                                       connection = L2DatabaseFactory.getInstance().getConnection();
+
+                                       PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
+                                       statement.setString(1,target.getName());
+                                       ResultSet rset = statement.executeQuery();
+                                       int objId = 0;
+                                       if (rset.next())
+                                       {
+                                               objId = rset.getInt(1);
+                                       }
+                                       rset.close();
+                                       statement.close();
+
+                                       if (objId == 0) {connection.close(); return false;}
+
+                                       statement = connection.prepareStatement("UPDATE characters SET donator=1 WHERE obj_id=?");
+                                       statement.setInt(1, objId);
+                                       statement.execute();
+                                       statement.close();
+                                       connection.close();
+                               }
+                               catch (Exception e)
+                               {
+                                       _log.warn("could not set donator stats of char:", e);
+                               }
+                               finally
+                               {
+                                       try { connection.close(); } catch (Exception e) {}
+                               }
+
+                       }
+                       player.sendPacket(sm);
+                       player.broadcastUserInfo();
+                       if(player.isdonator() == true)
+                       {
+                               Announcements.getInstance().announceToAll(player.getName() + " Has Become a Server Donator!");
+                       }
+               }
+               return false;
+       }
+   public String[] getAdminCommandList() {
+               return _adminCommands;
+       }
+       private boolean checkLevel(int level)
+       {
+               return (level >= REQUIRED_LEVEL);
+       }
+}
Index: /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/GameServer.java (revision 56)
+++ /TrunK/L2JBrasil_CORE/java/net/sf/l2j/gameserver/GameServer.java (revision 65)
@@ -77,4 +77,5 @@
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCursedWeapons;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminDelete;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminDonator; 
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminDoorControl;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEditChar;
@@ -570,4 +571,5 @@
         _adminCommandHandler.registerAdminCommandHandler(new AdminTvTEvent());
         //_adminCommandHandler.registerAdminCommandHandler(new AdminRadar());
+        _adminCommandHandler.registerAdminCommandHandler(new AdminDonator()); 
         _log.config("AdminCommandHandler: Loaded " + _adminCommandHandler.size() + " handlers.");

Credits: Guma

Source: L2Jbrasil svn

Posted

That's too simple.

Not to mention that even if you don't enable the use of the colors system, iy will be enabled, since there is no check when the player gets the appearence.

 

Here: if (activeChar.isdonator())

+                    {

+                            activeChar.getAppearance().setNameColor(Config.DONATOR_NAME_COLOR);

+                        activeChar.getAppearance().setTitleColor(Config.DONATOR_TITLE_COLOR);

 

  • 1 month later...
Posted

Well...can someone explain what ecxactly it is?

 

A kind of failed donations system, with a few configurations like "privs" for donator characters..

Kinda useless for me in this way of build, but anyway..

Posted

I didn't read the whole code but what I figured out is that it gives custom color to name and title of the donator.

It will also make an announcement once a donator will go in-game.

Well,it's not something unique since it has been coded many times in a different way but thanks anyway!

  • 1 year later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hi, I'm selling Interface sources. I was working with one of bigger Essence projects (for ±1 year) delivering them Interface source KR. Per this period gathered knowledge about UE, UE Scripting, saw a lot of tools and their progression. So finally I decided that I can open up my own sales topic. I'm selling source for any protocol - If I don't have source, I will need you to provide whole system folder or for Essence/main - provide me protocol number. Sources are acquired by my OWN decompiler - written in Java, so we're not using popular UEExplorer upgraded by anyone. Decompiler extracts already compile ready sources. It outputs clean code, however constants are mapped 60-70%. Why only 60-70%? Well tl;dr when you compile any sources, they take at that time constant value and place it instead of = CONST_NAME to = THAT_CONST_NAME_VALUE, so it's not possible to have const name instead of value. Example of output: https://pastebin.com/cjyXcJvT for bigger .uc class (557p). p.s pastebin messed up encoding, but KR symbols are preserved - you won't see "?" symbols, rather you will see proper original korean text. I will give you guide as well, how not to mess it up with your editor VS Code/Notepad++ or what you use it to make them preserve it. You will get source + my compiler wrapper (written in java) - works on Windows/Mac/Linux - it has small GUI but supports CLI. Small notice, who thinks 'this is decompiled source' - basically all sources that are on sale are made by decompiling .u and applying changes. I think powerhouse few years ago was ArtToKill/kick (kick added support for INT64 to the publicly available compiler sources) etc. So no - there are no straight from 'creator' sources anywhere, all sellers offer the same - just the quality is different. UEExplorer upgraded was a big step, however, it introduces still a lot of nesting, if statements wrapping incorrectly which could lead to bugs. There are many things how to identify poor quality sources, as if the seller tries to sell 'out-of-box' when they see it compiles - sad news, some bugs are in the logic due to seller focusing only on 'it compiles' rather than issues that their decompiler is not capable so solve. On request I can restore ±100% const mapping.   Later I can attach compiled .u to try. Price is 400EUR. Payment methods USDT (Crypto). I'm still in debate with myself, wether to start selling XDat Editor with structures and ClientDat with 100% all files openings (no unk namings) and improved experience (such as comments support in .dat files, mass sync, improved performance and so on). P.s. If you ask me to give you some project's custom interface - the price may vary - there are couple things per project that need to be hand checked and adjusted (for example Innadril completely changes tokens which then I need to adjust my program to their token Ids). So it might take more time = more money. P.s.s. I have more things in the garage, like my own dsetup source that can allow you 'unlocking' system with your desired encrypting - you don't need to wait till 'patched' systems start appearing and so on, but I think at this time everyone who needs it make them selves it. AAC crypt removals and so on, BuildZone, everything that 'unlocks' client, however, I don't plan to make them on sale as mentioned, everyone can do them.  
    • It has been a while since I updated this thread. I am currently actively working on a full-scale port of the shader library to ensure the fast and accurate transfer of all effects. I have decompiled the original game and created a tool that fully logs the entire *Lineage 2 Interlude* particle system. This allows me to extract the original formulas hardcoded into the game, resulting in a high-fidelity port. For instance, *Lineage 2* uses an `appRnd` system that generates unique randomization patterns for different skills, giving them distinct visual characteristics; there are countless formulas and technical nuances like this. Ultimately, I will derive all the key formulas and replicate the geometry with high precision. Twelve basic geometry formulas have already been ported. The effect was created in 10 minutes using a .uc file, HLSL formulas, and SpriteEmitter particle blending formulas.   https://prnt.sc/_3UDLQVX_Y-_
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..