Lopaskurwa
Active Member
- Joined
- Oct 6, 2017
- Messages
- 873
- Solutions
- 2
- Reaction score
- 49
TFS 1.2
I found this code in otland and im trying to do some changes but all i get is crach when i do something.
It uses these ones. Which one of them is green? Or it would be good to know which color they contain
Tried using these \/ but it crashed my server
The original code
I would love to change three thinks
I found this code in otland and im trying to do some changes but all i get is crach when i do something.
It uses these ones. Which one of them is green? Or it would be good to know which color they contain
C++:
enum SpeakClasses : uint8_t {
TALKTYPE_SAY = 1,
TALKTYPE_WHISPER = 2,
TALKTYPE_YELL = 3,
TALKTYPE_PRIVATE_PN = 4,
TALKTYPE_PRIVATE_NP = 5,
TALKTYPE_PRIVATE = 6,
TALKTYPE_CHANNEL_Y = 7,
TALKTYPE_CHANNEL_W = 8,
TALKTYPE_RVR_CHANNEL = 9,
TALKTYPE_RVR_ANSWER = 10,
TALKTYPE_RVR_CONTINUE = 11,
TALKTYPE_BROADCAST = 12,
TALKTYPE_CHANNEL_R1 = 13, //red - #c text
TALKTYPE_PRIVATE_RED = 14, //@name@text
TALKTYPE_CHANNEL_O = 15, //@name@text
TALKTYPE_CHANNEL_R2 = 17, //#d
TALKTYPE_MONSTER_SAY = 19,
TALKTYPE_MONSTER_YELL = 20,
};
C++:
enum MessageClasses : uint8_t {
MESSAGE_STATUS_CONSOLE_RED = 18, /*Red message in the console*/
MESSAGE_EVENT_ORANGE = 19, /*Orange message in the console*/
MESSAGE_STATUS_CONSOLE_ORANGE = 20, /*Orange message in the console*/
MESSAGE_STATUS_WARNING = 21, /*Red message in game window and in the console*/
MESSAGE_EVENT_ADVANCE = 22, /*White message in game window and in the console*/
MESSAGE_EVENT_DEFAULT = 23, /*White message at the bottom of the game window and in the console*/
MESSAGE_STATUS_DEFAULT = 24, /*White message at the bottom of the game window and in the console*/
MESSAGE_INFO_DESCR = 25, /*Green message in game window and in the console*/
MESSAGE_STATUS_SMALL = 26, /*White message at the bottom of the game window"*/
MESSAGE_STATUS_CONSOLE_BLUE = 27, /*FIXME Blue message in the console*/
};
The original code
Lua:
local config = {
[SKILL_LEVEL] = { "Level Up!", CONST_ME_CAKE },
[SKILL_CLUB] = { "Club Up!", CONST_ME_FIREWORK_BLUE },
[SKILL_AXE] = { "Axe Up!", CONST_ME_FIREWORK_RED },
[SKILL_SWORD] = { "Sword Up!", CONST_ME_FIREWORK_YELLOW },
[SKILL_DISTANCE] = { "Distance Up!", CONST_ME_ASSASSIN },
[SKILL_SHIELD] = { "Shield Up!", CONST_ME_BLOCKHIT },
[SKILL_FISHING] = { "Fishing Up!", CONST_ME_WATERSPLASH },
[SKILL_FIST] = { "Fist Up!", CONST_ME_HITAREA },
[SKILL_MAGLEVEL] = { "Magic Level Up!", CONST_ME_HEARTS }
}
local imageEffect = {
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}
function onAdvance(player, skill, oldLevel, newLevel)
if oldLevel < newLevel then
local info = config[skill]
if info then
player:say(info[1], TALKTYPE_MONSTER_SAY)
local diff = math.ceil(#imageEffect[1] / 2)
local position = player:getPosition() + Position(-diff, -diff, 0)
for k, v in pairs(imageEffect) do
for l, b in pairs(v) do
if b ~= 0 then
(position + Position(l, k, 0)):sendMagicEffect(info[2])
end
end
end
end
end
return true
end
I would love to change three thinks
- Change player:say to green and it would be best if table would look like this
Lua:
[SKILL_LEVEL] = { "Level Up!", CONST_ME_CAKE, TALKTYPE_MONSTER_SAY },
- The text onAdvance could be animated if its possible like you advance and TEXT goes like up a little bit and disappears example CLICK HERE to make it more clear
- And if possible not needed if you gain like 20 levels at once it spams it 20 times so it could send just one time not 20