Jump to content
  • 0

MySql and Character Create


Question

Posted

Hello im getting error for line 140 on character create (newChar.setCurrentHp(template.baseHpMax + 400);)

after adding a custom faction system

 

CharacterCreate.java: https://pastebin.com/nBF57eMB

Changes in L2PcInstance

// Character Character SQL String Definitions:
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date,factionid, returnx, returny, returnz) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_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=?,bookmarkslot=?,streak=?,lastKill1=?,lastKill2=?,vitality_points=?,heroWpnDel=?,cancraft=?, factionid=?,returnx=?, returny=?, returnz =? FROM characters WHERE charId=?";
private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_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,bookmarkslot,streak,lastKill1,lastKill2,vitality_points,heroWpnDel,factionid, returnx, returny, returnz FROM characters WHERE charId=?";
// Faction System
private int factionId;
public int getFactionId() { return factionId; }
public void setFactionId(int newFaction) { factionId = newFaction; }

			player.setVitalityPoints(rset.getInt("vitality_points"), true);
			player._heroWpnDelCount = rset.getByte("heroWpnDel");

			+player.setFactionId(rset.getInt("factionid"));
			+player.setReturnX(rset.getInt("returnx"));
			+player.setReturnY(rset.getInt("returny"));
			+player.setReturnZ(rset.getInt("returnz"));
	statement.setInt(57, getObjectId());
		+statement.setInt(58, getFactionId());
		+statement.setInt(59, getReturnX());
		+statement.setInt(60, getReturnY());
		+statement.setInt(61, getReturnZ());

And i cant create the character, if possible ot help me, thx in advance!

Recommended Posts

  • 0
Posted
  On 11/20/2017 at 5:13 PM, IpotoniC said:

statement.setInt(55, blabla)

statement.setInt(56, blabla)

statement.setInt(57, blabla)

statement.setInt(58, getObjectId()) // at the end always cause the sql statement is WHERE obj_id=?";

Expand  

at update right?

  • 0
Posted

Check these 2 connections in l2pcinstance

you are missing in one of the both the values for your faction

RESTORE_CHARACTER

UPDATE_CHARACTER
 

  • 0
Posted
  On 11/20/2017 at 5:13 PM, IpotoniC said:

statement.setInt(55, blabla)

statement.setInt(56, blabla)

statement.setInt(57, blabla)

statement.setInt(58, getObjectId()) // at the end always cause the sql statement is WHERE obj_id=?";

Expand  

again the same error

  • 0
Posted
  On 11/20/2017 at 5:22 PM, Reborn12 said:

Check these 2 connections in l2pcinstance

you are missing in one of the both the values for your faction

RESTORE_CHARACTER

UPDATE_CHARACTER
 

Expand  

ive added in storeCharBase, createDb and restore, i cant find Update inside l2pcinstance

  • 0
Posted

FROM characters WHERE charId=0 ??? its supposed to be charId=?

 

example: private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE obj_id=?";

  • 0
Posted
  On 11/20/2017 at 5:32 PM, IpotoniC said:

FROM characters WHERE charId=0 ??? its supposed to be charId=?

 

example: private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE obj_id=?";

Expand  

havent edited that

Guest
This topic is now closed to further replies.


  • Posts

    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • Hey. I've been looking all over the internet about this but not being able to find anything about it. I have edited systemmsg using MSG editor changing colors etc. But now I want to change and add some of the sounds as well. But I need the sound IDs for each audiofile and I dont know how to find them. Ive found all the audio files but I cant use the filename as someone said in a thread here, it only seem to take numbers. I have looked into every guide about systemmsg on this website and no one mention anything about the sound, just that its possible to add sound but nothing more. So, do anyone know how to find these sound IDs? Preferably together with the soundname of the audio file that it plays so I know which ID to use for each soundfile. Thanks in advance!
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...