Skip to content

Conversation

@kokekanon
Copy link
Owner

@kokekanon kokekanon commented Oct 11, 2025

Description

Feature Done
1.- Creature AE + Shader
2.- send disableFeature / enableFeature . easy to modify in config.lua
3.- outfit (wings,aura,shader)
4.- TypingIcon
5.- map shader support
6- item Shader

1.-Creature AE + Shader

img
Haskanoid Video

2.-send disableFeature / enableFeature . easy to modify in config.lua

it is easier for the server administrator to modify config.lua than to compile every time he wants to add or remove a feature.

image

3.- outfit (wings,aura,shader)

image

4.- TypingIcon

Haskanoid Video

5.- map shader support

Peoplemon by Alex Stuart

6.- item Shader

Peoplemon by Alex Stuart

How Has This Been Tested

1/6 Creature : AttachedEffect | Shader

Client:
--   g_game.enableFeature(GameCreatureAttachedEffect)
--   g_game.enableFeature(GameCreatureShader)
Server:
	player:setShader("Outfit - Rainbow")
	player:attachEffectById(7)
	player:attachEffectById(8)

2/6 Player: Map Shader

	player:setMapShader("Map - Party")

4/6 feature: Item Shader

--Client:
	g_game.enableFeature(GameItemShader)
-- Server:
	player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK):setShader("Map - Party")

5/6 send disableFeature / enableFeature. easy to modify in config.lua

const auto &enabledFeatures = g_configManager().getEnabledOTCFeatures();
const auto &disabledFeatures = g_configManager().getDisabledOTCFeatures();

for (auto feature : enabledFeatures) {
g_logger().info("Feature enabled: {}", feature);
}

for (auto feature : disabledFeatures) {
g_logger().info("Feature disabled: {}", feature);
}

6/6

image
image

x:addCustomOutfit("aura", 8)
x:removeCustomOutfit("aura", 8)
local talkAction = TalkAction("!testOTCR")

local options = {
	Creature = {
		{
			name = "set attach Effect 7",
			action = function(player)
				player:attachEffectById(7)
			end,
		},
		{
			name = "get all attach Effect",
			action = function(player)
				local effects = player:getAttachedEffects()
				if #effects > 0 then
					local effectsString = "your AE are: " .. table.concat(effects, ", ")
					player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, effectsString)
				else
					player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, "you do not have any AE.")
				end
			end,
		},
		{
			name = "detach Effect 7",
			action = function(player)
				player:detachEffectById(7)
			end,
		},
		{
			name = "set Shader player",
			action = function(player)
				player:setShader("Outfit - Rainbow")
			end,
		},
		{
			name = "no shader player",
			action = function(player)
				player:setShader("")
			end,
		},
		{
			name = "get Shader player",
			action = function(player)
				player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, player:getShader())
			end,
		},
	},
	Map = {
		{
			name = "set Shader Map",
			action = function(player)
				player:setMapShader("Map - Party")
			end,
		},
		{
			name = "no shader Map",
			action = function(player)
				player:setMapShader("")
			end,
		},
		{
			name = "get Shader Map",
			action = function(player)
				player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, player:getMapShader())
			end,
		},
	},
	Items = { {
		name = "Shader",
		action = function(player)
			local item = player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
			item:setShader("Map - Party")
			player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, "item have shader : " .. item:getShader())
		end,
	} },
	game_outfit = {
		{
			name = "Add permanent aura 8",
			action = function(player)
				player:addCustomOutfit("aura", 8)
				player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, "add aura 8")
			end,
		},
		{
			name = "remove permanent aura 8",
			action = function(player)
				player:removeCustomOutfit("aura", 8)
				player:sendTextMessage(MESSAGE_GAMEMASTER_CONSOLE, "remove aura 8")
			end,
		},
	},
}

function talkAction.onSay(player, words, param, type)
	local modalWindow = ModalWindow({
		title = "Fast Test",
		message = "Choose one of the following options:",
	})

	for category, subOptions in pairs(options) do
		modalWindow:addChoice(category, function(player, button, choice)
			local subModalWindow = ModalWindow({
				title = "Select a Sub-Option",
				message = "Choose one of the following sub-options for " .. category .. ":",
			})

			for _, subOption in ipairs(subOptions) do
				subModalWindow:addChoice(subOption.name, function(plyr, btn, ch)
					if button.name == "OK" then
						subOption.action(plyr)
					end
				end)
			end

			subModalWindow:addButton("OK")
			subModalWindow:addButton("Cancel", function(plyr)
				subModalWindow:clear()
			end)
			subModalWindow:sendToPlayer(player)
		end)
	end

	modalWindow:addButton("OK")
	modalWindow:addButton("Cancel", function(player)
		modalWindow:clear()
	end)
	modalWindow:sendToPlayer(player)
	return false
end

talkAction:groupType("normal")
talkAction:separator(" ")
talkAction:register()

local playerLoginTestOTCR = CreatureEvent("simpletest")

function playerLoginTestOTCR.onLogin(player)
	if player:getClient().os >= 10 and player:getClient().os < 12 then
		player:say("say !testOTCR", TALKTYPE_SAY)
	end
	return true
end

playerLoginTestOTCR:register()

@kokekanon kokekanon merged commit 8b33a18 into master Oct 11, 2025
@kokekanon kokekanon deleted the kokekanonAe branch October 11, 2025 04:41
kokekanon added a commit that referenced this pull request Oct 11, 2025
Copy link
Owner Author

@kokekanon kokekanon Oct 11, 2025

Choose a reason for hiding this comment

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

missing:
L2859

void ProtocolGame::sendAccountManagerTextBox(uint32_t windowTextId, const std::string& text)
{
	NetworkMessage msg;
	msg.addByte(0x96);
	msg.add<uint32_t>(windowTextId);
-	msg.addItem(ITEM_LETTER, 1);
+	msg.addItem(ITEM_LETTER, 1,isOTCR);
	msg.add<uint16_t>(18);
	msg.addString(text);
	msg.add<uint16_t>(0x00);
	msg.add<uint16_t>(0x00);
	writeToOutputBuffer(msg);
}

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.

1 participant