Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/02/23 in Posts

  1. Could you help me to resolve my problem? I want to disable ankle snare skills for myself and other party/guild members, especially in PVP and GVG maps.
    1 point
  2. I hope you all enjoy this cute little map! You can see the video showcase here: You can preview the screenshot here: This map is free to be modified as you wish! sponge_bob.zip
    1 point
  3. file generator needed to implement custom item on the server, in addition to having a custom renaming system by AI. Shows how to add a custom item in a quick and practical way, without the need to insert it file by file sistema.mp4
    1 point
  4. I will still talk with vector as base, you can sort the damage with vector easy, you can look up function mob_add_spawn with it code sorting the qty of mob spawn in a map // sort spawns by spawn quantity std::sort(spawns.begin(), spawns.end(), [](const spawn_info & a, const spawn_info & b) -> bool { return a.qty > b.qty; }); quoted from here https://www.geeksforgeeks.org/vector-in-cpp-stl/ Vectors are the same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted so you don't need to pre defined number to set size on the container. for mvp its reset upon dead, so if mvp has rebirth skill, it will reset the logs value. later on will be removed in memory in status.cpp if(flag&4) // Delete from memory. (also invokes map removal code) unit_free(target,CLR_DEAD); else if(flag&2) // remove from map unit_remove_map(target,CLR_DEAD); so you can still get the data of damage log, before it was wiped out from memory, but no longer after. so in case you want to preserve the damage log, you need to save it on sql db its not complicated, you just need consider what you want to log, I think it will be gid of mob, account id, char id, damage CREATE TABLE IF NOT EXISTS `mob_damage_log` ( `id` int(11) NOT NULL auto_increment, `mob_gid` int(11) NOT NULL default '0', `account_id` int(11) NOT NULL default '0', `char_id` int(11) NOT NULL default '0', `damage` int(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `mob_gid` (`mob_gid`), KEY `account_id` (`account_id`), KEY `char_id` (`char_id`) ) ENGINE=MyISAM; something like that maybe. and the code would go like this, as the sd, you can get it with map_session_data *sd= map_charid2sd(char_id); if( SQL_ERROR == Sql_Query( mmysql_handle, "INSERT INTO `mob_damage_log`(`mob_gid`,`account_id`,`char_id`,`damage`) VALUES ( '%d', '%d', '%d', '%d' )", md->bl.id, sd->status.account_id, sd->status.account_id, damage) ){ Sql_ShowDebug(mmysql_handle); return; }
    1 point
  5. better using vector instead array since rA is now c++
    1 point
  6. Hello, try this: - script MVP_DROP FAKE_NPC,{ OnNPCKillEvent: if(!getmonsterinfo(killedrid, MOB_MVPEXP)) end; .@rowCount = getarraysize(.itemInfos) / .columnCount; for (.@i = 0; .@i < .@rowCount; .@i++) { .@index = .@i * .@rowCount; .@randIndex = rand(.@i, .@rowCount - 1) * .@rowCount; copyarray .tmpItemInfo[0], .itemInfos[.@randIndex], .columnCount; copyarray .itemInfos[.@randIndex], .itemInfos[.@index], .columnCount; copyarray .itemInfos[.@index], .tmpItemInfo[0], .columnCount; } for(.@i = 0; .@i < getarraysize(.itemInfos); .@i += .columnCount) { if(rand(1, 100) <= .itemInfos[.@i + 2]) { getitem .itemInfos[.@i], .itemInfos[.@i + 1]; announce "Congratulations! Player " + strcharinfo(0) + " has obtained "+ getitemname(.itemInfos[.@i]) +" [" + .itemInfos[.@i + 1] + "] from "+ getmonsterinfo(killedrid, 0) +" (chance: " + .itemInfos[.@i + 2] + "%) MVP Drop(s).", bc_all, 0x00FF00; if(.onlyOneDrop) end; } } end; OnInit: // item id, item amount, item chance in % setarray .itemInfos[0], 7179, 1, 5, 7227, 1, 25, 7539, 1, 50; .onlyOneDrop = true; .columnCount = 3; }
    1 point
×
×
  • Create New...