0% found this document useful (0 votes)
19 views7 pages

Malascdrop

The document contains code for dropping different amounts of in-game currency (wls) by converting higher value items into the base currency item. It checks the player's balance and item amounts, converts items to the appropriate amounts by sending network commands, then sends commands to drop the appropriate amounts of each item type to complete the currency drop.

Uploaded by

imsaga64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views7 pages

Malascdrop

The document contains code for dropping different amounts of in-game currency (wls) by converting higher value items into the base currency item. It checks the player's balance and item amounts, converts items to the appropriate amounts by sending network commands, then sends commands to drop the appropriate amounts of each item type to complete the currency drop.

Uploaded by

imsaga64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

int balance() {

int wl = 0;
wl += g_server->local_player.inventory.getItemCount(242);
wl += g_server->local_player.inventory.getItemCount(1796) * 100;
wl += g_server->local_player.inventory.getItemCount(7188) * 10000;
return wl;
}

int item_count(int itemid) {


int wl = g_server->local_player.inventory.getItemCount(itemid);
return wl;
}

else if (find_command(chat, "cdrop ")) {


try {
std::string cdropcount = chat.substr(7);
int sayi = stoi(cdropcount);

if (balance() < sayi) {


gt::send_log("`9Dont have `#balance`9. balance: " +
to_string(balance()) + ".");
return true;
}
if (sayi < 100) {

if (item_count(242) < sayi) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}

dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + cdropcount); //242
gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");
}

else if (sayi > 10000) {

int sayi1 = (sayi / 10000);

int kalan = ((sayi / 100) - (sayi1 * 100));


int kalan2 = sayi - ((kalan * 100) + (sayi1 * 10000));
if (kalan > item_count(1796)) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
else if (item_count(242) < kalan2) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string(sayi1)); //242

dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string(kalan)); //242

dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + std::to_string(kalan2)); //242

gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");


}
else {
int sayi1 = (sayi / 100);
int kalan = (sayi % 100);

if (item_count(242) < kalan) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));

}
else if (item_count(1796) < sayi1) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 242;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));

}
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string(sayi1)); //242

dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + std::to_string(kalan)); //242

gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");


}
}
catch (std::exception) { gt::send_log("Critical Error : Invalid String
Position"); }
return true;
}
else if (find_command(chat, "cd ")) {
try {
std::string cdropcount = chat.substr(4);
int sayi = stoi(cdropcount);

if (balance() < sayi) {


gt::send_log("`9Dont have `#balance`9.");
return true;
}
if (sayi < 100) {

if (item_count(242) < sayi) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}

dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + cdropcount); //242
gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");
}

else if (sayi > 10000) {

int sayi1 = (sayi / 10000);

int kalan = ((sayi / 100) - (sayi1 * 100));


int kalan2 = sayi - ((kalan * 100) + (sayi1 * 10000));
if (kalan > item_count(1796)) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
else if (item_count(242) < kalan2) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string(sayi1)); //242

dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string(kalan)); //242

dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + std::to_string(kalan2)); //242

gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");


}
else {
int sayi1 = (sayi / 100);
int kalan = (sayi % 100);

if (item_count(242) < kalan) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 1796;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));

}
else if (item_count(1796) < sayi1) {
gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 242;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));

}
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string(sayi1)); //242
dropwl = true;
g_server->send(false, "action|drop\n|itemID|242");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|242|\ncount|" + std::to_string(kalan)); //242

gt::send_log("`9Dropping `c" + cdropcount + "`9 wls...");


}
}
catch (std::exception) { gt::send_log("Critical Error : Invalid String
Position"); }
return true;
}
else if (find_command(chat, "ddrop ")) {
try {
if (item_count(1796) == 0) {
return true;

}
std::string cdropcount = chat.substr(7);
if (balance() < (stoi(cdropcount) * 100)) {
gt::send_log("`9Dont have enough `#balance`9.");
return true;

int dlcount = stoi(cdropcount);

if (dlcount > 200 && item_count(7188) >= (dlcount / 100)) {

if (item_count(1796) < (dlcount % 100)) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string((dlcount / 100))); //242
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string((dlcount % 100))); //1796

gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");


return true;
}

if (item_count(1796) < dlcount && item_count(1796) <= 100) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET, (uint8_t*)&drop,
sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
else if (item_count(1796) < dlcount) {
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string((dlcount / 100))); //242
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string((dlcount % 100))); //1796

gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");


return true;

}
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|drop_item\
nitemID|1796|\ncount|" + cdropcount); //1796
gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");
}
catch (std::exception) { gt::send_log("Critical Error : Invalid String
Position"); }
return true;
}
else if (find_command(chat, "dd ")) {
try {
if (item_count(1796) == 0) {
return true;

}
std::string cdropcount = chat.substr(4);
if (balance() < (stoi(cdropcount) * 100)) {
gt::send_log("`9Dont have enough `#balance`9.");
return true;

int dlcount = stoi(cdropcount);

if (dlcount > 200 && item_count(7188) >= (dlcount / 100)) {

if (item_count(1796) < (dlcount % 100)) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET,
(uint8_t*)&drop, sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string((dlcount / 100))); //242
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string((dlcount % 100))); //1796

gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");


return true;
}

if (item_count(1796) < dlcount && item_count(1796) <= 100) {


gameupdatepacket_t drop{ 0 };
drop.m_type = PACKET_ITEM_ACTIVATE_REQUEST;
drop.m_int_data = 7188;
g_server->send(false, NET_MESSAGE_GAME_PACKET, (uint8_t*)&drop,
sizeof(gameupdatepacket_t));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
else if (item_count(1796) < dlcount) {
dropbgl = true;
g_server->send(false, "action|drop\n|itemID|7188");
std::this_thread::sleep_for(std::chrono::milliseconds(300));

g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|7188|\ncount|" + std::to_string((dlcount / 100))); //242
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|
drop_item\nitemID|1796|\ncount|" + std::to_string((dlcount % 100))); //1796

gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");


return true;

}
dropdl = true;
g_server->send(false, "action|drop\n|itemID|1796");
std::this_thread::sleep_for(std::chrono::milliseconds(300));
g_server->send(false, "action|dialog_return\ndialog_name|drop_item\
nitemID|1796|\ncount|" + cdropcount); //1796
gt::send_log("`9Dropping `c" + cdropcount + "`9 Dl...");
}
catch (std::exception) { gt::send_log("Critical Error : Invalid String
Position"); }
return true;
}

You might also like