[DEV]AB 1
[DEV]AB
R 1
Roksam
emirhanHCL 1
emirhanHCL
Agora Metin2 1
Agora Metin2
mannaxxx 1
mannaxxx
farkmt2official 1
farkmt2official
TuZaKK 1
TuZaKK
bList 1
bList
Hikaye Ekle
Kaynak ikonu

promotional code system 1

indirmek için izniniz yok
  • Konuyu başlatan Konuyu başlatan malin493
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 3
  • Görüntüleme Görüntüleme 2K
1625652465351.png

download:
scan:
Thanks .Atom for this system :)
 

En Çok Reaksiyon Alan Mesajlar

bug after you enter the promo code, and press ok, it just hide the window, but the input text doenst stop and it recive txt

edit.
fixed it

def Close(self):
self.ClickClear()
self.promo_code.KillFocus()

wndMgr.Hide(self.hWnd)

edit2. fix coins update and add special inventory and gaya and won

[CODE lang="cpp" title="fix"]void CHARACTER::give_PromoCodeSystem(const std::string& sType, int iVnum, int iCount)
{
if (!sType.compare("item"))
{
LPITEM itemReward = ITEM_MANAGER::instance().CreateItem(iVnum, iCount, 0, true);

if (itemReward)
{
int iEmptyPos;
if (itemReward->IsDragonSoul())
iEmptyPos = GetEmptyDragonSoulInventory(itemReward);
else if (itemReward->IsUpgradeItem())
iEmptyPos = GetEmptyUpgradeInventory(itemReward);
else if (itemReward->IsBook())
iEmptyPos = GetEmptyBookInventory(itemReward);
else if (itemReward->IsStone())
iEmptyPos = GetEmptyStoneInventory(itemReward);
else
iEmptyPos = GetEmptyInventory(itemReward->GetSize());

if (iEmptyPos != -1)
{
if (itemReward->IsDragonSoul())
itemReward->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyPos));
#ifdef ENABLE_SPECIAL_STORAGE
else if (itemReward->IsUpgradeItem())
itemReward->AddToCharacter(this, TItemPos(UPGRADE_INVENTORY, iEmptyPos));
else if (itemReward->IsBook())
itemReward->AddToCharacter(this, TItemPos(BOOK_INVENTORY, iEmptyPos));
else if (itemReward->IsStone())
itemReward->AddToCharacter(this, TItemPos(STONE_INVENTORY, iEmptyPos));
#endif
else
itemReward->AddToCharacter(this, TItemPos(INVENTORY, iEmptyPos));
}
else
{
PIXEL_POSITION pos;

if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
return;

pos.x = number(-10, 10) * 20;
pos.y = number(-10, 10) * 20;

pos.x += GetX();
pos.y += GetY();

itemReward->AddToGround(GetMapIndex(), pos);
itemReward->StartDestroyEvent();
}

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %s , %d bucati."), itemReward->GetName(), iCount);
}
}

else if (!sType.compare("gold"))
{
const int64_t TotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(iCount);

if (TotalMoney >= GOLD_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea mult yang!"));
return;
}

PointChange(POINT_GOLD, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d yang!"), iCount);
}
#ifdef ENABLE_PROMO_CODE_WON
else if(!sType.compare("won"))
{
const int64_t TotalCheque = static_cast<int64_t>(GetCheque()) + static_cast<int64_t>(iCount);
if (TotalCheque >= CHEQUE_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multi woni!"));
return;
}

PointChange(POINT_CHEQUE, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d won(i)!"), iCount);
}
#endif

#ifdef ENABLE_PROMO_CODE_GEM
else if(!sType.compare("gaya"))
{
const int64_t TotalGem = static_cast<int64_t>(GetGem()) + static_cast<int64_t>(iCount);
if (TotalGem >= GEM_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multe puncte gaya!"));
return;
}

PointChange(POINT_GEM, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d gaya!"), iCount);
}
#endif

else if (!sType.compare("coins"))
{
DBManager::instance().Query("UPDATE account.account SET coins=coins + '%d' WHERE id = '%d'", iCount, GetDesc()->GetAccountTable().id);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d monede dragon!"), iCount);
}

else if (!sType.compare("level"))
{
int idx = 0;

while (idx < iCount)
{
PointChange(POINT_EXP, GetNextExp());
idx++;
}

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d niveluri suplimentare!"), iCount);
}
}
#endif[/CODE]


edit3, added name and ip into restriction

[CODE lang="cpp" title="fix"]void CHARACTER::lock_PromoCodeSystem(const char * promo_code)
{
char szQuery[256];

std::auto_ptr<SQLMsg> pMsg1(DBManager::instance().DirectQuery("SELECT ip FROM player.player WHERE account_id = '%d'", GetDesc()->GetAccountTable().id));
MYSQL_ROW row = mysql_fetch_row(pMsg1->Get()->pSQLResult);

if (pMsg1->uiSQLErrno != 0 || !pMsg1->Get()->uiNumRows)
return;

snprintf(szQuery, sizeof(szQuery), "INSERT INTO player.promo_code_restriction SET account_id = '%d', player_name = '%s', promo_code = '%s', ip = '%s'", GetDesc()->GetAccountTable().id, GetName(), promo_code, row[0]);
std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));
}[/CODE]
bug after you enter the promo code, and press ok, it just hide the window, but the input text doenst stop and it recive txt

edit.
fixed it

def Close(self):
self.ClickClear()
self.promo_code.KillFocus()

wndMgr.Hide(self.hWnd)

edit2. fix coins update and add special inventory and gaya and won

[CODE lang="cpp" title="fix"]void CHARACTER::give_PromoCodeSystem(const std::string& sType, int iVnum, int iCount)
{
if (!sType.compare("item"))
{
LPITEM itemReward = ITEM_MANAGER::instance().CreateItem(iVnum, iCount, 0, true);

if (itemReward)
{
int iEmptyPos;
if (itemReward->IsDragonSoul())
iEmptyPos = GetEmptyDragonSoulInventory(itemReward);
else if (itemReward->IsUpgradeItem())
iEmptyPos = GetEmptyUpgradeInventory(itemReward);
else if (itemReward->IsBook())
iEmptyPos = GetEmptyBookInventory(itemReward);
else if (itemReward->IsStone())
iEmptyPos = GetEmptyStoneInventory(itemReward);
else
iEmptyPos = GetEmptyInventory(itemReward->GetSize());

if (iEmptyPos != -1)
{
if (itemReward->IsDragonSoul())
itemReward->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyPos));
#ifdef ENABLE_SPECIAL_STORAGE
else if (itemReward->IsUpgradeItem())
itemReward->AddToCharacter(this, TItemPos(UPGRADE_INVENTORY, iEmptyPos));
else if (itemReward->IsBook())
itemReward->AddToCharacter(this, TItemPos(BOOK_INVENTORY, iEmptyPos));
else if (itemReward->IsStone())
itemReward->AddToCharacter(this, TItemPos(STONE_INVENTORY, iEmptyPos));
#endif
else
itemReward->AddToCharacter(this, TItemPos(INVENTORY, iEmptyPos));
}
else
{
PIXEL_POSITION pos;

if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
return;

pos.x = number(-10, 10) * 20;
pos.y = number(-10, 10) * 20;

pos.x += GetX();
pos.y += GetY();

itemReward->AddToGround(GetMapIndex(), pos);
itemReward->StartDestroyEvent();
}

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %s , %d bucati."), itemReward->GetName(), iCount);
}
}

else if (!sType.compare("gold"))
{
const int64_t TotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(iCount);

if (TotalMoney >= GOLD_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea mult yang!"));
return;
}

PointChange(POINT_GOLD, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d yang!"), iCount);
}
#ifdef ENABLE_PROMO_CODE_WON
else if(!sType.compare("won"))
{
const int64_t TotalCheque = static_cast<int64_t>(GetCheque()) + static_cast<int64_t>(iCount);
if (TotalCheque >= CHEQUE_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multi woni!"));
return;
}

PointChange(POINT_CHEQUE, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d won(i)!"), iCount);
}
#endif

#ifdef ENABLE_PROMO_CODE_GEM
else if(!sType.compare("gaya"))
{
const int64_t TotalGem = static_cast<int64_t>(GetGem()) + static_cast<int64_t>(iCount);
if (TotalGem >= GEM_MAX)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multe puncte gaya!"));
return;
}

PointChange(POINT_GEM, iCount, true);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d gaya!"), iCount);
}
#endif

else if (!sType.compare("coins"))
{
DBManager::instance().Query("UPDATE account.account SET coins=coins + '%d' WHERE id = '%d'", iCount, GetDesc()->GetAccountTable().id);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d monede dragon!"), iCount);
}

else if (!sType.compare("level"))
{
int idx = 0;

while (idx < iCount)
{
PointChange(POINT_EXP, GetNextExp());
idx++;
}

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d niveluri suplimentare!"), iCount);
}
}
#endif[/CODE]


edit3, added name and ip into restriction

[CODE lang="cpp" title="fix"]void CHARACTER::lock_PromoCodeSystem(const char * promo_code)
{
char szQuery[256];

std::auto_ptr<SQLMsg> pMsg1(DBManager::instance().DirectQuery("SELECT ip FROM player.player WHERE account_id = '%d'", GetDesc()->GetAccountTable().id));
MYSQL_ROW row = mysql_fetch_row(pMsg1->Get()->pSQLResult);

if (pMsg1->uiSQLErrno != 0 || !pMsg1->Get()->uiNumRows)
return;

snprintf(szQuery, sizeof(szQuery), "INSERT INTO player.promo_code_restriction SET account_id = '%d', player_name = '%s', promo_code = '%s', ip = '%s'", GetDesc()->GetAccountTable().id, GetName(), promo_code, row[0]);
std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));
}[/CODE]
 
Son düzenleme:

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst