Jump to content

NumL0ck

Banned
  • Posts

    296
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by NumL0ck

  1. package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
        
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Calendar;
    
    import com.l2jfrozen.util.database.L2DatabaseFactory;
    import com.l2jfrozen.gameserver.model.entity.Announcements;
    import com.l2jfrozen.gameserver.templates.StatsSet;
    import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
    import com.l2jfrozen.gameserver.model.L2World;
    import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
    import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
    import com.l2jfrozen.gameserver.network.clientpackets.Say2;
    
    /**
    * Allow player to enable or disable Experience and SP Gain.
    */
    
               public class getstatus implements IVoicedCommandHandler
    
                    {
    
                  private static final String[] VOICED_COMMANDS =
    
                  {
                          "getstatus"
                  };
    
           
    
                  public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
    
                  {
                	  
                      if (command.equalsIgnoreCase("getstats"))
                      {
                    	  DayPvpandPk(activeChar);
                    	  activeChar.sendMessage("[Today PvPs: "+DayPvp()+"] [Today PKs: "+DayPk()+"");
                       }
        return true;
    }              
                  public void DayPvpandPk(L2PcInstance l2pcinstance)
                  {
                	  try
                	  {
                		  Connection connection = L2DatabaseFactory.getInstance().getConnection();
                		  PreparedStatement preparedstatement = connection.prepareStatement("SELECT todaypvps,char_name FROM characters WHERE accesslevel=? ORDER BY todaypvps DESC LIMIT 1");
                		  preparedstatement = connection.setInt(1, 0);
                		  ResultSet resultset = preparedstatement.executeQuery();
      					
      					if (rSet.next())
      					{
      						newPvpLord = rSet.getString("char_name");
      						topTodayPvps = rSet.getInt("todaypvps");
      					}
      					
      					rSet.close();
      					stm.close();
      					
    
                	  }
                	  catch(SQLException sqlexception)
                	  {
                	          
                	  }
                  }
                  protected StatsSet _StateSet;
                  public String[] getVoicedCommandList()
    
                  {
    
                          return VOICED_COMMANDS;
    
                  }
    
          }
    
    

    please help me to make it, this is Example, but i CAN'T create i'm to newbie...

  2. MAN, LISTEN!

    THEN I EDIT THIS

        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=?";
    

    i CAN'T create char, i don't know why!!! :((

  3. because in this http://maxcheaters.com/forum/index.php?topic=238056.msg2145283#msg2145283 - pvp lord engine show

    or not need this update and restore? i wanna pvp lord engine to operate without problems

    -    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=?,todaypvps=?,pvplord=? 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,todaypvps,pvplord FROM characters WHERE obj_id=?";
    

    vampir i wanna this code and your help with todays pvp,death,pk:)

  4. Hello MXC, i have code for faction server which change map every 45 mins.

    But i need to make this code to pvp server, but problem is occupation crystals and teleporter set to faction ids Faction ID 1 = Blue faction Faction ID 2 = Red faction.

    I need to make what you can teleport to crystal but you can't occupate crystal and can't see it and all players teleport to all crystals, who can help me, i send java code and I and good dev who help to me, have this super code:D

    Sorry for bad english!

    +			L2TpFlagInstance kristalas = (L2TpFlagInstance) object;
    +			if (plajer.getFactionId() == kristalas.getFlagFactionId())
    +				plajer.teleToLocation(kristalas.getX() + 50,kristalas.getY(),kristalas.getZ() + 50);

    +	public static FastSet<L2TpFlagInstance> _tpBlueFlags = new FastSet<L2TpFlagInstance>();
    +	public static FastSet<L2TpFlagInstance> _tpRedFlags = new FastSet<L2TpFlagInstance>();

    CREATE TABLE `faction_crystals` (
      `mapId` int(3) DEFAULT '0',
      `flagName` varchar(20) NOT NULL DEFAULT 'Test',
      `factionId` int(1) DEFAULT '0',
      `unoccupayable` int(1) DEFAULT '0',
      `x` int(7) NOT NULL DEFAULT '0',
      `y` int(7) DEFAULT '0',
      `z` int(7) DEFAULT '0',
      PRIMARY KEY (`x`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    -- ----------------------------
    -- Table structure for faction_maps
    -- ----------------------------
    CREATE TABLE `faction_maps` (
      `mapId` int(3) DEFAULT '0',
      `map_name` varchar(50) NOT NULL DEFAULT '',
      `current` int(1) DEFAULT '0',
      PRIMARY KEY (`map_name`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    ALTER TABLE `characters` ADD `factionId` INT(1) DEFAULT '0' NOT NULL;
    UPDATE `npc` SET type = 'L2Faction' WHERE id = '31214'
    UPDATE `npc` SET type = 'L2TpFlag' WHERE id = '31217'
    UPDATE `npc` SET type = 'L2FactTeleporter' WHERE id = '31218'
    
    -- ----------------------------
    -- Records 
    -- ----------------------------
    INSERT INTO `faction_crystals` VALUES ('2', 'Red Crystal', '1', '1', '-54438', '146565', '-2878');
    INSERT INTO `faction_crystals` VALUES ('2', 'Crystal 2', '0', '1', '-54257', '142692', '-2877');
    INSERT INTO `faction_crystals` VALUES ('2', 'Blue Crystal', '1', '1', '-51479', '138993', '-2937');
    INSERT INTO `faction_crystals` VALUES ('2', 'Crystal 1', '0', '1', '-50155', '142310', '-2893');
    INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 2', '0', '0', '140656', '-105488', '-3632');
    INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 1', '0', '0', '141632', '-109424', '-3591');
    INSERT INTO `faction_crystals` VALUES ('1', 'Blue Crystal', '1', '1', '143972', '-111932', '-3447');
    INSERT INTO `faction_crystals` VALUES ('1', 'Red Crystal', '2', '1', '144755', '-100687', '-3277');
    INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 3', '0', '0', '145232', '-104736', '-3681');
    INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery steps', '1', '1', '185352', '20300', '-3270');
    INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 2', '0', '0', '188409', '22493', '-3688');
    INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 1', '0', '0', '189616', '17336', '-3762');
    INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 3', '0', '0', '190408', '21396', '-3670');
    INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery doors', '2', '1', '194072', '22928', '-3614');
    INSERT INTO `faction_maps` VALUES ('2', 'Abandoned Camp', '0');
    INSERT INTO `faction_maps` VALUES ('0', 'Cemetery', '1');
    INSERT INTO `faction_maps` VALUES ('1', 'Hot Springs', '0');

  5. okey, so then i go to l2pcinstance and i change this

    private static final String UPDATE_CHARACTER

    and this

    private static final String RESTORE_CHARACTER

    i can't create charachter, why ? i'm using frozen, and all is good, but then i remove code, and use l2pcinstance before instalation it's allright and i can create char, but then i touch

    private static final String UPDATE_CHARACTER

    and this

    private static final String RESTORE_CHARACTER

    boom, i can't create char.

    please help me, and sorry for my bad english...

×
×
  • Create New...