Jump to content

Recommended Posts

Posted

if (target.getAccessLevel() > 100)

Shouldn't it be

if (target.getAccessLevel() != 0)

?

 

And you should change it

+if (Config.ANNOUNCE_FAMOUS_PLAYER)
+            Announcements.getInstance().announceToAll("Famous player "+activeChar.getName()+" is currently online");

And check if activechar is famous player, not? (inside the "if" already done)

 

And...

if (player.isFamous())
+			    		{
+			    			player.sendMessage("This guy is already famous player");
+			    			return;
+			    		}

The message shouldn't be... "You are a famous player, you can't vote" ? Coz you're checking "player." not "target." (or change player. for target. and move it down some lines)

 

pd: not tested

Posted

Hi i am trying to make this work for my server i am using Hi Five L2J and every thing i added i had no errors, but when i made the L2FamousPlayerInstance.java i pasted the codes and made it to work for my server, but i still have 26 errors:

 

 

/*
* 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.l2jserver.gameserver.model.actor.instance;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import java.util.StringTokenizer;

import javolution.util.FastList;

import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.Announcements;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;

/**
* @author fanky
*
*/
public class L2FamousPlayerInstance extends L2NpcInstance
{


/**
* @param objectId
* @param template
*/
public L2FamousPlayerInstance(int objectId, L2NpcTemplate template)
{
	super(objectId, template);
}

public void onByPassFeedBack(L2PcInstance player,String command)
{
	if (command.startsWith("voteFamousPlayer"))
		    	{
		    		String val = command.substring(14);
		    		StringTokenizer st = new StringTokenizer(val);
		    		
		    		if(st.countTokens() != 1)
		    		{
		    			return;
		    		}
		    		
		    		if (player.getFamousPlayer() != null)
		    		{
		    			player.sendMessage("You have already voted for a player, "player.getFamousPlayer()".");
		    			return;
		    		}
		    		if (player.isFamous())
		    		{
		    			player.sendMessage("You are famous player,u cant vote");
		    			return;
		    		}
		    		L2PcInstance target = L2World.getInstance().getPlayer(st.nextToken());
		    		
		    		if (target == null)
		    		{
		    			player.sendMessage("There isn't such character");
		    			return;
		    		}
		    		if (target.getAccessLevel() > 100)
		    		{
		    			player.sendMessage("Admins and gms don't need to become famous,they already are :P");
		    			return;
		    		}			    		
		    		if (target.getPvpKills() > Config.PVP_REQUIRED_TO_VOTE)
		    		{
		    						
		    		target.setFamousPlayerVotes(target.getFamousPlayerVotes()1);
		    		player.sendMessage("You have successfully voted for "target.getName()".");
		    		target.sendMessage(player.getName()" has voted for you to be a famous player,you currently have "target.getFamousPlayerVotes()" votes");
		    		if (target.getFamousPlayerVotes() == Config.VOTES_REQUIRED_TO_BECOME_FAMOUS)
		    		{
		    			target.setFamous(true);
		    			Announcements.getInstance().announceToAll(target.getName()" has become Famous Player because he reached "Config.VOTES_REQUIRED_TO_BECOME_FAMOUS" vote");
		    			target.setFamousPlayerVotes(0);
		    			cleanDatabase(target.getName());
		    			target.sendMessage("You've become Famous player.");
		    		}
		    		else
		    		{
		    			target.sendMessage("You need at least "Config.PVP_REQUIRED_TO_VOTE" pvp(s) in order to vote");
		    		}
		    	}
		    }
		}
		    
		    private void cleanDatabase(String pname)
		    {
		    	Connection con = null;
		    	try
		    	{
		    		con = L2DatabaseFactory.getInstance().getConnection();
		    		PreparedStatement st = con.prepareStatement("UPDATE characters SET famousplayer=null WHERE famousplayer="pname);
		    		st.execute();
		    		st.close();
		    	}
		    	catch (SQLException sqle)
		    	{
		    		for (L2PcInstance gmchat : L2World.getInstance().getAllGMs())
		    		{
		    			gmchat.sendMessage("There was a problem while updating database on famousplayer column,Noobs!");
		    		}
		    	}
		    	finally
		    	{
		    		try
		    		{
		    			con.close();
		    		}
		    		catch (SQLException sqle2)
		    		{ 
		    			
		    		}
		    	}
		    }
		    
		    @Override
			public String getHtmlPath(int npcId, int val)
		    {
		        String pom = "";
		        if (val == 0)
		        {
		            pom = ""  npcId;
		        }
		        else
		        {
		            pom = npcId  "-"  val;
		        }

		        return "data/html/famousplayer/"  pom  ".htm";
		    }	
}

 

 

Here are the errors, what can i do to fix this thanks so much

 

 

Description	Resource	Path	Location	Type
Syntax error, insert ")" to complete MethodInvocation	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 62	Java Problem
Syntax error, insert ";" to complete BlockStatements	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 62	Java Problem
The operator > is undefined for the argument type(s) L2AccessLevel, int	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 77	Java Problem
Syntax error on token "1", delete this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 85	Java Problem
The method getFamousPlayer() in the type L2PcInstance is not applicable for the arguments (String)	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 62	Java Problem
Syntax error on token ")", delete this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 62	Java Problem
Syntax error on token "PVP_REQUIRED_TO_VOTE", ( expected after this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 98	Java Problem
The method PVP_REQUIRED_TO_VOTE(String) is undefined for the type Config	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 98	Java Problem
Syntax error on token "pname", delete this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 110	Java Problem
Syntax error on token "npcId", delete this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 140	Java Problem
Syntax error on token "" has become Famous Player because he reached "", [ expected	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 91	Java Problem
Syntax error on token "" vote"", ] expected	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 91	Java Problem
Syntax error, insert ")" to complete MethodInvocation	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 98	Java Problem
Syntax error, insert ";" to complete BlockStatements	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 98	Java Problem
The type of the expression must be an array type but it resolved to String	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 87	Java Problem
Syntax error on token "" has voted for you to be a famous player,you currently have "", [ expected	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 87	Java Problem
Syntax error on token "" votes"", ] expected	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 87	Java Problem
The type of the expression must be an array type but it resolved to String	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 91	Java Problem
Syntax error, insert ")" to complete MethodInvocation	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 86	Java Problem
Syntax error, insert ";" to complete Statement	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 86	Java Problem
The method getName() in the type L2Object is not applicable for the arguments (String)	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 86	Java Problem
Syntax error on token ")", delete this token	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 86	Java Problem
Syntax error on token ""-"", . expected	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 144	Java Problem
The primitive type int of npcId does not have a field val	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 144	Java Problem
Syntax error on token "pom", invalid AssignmentOperator	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 147	Java Problem
The left-hand side of an assignment must be a variable	L2FamousPlayerInstance.java	/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance	line 147	Java Problem

  • 2 weeks later...
Posted

It should work.

I coded from scrath,dunno if i miss something >.> but seems that I didnt.

whatever,just report it here if it doesn't workin' properly.

Check again your code....

nice idea ;)

  • 6 months later...
Posted

Well fanky cant code it for L2JFrozen cause he study for university if i remember well.

 

why u spam? u could send that via PM

  • 1 month later...
Posted

bump to this.I want to know if someone tested this..

 

can someone give me a feedback..?

why you put this method in PcInstance ?

 

+	public String getFamousPlayer()
+	{
+		    return famousplayer;
+	}

Posted

why you put this method in PcInstance ?

 

+	public String getFamousPlayer()
+	{
+		    return famousplayer;
+	}

so it can be safely accessed, if anyone wanted so

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

    • 🚀 L2-Gold Custom PvP – Beta Test is LIVE! 🚀 Hey guys! We are opening a brand new Custom PvP server and looking for passionate players to help us test it out before the official grand opening! 💥 What we offer: High Rates & Custom PvP Gameplay Custom NPC Buffer, GM Shop & Global GK Balanced classes and epic custom items Interlude with c4 skills 🎁 Beta Rewards: Every active tester who reports bugs or gives feedback will receive Exclusive Custom Rewards on the official launch day! 🛑 No website needed yet! All files, patch, and support are inside our Discord. 🔗 Join Beta Test Here: [https://discord.gg/9qkSxQtTq]
    • "CAN YOU DO A BULGARIAN REVOLUT?" – WE DID. FIRST DRAFT, NO EDITS The request came in short: a photo of a bank card, Bulgaria, Revolut. We said yes and asked the only question that matters – what data. The client was on the road, asked for a couple of hours, then sent the lot: number, expiry, CVV, payment system, bank, cardholder name. Then came the part the client never sees: - ran the number through Luhn – the check digit has to add up, otherwise the card is dead the second anything automated looks at it - matched the BIN to the issuer: Revolut in Bulgaria isn't a "local bank", the cards run through Revolut Bank UAB. The number range has to actually belong there, not just start with the right digit - built the current design, not a five-year-old picture: vertical layout, flat laser print instead of embossing, correct chip module, contactless mark where it belongs - the payment system logo – with the right gradient where the circles overlap and the wordmark sitting exactly where it should. A small thing that kills half the fakes out there - and finally, physics. Plastic has to catch light: a highlight along the edge, a micro-shadow under the chip, a faint fingerprint. A phone shot, not a render Sent the draft for approval. The client looked it over, signed off with zero corrections – final files went out. One pass, no rework. A card is a deceptively simple document. Looks like a rectangle and sixteen digits. In reality it's maths in the number, a tie to the issuer, a current design and light on plastic. Miss any one of the four and the file gets exactly two seconds of attention. Need a card for a specific bank and country? Message us. We'll tell you straight what's realistic for your case – then build it. { all data published with the client's consent} › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #drawing #card #photoshop #revolut #case
    • ============================================================               CLExt Classic Interlude: v7.80 ============================================================   01. Fixed ValidateLocation handling and player/client position synchronization. 02. Added protection against invalid coordinates and characters falling under the map. 03. Improved XY/Z position and heading validation. 04. Fixed MoveToLocation and MoveToPawn packet conversion and target validation. 05. Fixed TargetSelected, TargetUnselected and MyTargetSelected packet handling. 06. Improved GeoData Z-location handling and disabled unsafe PathNode modifications. 07. Added ExUserInfoInventoryWeight support. 08. Fixed inventory weight and maximum load synchronization. 09. Fixed incorrect 0% inventory weight after character login. 10. Added automatic inventory weight updates after EnterWorld and inventory changes. 11. Added inventory weight packet spam protection and safe weight caching. 12. Fixed BuyList and SellList inventory, slot and weight synchronization. 13. Improved NPC target and Buy/Sell packet validation. 14. Reworked mail attachment inventory and weight validation. 15. Added all-or-nothing mail attachment receiving and safe retry handling. 16. Fixed stackable mail attachment validation and INT_MAX overflow protection. 17. Improved COD Adena validation and post-mail inventory weight refresh. 18. Improved Warehouse Deposit and Withdraw validation. 19. Added protection against malformed warehouse item counts, DBIDs and amounts. 20. Added warehouse INT_MAX, CItem and pSID validation. 21. Improved warehouse anti-dupe protection. 22. Reworked the HTML Cache system for improved stability and memory usage. 23. Added lazy HTML loading instead of loading ~20,000 files during startup. 24. Fixed HTML Cache startup crashes with large HTML collections. 25. Added thread-safe HTML Cache access and Clear/Reload support. 26. Added bad allocation, invalid HTML and oversized HTML protection. 27. Reduced HTML Cache RAM usage, startup allocations and disk I/O. 28. Added HTML Caching ON/OFF with live HTM loading support. 29. Fixed ToggleCachingHook and added VS2005-compatible live HTML handling. 30. Fixed ShortcutInit processing and skill synchronization order. 31. Improved shortcut item validation, augmentation handling and va_list safety. 32. Added LiveMode Ability Point system. 33. Added inventory-item-based Ability Points with configurable pointItemId. 34. Preserved the original level-based Ability Point system as fallback. 35. Fixed incorrect Ability Point display and inventory synchronization. 36. Improved Ability skill learning and point validation. 37. Improved OfflineShopRestore loading and FakePC/DBID handling. 38. Added safer OfflineShopRestore socket limits and batch processing. 39. Prevented thousands of restore sockets from loading simultaneously. 40. Added delayed, non-blocking OfflineShopRestore after server startup. 41. Improved OnEnterWorld initialization order and stability. 42. Improved inventory weight, SkillList and acquired-skill initialization after login. 43. Added VIP integration to the EnterWorld process. 44. Added safe UserExtData initialization without modifying the native User structure. 45. Improved duplicate Bronch Jewel and equipped-slot protection. 46. Improved Bracelet, Belt, Bronch and general UseItem validation. 47. Improved general packet, UserSocket, User, pSD and Creature validation. 48. Added safer INT32/INT64 packet handling and malformed-packet protection. 49. Improved L2Server startup memory usage and lazy resource loading. 50. Reduced unnecessary startup allocations. 51. Improved account-only KeyEngine authentication and remote account validation. 52. Removed account expiration-time requirements. 53. Added updater/restart design without requiring CLExtUpdate.exe. 54. Improved CLIEXT HWID, shared-memory and client/server version validation. 55. Improved ReadFile/WriteFile hooks and MemoryProtector handling. 56. Added UoPilot and Extreme Injector detection handling. 57. Reworked VIP point loading, saving and database synchronization. 58. Fixed VIP Level 0 initialization and first VIP activation. 59. Fixed vip.htm activation after login and from party-shared points. 60. Fixed VIP points being incorrectly reset before successful activation. 61. Improved VIP progression from Level 1 through Level 7. 62. Added proper VIP Level 7 MAX/DONE behavior with no Level 8 requirement. 63. Disabled further VIP point collection after reaching maximum level. 64. Reworked VIP BonusInfo/ReceiveVipInfo packet synchronization. 65. Fixed VIP tier, points, duration and level requirement packet fields. 66. Added VIP duration, tier, point and User validation protections. 67. Added safer 64-bit VIP EXP and party EXP calculations. 68. Preserved subclass maximum EXP protection. 69. Improved ItemDataEx validation during character loading. 70. Fixed augmentation loss during login, relog and server restart. 71. Added safe restoration of augmentation IDs directly from the database. 72. Added CItem, pSID, pExItem and User validation during ItemDataEx loading. 73. Improved Shadow Item mana and item lifetime loading. 74. Preserved item protection timeout data during character loading. 75. Added augmentation loading diagnostics and protected valid augmentation data. 76. Preserved database value 0 for genuinely non-augmented items. 77. Added RaidBoss Status synchronization with the World Map. 78. Fixed alive/dead RaidBoss status updates after spawn and death. 79. Added RaidBossStatus as the source of truth for RaidBoss map packets. 80. Fixed RaidBoss map status synchronization after server/database loading.
    • 🚀 L2AQUILA — GRAND OPENING TOMORROW! Lineage 2 Gracia Final — Like L2 Pride, but fresh. The server you've been waiting for opens tomorrow, Saturday 19/09, 16:00 (Greek time) — No Wipe · 24/7 · Anti-DDoS. ⚔️ What's inside: • EXP 9300x · SP 3000x · Adena 5500x · High drop • Max enchant +20 · Safe +3 · 24 buffs / 3 debuffs • 20 free Custom Coins for every new player on day one! • Custom farming zones (Cave of Trials, Cemetery, Ruins of Despair + more) • PvP Events · Olympiads · Offline Trading · Weddings · Balanced classes • Starter + Dynasty shops in every town — playable from minute one 📥 Download: Client + Patch at https://l2aquila.com/index.html 💬 Discord: discord.gg/5ZyBRvG4k · Facebook: facebook.com/l2aquila Be there at opening hour — bring your squad. See you at the Grand Opening! 🔥
  • 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..