-
Posts
7,281 -
Credits
0 -
Joined
-
Last visited
-
Days Won
2 -
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by Fanky
-
I thought the same when someone suggest it to me.Then i thought,it wont be so useless e.g if someone says noobserver or something or dunno,and gm is offline players can vote for jail xd
-
who knows >< anyway,its funny really :D
-
Its simple, Its an new instance,npc,there's box at its html and you write the name of char that you wish to vote for jail. GM/Offline characters can not be voted by none. At 50 votes,character get jail for 10min. Here it is: Made by www.i-code.us Dp part: ### Eclipse Workspace Patch 1.0 #P vfs_dp Index: datapack_development/sql/characters.sql =================================================================== --- datapack_development/sql/characters.sql (revision 6) +++ datapack_development/sql/characters.sql (working copy) @@ -79,6 +79,8 @@ clan_join_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0, clan_create_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0, death_penalty_level int(2) NOT NULL DEFAULT 0, + jailplayer varchar(35) default NULL, + jailvotes decimal(11,0) default NULL, PRIMARY KEY (obj_Id), KEY `clanid` (`clanid`) ) ; Index: datapack_development/data/html/jailmanager/65535.htm =================================================================== --- datapack_development/data/html/jailmanager/65535.htm (revision 0) +++ datapack_development/data/html/jailmanager/65535.htm (revision 0) @@ -0,0 +1,11 @@ +<html> +<title>Jail Manager Instance +</title> +<head> +<tittle> +<center> +<br> +CharName:<edit var="pname" width=50 height=20> +<center><button value="Vote" action="bypass -h npc_%objectId%_voteJail $pname" width=204 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></center> +</body> +</html> \ No newline at end of file Core part: ### Eclipse Workspace Patch 1.0 #P vfs Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 6) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -89,7 +89,6 @@ import net.sf.l2j.gameserver.model.L2Character; import net.sf.l2j.gameserver.model.L2Clan; import net.sf.l2j.gameserver.model.L2ClanMember; -import net.sf.l2j.gameserver.model.L2DropData; import net.sf.l2j.gameserver.model.L2Effect; import net.sf.l2j.gameserver.model.L2Fishing; import net.sf.l2j.gameserver.model.L2HennaInstance; @@ -205,6 +204,30 @@ */ public final class L2PcInstance extends L2PlayableInstance { + // Jail system. + private String jailplayer = null; + private int jailvotes = 0; + + public String getJailPlayer() + { + return jailplayer; + } + + public void setJailPlayer(String jailplayer) + { + this.jailplayer = jailplayer; + } + + public int getJailVotes() + { + return jailvotes; + } + + public void setJailVotes(int jailvotes) + { + this.jailvotes = jailvotes; + } + private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? AND class_index=?"; private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,skill_name,class_index) VALUES (?,?,?,?,?)"; private static final String UPDATE_CHARACTER_SKILL_LEVEL = "UPDATE character_skills SET skill_level=? WHERE skill_id=? AND char_obj_id=? AND class_index=?"; @@ -215,8 +238,8 @@ private static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay FROM character_skills_save WHERE char_obj_id=? AND class_index=? AND restore_type=? ORDER BY buff_index ASC"; 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=?,jailplayer=?,jailvotes=? 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,jailplayer,jailvotes 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 (?,?,?,?,?,?)"; private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=? WHERE char_obj_id=? AND class_index =?"; @@ -5597,6 +5620,9 @@ player.setOnlineTime(rset.getLong("onlinetime")); player.setNewbie(rset.getInt("newbie")==1); player.setNoble(rset.getInt("nobless")==1); + + player.setJailPlayer(rset.getString("jailplayer")); + player.setJailVotes(rset.getInt("jailvotes")); player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time")); if (player.getClanJoinExpiryTime() < System.currentTimeMillis()) @@ -6061,7 +6087,9 @@ statement.setLong(54, getClanCreateExpiryTime()); statement.setString(55, getName()); statement.setLong(56, getDeathPenaltyBuffLevel()); - statement.setInt(57, getObjectId()); + statement.setString(57, getJailPlayer()); + statement.setInt(58, getJailVotes()); + statement.setInt(59, getObjectId()); statement.execute(); statement.close(); Index: java/net/sf/l2j/gameserver/model/actor/instance/L2JailNpcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2JailNpcInstance.java (revision 0) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2JailNpcInstance.java (revision 0) @@ -0,0 +1,147 @@ +/* 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.model.actor.instance; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.StringTokenizer; + + + +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.Announcements; +import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.templates.L2NpcTemplate; +/** + * + * @author www.i-code.us + */ +public class L2JailNpcInstance extends L2NpcInstance +{ + + public L2JailNpcInstance(int objectId, L2NpcTemplate template) + { + super(objectId, template); + } + + @Override + public void onBypassFeedback(L2PcInstance player, String command) + { + if (command.startsWith("voteJail")) + { + String val = command.substring(8); + StringTokenizer st = new StringTokenizer(val); + + if (st.countTokens() > 1 || st.countTokens() < 1) + { + return; + } + + if (player.getJailPlayer() != null) + { + player.sendMessage("You have already voted for a player, "+player.getJailPlayer()+"."); + return; + } + + L2PcInstance target = L2World.getInstance().getPlayer(st.nextToken()); + + if (target == null) + { + player.sendMessage("The player you requested to vote for does not exist or is not online."); + return; + } + if (target.isInJail()) + { + player.sendMessage("The player you requested to vote for is already in jail."); + return; + } + + if (target.getAccessLevel() > 99) + { + player.sendMessage("The player you requested to vote is GM/ADMIN you cant vote for them"); + return; + } + + if (target.getPvpFlag() > 0) + { + player.sendMessage("The player you requested to vote is Pvping now,try later"); + return; + } + + + target.setJailVotes(target.getJailVotes()+1); + player.sendMessage("You have successfully voted for "+target.getName()+"."); + target.sendMessage(player.getName()+" has voted for you to go in jail."); + if (target.getJailVotes() == 50) + { + target.setInJail(true, 10); + Announcements.getInstance().announceToAll(target.getName()+" has been jailed for 10 minutes, after reaching 50 jail votes."); + target.setJailVotes(0); + cleanDatabase(target.getName()); + target.sendMessage("You have been jailed for 10 minutes because you reached 50 jail votes."); + } + } + } + + private void cleanDatabase(String pname) + { + Connection con = null; + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement st = con.prepareStatement("UPDATE characters SET jailplayer=null WHERE jailplayer="+pname); + st.execute(); + st.close(); + } + catch (SQLException sqle) + { + for (L2PcInstance gm : L2World.getInstance().getAllGMs()) + { + gm.sendMessage("There was a problem while updating database on jailplayer column. Please check it..."); + } + } + 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/jailmanager/" + pom + ".htm"; + } +} \ No newline at end of file You can also find it here
-
ds, do you really believe that even if the votes will go like YES-NO 50-0 something will happen? nope.
-
we should be afraid now.
-
WTS [WTS] www.i-code.us - L2J Services
Fanky replied to Fanky's topic in Marketplace [L2Packs & Files]
bump -
I know him better than you. You can keep his identity secret by the rest of members,not by me.
-
yea,sure.Liar. yes he is
-
WTS [WTS] www.i-code.us - L2J Services
Fanky replied to Fanky's topic in Marketplace [L2Packs & Files]
bamp -
WTS [WTS] www.i-code.us - L2J Services
Fanky replied to Fanky's topic in Marketplace [L2Packs & Files]
? -
WTS [WTS] www.i-code.us - L2J Services
Fanky replied to Fanky's topic in Marketplace [L2Packs & Files]
yes I'am ready to get your requests,ideas. I'am already starting doing a small event,which is really attractive,when i finish it i will write down the description. -
WTS [WTS] www.i-code.us - L2J Services
Fanky replied to Fanky's topic in Marketplace [L2Packs & Files]
:( ty -
A brand new coding site,made by us for you. You can buy any code you want related to l2j. You can make suggestions for unique codes here , and requests here. i-Code working on every l2jpackage Interlude/Gracia/Epilogue/Freya features/codes/engines. We accept small and large project aswell. The price(s): from 5 up to 35-40 euro. Payment method: Paypal,Psc. Also we offer psd to html coding(HTML Only). If you are intresed in buy something,you can either pm me here with your request/payment method/deadline or make a topic here, or simply add us at msn lovedeadlyrain@dream.com or stalker_wootoofoo@hotmail.com.
-
? Nvm,let's end this war here. Fb if you did it,good job. =)
-
sold
-
XAAXXAXAXAAX FAGGOT. when admin do something it wont have any announce,idiots.
-
Bullshits, the server is cool. Also,the farm is quite easy,stop telling shits for corrupt etc.Try to enchant armor/jew/weap with bless.Dont be fvcking lazy and criticize everything around. Btw,server is start growing. Accepted on hopzones aswell,plus try to make a WL and farm.You'll get +++ your gear too fast.
-
paypal 15 euro for all psc 20 euro for all
-
I didnt found it there tho, www.digital-master.gr
-
I can find you xpreria x10 297 euro. But there's no antikatabolh, only credit card/bank/paypal :/