Jump to content

Question

Recommended Posts

  • 0
Posted
Use character_variables Sql table:

INSERT INTO character_variables VALUES (playerObjectId, "CustomTitle", titleValue);

  • 0
Posted

I ment, that's the table where Title Colors can be stored.

 

You can do it in this way:

1. While color is changed, run method(done by you) storeTitleColor(player, newTitle); - player variable should be instance of L2PcInstance class(or however you have it called), newTitle should be String containing new Title(for example "FFFFFF")

2. Create private static void method named storeTitleColor and taking 2 arguments(L2PcInstance and String)

3. Create new Database Connection in the method(look for examples of similar usage in your pack, you can search by key words: "INSERT INTO")

4. Create query, that will insert into character_variables. Also think about the case when title is already stored, then you can delete current record(slower way) or add awesome word to query ON DUPLICATE KEY(look in google to know more, also to use it, you should set charId column and var column as Primary Keys.

5. To complete the query, just add statement.executeUpdate(); like in examples you have found.

 

HF

  • 0
Posted (edited)

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

Edited by xdem
  • 0
Guest Elfocrash
Posted

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

you obviously need preparedstatement for something like that

  • 0
Posted (edited)

you obviously need preparedstatement for something like that

 

works with statement too, but for this prepared is faster so yes

 

PreparedStatement extends Statement

Edited by xdem
  • 0
Guest Elfocrash
Posted

works with statement too, but for this prepared is faster so yes

 

PreparedStatement extends Statement

Statement cannot support the ?

  • 0
Posted (edited)

Statement cannot support the ?

 

where is the ?

 

both x u have the values from L2PcInstance, st.executeUpdate("UPDATE characters SET title_color = "+player.getAppearance().getTitlteColor()+" WHERE charId = "+player.getObjectId());

 

i was just bored to write the getters into the String

Edited by xdem
  • 0
Guest Elfocrash
Posted

where is the ?

 

both x u have the values from L2PcInstance, st.executeUpdate("UPDATE characters SET title_color = "+player.getAppearance().getTitlteColor()+" WHERE charId = "+player.getObjectId());

 

i was just bored to write the getters into the String

oh i though that you meant that you gonna have ? indicators and 

statement.setString(1, shit);

under the preparedstatement

 

Yeah it can be done as you wrote too, however it is way too unefficient

  • 0
Posted
 

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

you obviously need different query for something like that

  • 0
Posted

it works like a charm dude

1. It will change something, only if its previously inserted to character_variables table

2. "title_color" column name is wrong("val" is correct)

3. It will update all values of the character in that table, not only those regarding title.

  • 0
Posted

1. It will change something, only if its previously inserted to character_variables table

2. "title_color" column name is wrong("val" is correct)

3. It will update all values of the character in that table, not only those regarding title.

 

1. no

2. no

3. Nope

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Продам комплекты (Custom Colour) Apella Сеты. Контакт со мной/Contact with me  Telegram. Custom Colour Apella Light YouTube Video
    • haha, I don't say it, chatgpt says it. discuss it with him if you have problems 😉 or sue chatgpt for lying, for example when he tells you that you are an idiot and tells you that I do things that are light years ahead of you.
    • hey i make enough to live comfortably you, on the other hand... doubt that'd be the case if you were as competent as you claim to be
    • all your doubts ask chatgpt, also ask what you could do yourself hahaha
    • This post originally appeared on MmoGah. Odin: Valhalla Rising is an ambitious open-world MMORPG developed with Unreal Engine 4, offering breathtaking visuals and immersive gameplay. I will share everything you need to know before starting it.     Re-rolling In Odin, re-rolling isn't a practical strategy. Unlike most gacha games, where it's common to reset for better initial pulls, Odin focuses heavily on long-term growth. The earlier you begin playing and developing your character, the more advantages you'll gain over time. Instead of spending your efforts on re-rolling for ideal equipment, it's better to dive in and start progressing right away.   Server Selection Before starting your character, selecting a server is a crucial step. Since Odin doesn't support cross-server gameplay, coordinating with your friends, family, or guildmates is essential to ensure everyone creates their characters on the same server. Take the time to plan with your group beforehand. After deciding on a server, your next major choice will be picking a class.   Class Breakdown Odin features four primary starting classes: Warrior, Sorceress, Rogue, and Priest. Each class comes with its own distinct playstyle and unique strengths, so choose wisely, as your selection is permanent. However, even free-to-play players can create up to three characters on one server, giving you the flexibility to try different options and find the one that matches your preferences.   Quest and Leveling Once your character is created, your initial objective is to work through the main questline. This acts as both a tutorial and a method for early leveling. Odin simplifies the process with a convenient quest button that handles navigation, starts dialogues, and even enables auto-combat. This user-friendly feature allows beginners to grasp the basics of the game without feeling overloaded.   Auto Combat and No Kill-steal Mode Auto combat is an essential feature in Odin, enabling your character to battle monsters autonomously. This system allows you to effortlessly gain experience and loot, even while you're busy studying, cooking, or unwinding. To optimize its use, activate the no-kill-steal mode. This setting prevents your character from targeting monsters already engaged by other players, helping you avoid conflicts or potential PvP situations. However, if a quest becomes difficult to complete due to overcrowded areas, you can temporarily disable this mode to overcome the obstacle and move forward.   Item Management and Potions Don't overlook the importance of consumable items, especially health potions. These can be purchased, along with buffs, from general merchants in villages, and they play a crucial role in improving your combat efficiency and ensuring your survival. Always aim to keep a full stock of HP potions and carry buffs that boost attack, defense, or regeneration in batches of 5-10 for convenience.   Once you've acquired your consumables, assign them to your quick slots located at the bottom center of the screen. Swiping down activates these slots, and items like potions will automatically be used when necessary, so you don't need to worry about them mid-battle. Keep a close eye on your potion reserves, as running out during a tough fight could leave you vulnerable before reaching a safe area. In the early stages of the game, it's better to return to town for a restock if supplies are low rather than risking unnecessary defeats. You can also enable notifications to alert you when your health or potion count drops too low—a handy feature for staying prepared if your attention is elsewhere.   Leveling and AFK Farming Once you've mastered the fundamentals, the next step is to focus on leveling up and enhancing your character. Gaining levels is your primary source of progression early on, as it not only improves your stats but also unlocks crucial game features and new abilities. At this stage, simply sticking to the main questline provides a reliable and efficient way to gain experience.   Additionally, Odin includes a highly convenient idle feature called AFK mode. This allows your character to keep farming for resources and experience even when the game is closed, with a maximum duration of 8 hours per day. It's an excellent option for making progress while you're asleep, commuting, or otherwise occupied.   Gear Upgrades When the time comes to improve your gear, the initial focus should be on upgrading from normal-grade equipment to high-grade items. These provide significantly better stats and can be enhanced further to increase their effectiveness. Enhancing requires enhancement stones and gold, but it's important to stay within the safe enhancement limit. Attempting upgrades beyond this limit carries the risk of destroying your gear if the enhancement fails. Stick to safe enhancements until you've gained more experience and accumulated spare equipment to mitigate potential losses.   Skill Purchases When you've accumulated enough gold, it's time to invest in skills. These are crucial for enhancing your combat abilities and provide key benefits tailored to your class, whether it's increasing damage output, improving healing capabilities, or adding valuable utility. Before purchasing, ensure your character meets the level prerequisites for each skill. Your ultimate goal will be progressing through and completing the main questline in Midgard as you continue to develop your character.   Unlocking Jotenheim Finishing this milestone grants you access to the next region, Jetunheim, unlocking a variety of new content and challenges. This marks your first significant achievement in the game and is an essential early objective to strive for as you progress.   Joining a Guild Joining a guild is a highly beneficial step in Odin. Guilds not only provide opportunities for social interaction and group activities but also offer passive bonuses that can significantly enhance your gameplay. Even if you're not particularly active socially, being part of any guild is advantageous. The guild feature becomes accessible after completing Chapter 4, Quest 19 of the main story.   Guilds provide various perks, including buffs that scale with the guild's level. Additionally, you can earn guild coins by contributing through donations, quest completions, or regular logins. These coins can be exchanged for valuable rewards, such as epic-grade armor. The more you actively contribute to your guild, the greater the overall benefits for both you and the guild itself. Joining early and staying involved will undoubtedly strengthen your progression in the game.   Conclusion Here is the end of this beginners' guide. I hope these tips will help you level fast in Odin.
  • Topics

×
×
  • Create New...