[BUG] When Equip & mount then unmount
Similar Content
-
Activity
-
34
-
0
Game Source Code - where to call void methods to spawn mobs, move mobs and others - in game source side -?
Lets say I have the follow scenario: At server startup: I want to spawn two mobs, as an example function(correctness does not matter) void SpawnMobs(DWORD mob_vnum, int count, int map_index, int x, int y) { for (int i = 0; i < count; ++i) { LPCHARACTER mob = CHARACTER_MANAGER::instance().SpawnMob(mob_vnum, map_index, x, y, 0, false, -1); if (!mob) sys_err("Failed to spawn mob VNUM %d on map %d at (%d, %d)", mob_vnum, map_index, x, y); } } And at a given date-time, to make the mobs move to a specific location(Again function correctness is probably wrong, but this is just a POCE) void MoveMobTo(DWORD mob_vid, int target_x, int target_y) { using namespace std::chrono; //April 18, 2024, at 18:00 std::tm scheduled_time = {}; scheduled_time.tm_year = 2024 scheduled_time.tm_mon = 4 - 1; scheduled_time.tm_mday = 18; scheduled_time.tm_hour = 18; scheduled_time.tm_min = 0; scheduled_time.tm_sec = 0; auto scheduled_time_t = std::mktime(&scheduled_time); system_clock::time_point scheduled_tp = system_clock::from_time_t(scheduled_time_t); // Get current time system_clock::time_point now = system_clock::now(); // Check if the current time matches the scheduled time if (now == scheduled_tp) { LPCHARACTER mob = CHARACTER_MANAGER::instance().Find(mob_vid); if (mob) { mob->Goto(target_x, target_y); sys_log(0, "Mob with VID %d moved to (%d, %d) as scheduled", mob_vid, target_x, target_y); } else { sys_err("Failed to find mob with VID %d to move", mob_vid); } } else { sys_log(0, "MoveMobTo called, but it is not the scheduled time yet."); } } I have two main questions 1. !Where should i be calling these functions within the source game, in main seems like it might not be a good idea 2. Checking time constantly until desired time is true, seems quite tricky, a while true surely is not good, if u have any basic suggestions it would be more then welcomed Basically my goal is to have mobs spawn, if not already spawned, move them at a specific hour to a exact spot on the map, make em fight each other, while fighting pc can't attack, after pc can attack the surviver, but not instantly, spawn another boss, keep it there for a specific time, if not dead, despawn it Realistically, if i'd know where to call my functions with the instructions and how to not use while loops to check for specific states, it would be enough Thank you in advance! -
1
-
-
10
VIVY-WORLD2 - FARM TO THE TOP
--- UPDATE V0.8 --- --- REMOVED ACCESSORIES, WEAPONS AND ARMOURS DROP FROM MOBS (YOU CAN DROP THEM FROM METIN STONES) --- - YOU WILL STILL DROP SOME UNTIL I CLEAN THE "COMMON DROP ITEM - --- ADDED A VERY LOW CHANCE TO DROP CHESTS FROM MOBS WHICH GIVE ITEMS DIRECTLY +9 --- --- PLEASE DOWNLOAD THE V0.8 CLIENT --- -
4
How To Use Notepad++ with Syntax Highlighting Metin2 Quests Lua
How to set folding in "when, state, if, elseif else" etc? with your code only "if" can be folded -
1
-
1
-
1
-
-
Recently Browsing
- No registered users viewing this page.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now