- Katılım
- 7 Tem 2021
- Konular
- 6
- Mesajlar
- 21
- Online süresi
- 7d 16h
- Reaksiyon Skoru
- 33
- Altın Konu
- 0
- TM Yaşı
- 4 Yıl 11 Ay 12 Gün
- Başarım Puanı
- 51
- MmoLira
- 2,275
- DevLira
- 18
HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!
download:
scan:
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
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]
- Katılım
- 16 Şub 2017
- Konular
- 5
- Mesajlar
- 132
- Online süresi
- 16d 4h
- Reaksiyon Skoru
- 20
- Altın Konu
- 0
- TM Yaşı
- 9 Yıl 3 Ay 28 Gün
- Başarım Puanı
- 96
- Yaş
- 27
- MmoLira
- 7,250
- DevLira
- 3
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]
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)
Benzer konular
- Cevaplar
- 14
- Görüntüleme
- 1K