Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Evolving Item Support for RoF2 #4496

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

neckkola
Copy link
Contributor

@neckkola neckkola commented Oct 5, 2024

Description

Provides evolving item support for the RoF2 Client. This is draft only at this time.

What it requires:
At the moment, a content table is required for the current design. A table 'items_evolving_details' is required with the following sql
image
This table contains the evolving criteria for each item as described here:

Header Header
type the type of evolving item. Is it based on xp, number of kills, kills in a zone, etc.
sub_type further refinement of type. If type is xp, defines the type of xp. If type is specific mob race, it defines the race type
required_amount the amount, perhaps 100,000 xp, or 1000 kills.

Details are in namespace EvolvingItems::Types and SubTypes.
Logic is in Client::ProcessEvolvingItem

Here is my test table with two items:
image

What it does:

  1. Allows for evolving item support for RoF2 only.
  2. Has a 30 sec timer after equipping an evolving item before it can start to evolve. Time is configurable with a Rule.
  3. XP gain is Rule configurable for raid, solo, and group xp.
  4. Enables the Evolving XP Transfer in Corathus Creep. This is limited at present as I have little information. It currently allows for xp transfer between items that have the same type, and subtype. I can and will update this as feedback comes in.
  5. PlayerEvent logging is enabled for various functions, namely progression of an item and xp transfer between items.
  6. Evolving item status remains with the item, and will transfer if an tradeable item is traded. This reminds me, I must check bazaar, buyer, banker, and guild banker to confirm the evolving aspect is updated correctly. TBC.
  7. I created an evolving_items_manager as a common utility. It may be better to move it into zone. Looking for feedback.
  8. All previous evolving code has been removed though I understand it was never fully implemented so that should be no problem.
  9. There are two gm commands to monitor statis. #evolve target and #evolve item

Outstanding:

  1. Move items_evolving_details in the content_db structure.
  2. Confirm the evolving item details to populate above table
  3. Add perl/lua functions. Suspect we need things like:
  • Get Type, SubType, and Required Amount.
  • Get Item current amount
  • Get Next Item ID and Final Item ID
  • Set Item current amount
  • and likely others
  1. Perhaps refactor the evolving_items_manager
  2. Add more XP Transfer conditions
  3. Perhaps a bit more logging and player event data.
  4. Check bazaar, buyer, banks for proper functioning.
  5. Likely other things. :)

Perl

  • Add $item->AddEvolveAmount(amount).
  • Add $item->GetAugmentEvolveUniqueID(slot_id).
  • Add $item->GetEvolveActivated().
  • Add $item->GetEvolveAmount().
  • Add $item->GetEvolveCharacterID().
  • Add $item->GetEvolveEquipped().
  • Add $item->GetEvolveFinalItemID().
  • Add $item->GetEvolveItemID().
  • Add $item->GetEvolveLevel().
  • Add $item->GetEvolveLoreID().
  • Add $item->GetEvolveProgression().
  • Add $item->GetEvolveUniqueID().
  • Add $item->IsEvolving().
  • Add $item->SetEvolveAmount(amount).
  • Add $item->SetEvolveProgression(amount).

Perl Example

sub EVENT_SAY {
	my $slot_id = quest::getinventoryslotid("back");;
	my $item = $client->GetItemAt($slot_id);

	if ($text=~/#a/i) {
		if ($item) {
			quest::message(315, "Perl | GetAugmentEvolveUniqueID [" . $item->GetAugmentEvolveUniqueID(0) . "]");
			quest::message(315, "Perl | GetEvolveActivated [" . $item->GetEvolveActivated() . "]");
			quest::message(315, "Perl | GetEvolveAmount [" . $item->GetEvolveAmount() . "]");
			quest::message(315, "Perl | GetEvolveCharacterID [" . $item->GetEvolveCharacterID() . "]");
			quest::message(315, "Perl | GetEvolveEquipped [" . $item->GetEvolveEquipped() . "]");
			quest::message(315, "Perl | GetEvolveFinalItemID [" . $item->GetEvolveFinalItemID() . "]");
			quest::message(315, "Perl | GetEvolveItemID [" . $item->GetEvolveItemID() . "]");
			quest::message(315, "Perl | GetEvolveLevel [" . $item->GetEvolveLevel() . "]");
			quest::message(315, "Perl | GetEvolveLoreID [" . $item->GetEvolveLoreID() . "]");
			quest::message(315, "Perl | GetEvolveProgression [" . $item->GetEvolveProgression() . "]");
			quest::message(315, "Perl | GetEvolveUniqueID [" . $item->GetEvolveUniqueID() . "]");
			quest::message(315, "Perl | IsEvolving [" . $item->IsEvolving() . "]");
		}
	}
}

Lua

  • Add item:AddEvolveAmount(amount).
  • Add item:GetAugmentEvolveUniqueID(slot_id).
  • Add item:GetEvolveActivated().
  • Add item:GetEvolveAmount().
  • Add item:GetEvolveCharacterID().
  • Add item:GetEvolveEquipped().
  • Add item:GetEvolveFinalItemID().
  • Add item:GetEvolveItemID().
  • Add item:GetEvolveLevel().
  • Add item:GetEvolveLoreID().
  • Add item:GetEvolveProgression().
  • Add item:GetEvolveUniqueID().
  • Add item:IsEvolving().
  • Add item:SetEvolveAmount(amount).
  • Add item:SetEvolveProgression(amount).

Lua Example

function event_say(e)
	local slot_id = Slot.Back;
	local item = e.self:GetInventory():GetItem(slot_id);

	if e.message:findi("#a") then
		if (item) then
			eq.message(315, "Lua | GetAugmentEvolveUniqueID [" .. tostring(item:GetAugmentEvolveUniqueID(0)) .. "]");
			eq.message(315, "Lua | GetEvolveActivated [" .. tostring(item:GetEvolveActivated()) .. "]");
			eq.message(315, "Lua | GetEvolveAmount [" .. tostring(item:GetEvolveAmount()) .. "]");
			eq.message(315, "Lua | GetEvolveCharacterID [" .. tostring(item:GetEvolveCharacterID()) .. "]");
			eq.message(315, "Lua | GetEvolveEquipped [" .. tostring(item:GetEvolveEquipped()) .. "]");
			eq.message(315, "Lua | GetEvolveFinalItemID [" .. tostring(item:GetEvolveFinalItemID()) .. "]");
			eq.message(315, "Lua | GetEvolveItemID [" .. tostring(item:GetEvolveItemID()) .. "]");
			eq.message(315, "Lua | GetEvolveLevel [" .. tostring(item:GetEvolveLevel()) .. "]");
			eq.message(315, "Lua | GetEvolveLoreID [" .. tostring(item:GetEvolveLoreID()) .. "]");
			eq.message(315, "Lua | GetEvolveProgression [" .. tostring(item:GetEvolveProgression()) .. "]");
			eq.message(315, "Lua | GetEvolveUniqueID [" .. tostring(item:GetEvolveUniqueID()) .. "]");
			eq.message(315, "Lua | IsEvolving [" .. tostring(item:IsEvolving()) .. "]");
		end
	end
end

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

I have tested with RoF2 in various forms. Would appreciate others' testing results.

Clients tested:
RoF2

Checklist

  • I have tested my changes - Preliminary. Requires more before merging.
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I have (will) made corresponding changes to the documentation (if applicable, if not delete this line)
  • I own the changes of my code and take responsibility for the potential issues that occur
  • If my changes make database schema changes, I have tested the changes on a local database (attach image). Updated version.h CURRENT_BINARY_DATABASE_VERSION to the new version. (Delete this if not applicable)

@Valorith
Copy link
Contributor

Valorith commented Oct 6, 2024

Can't wait to try this out :D

@fryguy503
Copy link
Contributor

So Excited, Neckkola dropping the big features!

common/shareddb.cpp Outdated Show resolved Hide resolved
common/evolving.h Outdated Show resolved Hide resolved
common/evolving.h Outdated Show resolved Hide resolved
@@ -212,6 +214,7 @@ namespace DatabaseSchema {
"ground_spawns",
"horses",
"items",
"items_evolving_details",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the sql for this table missing from the update manifest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is missing at the moment as it will likely be a content table, and will be loaded that way.


void EvolvingItemsManager::LoadEvolvingItems() const
{
auto const &results = ItemsEvolvingDetailsRepository::All(*m_db);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to use the m_content_db?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. I made the assumption that it would move to a content table and be static based on in era items. If that is the decision taken, and we get a content table made and populated, I will update and re-test accordingly. For my testing I used a local table.

@MortimerGreenwald
Copy link
Contributor

Hi. Can't wait to try this. Will evolved items work on bots? Or is it limited to clients only?

@neckkola neckkola force-pushed the Feature_EvolveItems branch from f569ba3 to 82b1b36 Compare October 14, 2024 13:57
@neckkola
Copy link
Contributor Author

Updated based on review comments. Going to run through some tests

@Akkadius
Copy link
Member

Updated based on review comments. Going to run through some tests

How'd testing go. Are you ready for merge?

@MortimerGreenwald
Copy link
Contributor

Updated based on review comments. Going to run through some tests

Were you able to test this on bots? Curious if they'll evolve while equipped. ty!

zone/evolving.cpp Outdated Show resolved Hide resolved
@neckkola neckkola force-pushed the Feature_EvolveItems branch from 82b1b36 to ffc964b Compare December 14, 2024 18:24
@neckkola
Copy link
Contributor Author

Good afternoon

Update the items_evolving_details table to the content_db, and provided a sql in utils to populate. It only has two items with evolving details though all items flagged as evolving are present. As more detail is known, it can be easily updated and activated.

Some cleanup as well.

I need to create the documentation next. I believe that the other comments are complete.

@neckkola
Copy link
Contributor Author

Documentation has been updated.

https://docs.eqemu.io/server/items/evolving/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants