• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent [BOOSTED CREATURE] LETS IMPROVE THIS SYSTEM TFS 1x

underewar

Well-Known Member
Joined
Feb 9, 2013
Messages
60
Reaction score
71
Location
Brazil
GitHub
Underewarrr
Hello everyone! I'm working on a system for creatures and boosted bosses on my TFS 1x server. I'm not interested in integrating this system into the source code for obvious reasons, as it makes editing easier for other servers. I'm posting this to collaborate on enhancing the current system by implementing new concepts and refining existing ones.

Regarding the code:
GlobalEvents:I'm using Global Events to update the creature and boosted boss on server startup. To avoid the need for server restarts when changing the boss, I'm considering switching from onStartup to onThink and specifying a precise time for the event to occur. Simultaneously, I store the creature's index in a global storage to prevent database requests when looking for the boosted monster of the day.

CreatureScript:With the monster updated in the database and the global storage set with the current monster's index, I check in a CreatureScript which monster the player is defeating. Using dmgMap, I can identify one or more players contributing to the daily boosted monster's death. I make sure to record the event when a player logs in to avoid potential issues.

About the improvements:Instead of creating a function responsible for passing boostedCreature(type, monsterName), which would be ideal, I've created two functions - one for bosses and one for creatures. This is a significant improvement that can simplify the code considerably by adding this utility function.

Important improvements:The onKill function of the boosted creature system is functional and has no issues. However, some concepts are missing. Currently, all players contributing to the creature's death receive the total XP. There's a commented-out part in the code where the creature's XP sharing is applied, but it's not functional. This needs adjustment – feel free to share any insights here!

What's missing:In addition to XP, the monster should also provide extra loot (To do). I'm also working on adding the event for the boss creature kill (In Progress).

Other improvements:Feel free to suggest additional improvements for the system!

All Changes.
 
Back
Top