Merhaba,
Lonca savaşı çit, engel sistemi herhangi bi gm müdahalesi gerekmez.
Savaş başladıktan 2 dakika sonra 30 sn geri saymaya başlar. Süre bitince engeller kalkar.
Kodlar;
Eksik olursa war_map.cpp ve war_map.h bırakıyorum;
Kanıt:
Lonca savaşı çit, engel sistemi herhangi bi gm müdahalesi gerekmez.
Savaş başladıktan 2 dakika sonra 30 sn geri saymaya başlar. Süre bitince engeller kalkar.
Kodlar;
Linkleri görebilmek için
giriş yap veya kayıt ol.
C++:
//war_map.cpp
Arat:
EVENTFUNC(war_begin_event)
Fonksiyonun altına ekle:
EVENTFUNC(war_begin_protection_event)
{
war_map_info* info = dynamic_cast<war_map_info*>(event->info);
if (info == NULL)
{
sys_err( "war_begin_protection_event> <Factor> Null pointer" );
return 0;
}
CWarMap* pMap = info->pWarMap;
if (pMap->GetBeginProtectionStatus() == false)
{
DWORD dwElapsedTime = get_dword_time() - pMap->GetStartTime();
if (dwElapsedTime >= 180000) {
pMap->SetBeginProtectionStatus(true);
pMap->Notice("Savas basladi!");
SECTREE_MANAGER::instance().PurgeNPCsInMap(pMap->GetMapIndex());
}
else {
char szNoticeText[512];
snprintf(szNoticeText, sizeof(szNoticeText), "Savas %ld saniye icinde baslayacak.", 179 - (dwElapsedTime / 1000));
pMap->Notice(szNoticeText);
}
}
return PASSES_PER_SEC(1);
}
Arat:
void CWarMap::SetBeginEvent(LPEVENT pkEv)
Fonksiyonun altına ekle:
void CWarMap::SetEndEvent(LPEVENT pkEv)
{
if (m_pkEndEvent != NULL) {
event_cancel(&m_pkEndEvent);
}
if (pkEv != NULL) {
m_pkEndEvent = pkEv;
}
}
Arat:
event_cancel(&m_pkBeginEvent);
Altına ekle:
event_cancel(&m_pkBeginProtectionEvent);
Arat:
m_dwStartTime = get_dword_time();
m_bEnded = false;
Altına ekle:
m_bBeginProtectionCompleted = false;
Arat:
void CWarMap::IncMember(LPCHARACTER ch)
Bul:
if (isWarMember)
{
Altına ekle:
if (m_set_pkChr.empty()) {
m_dwFirstLogonTime = get_dword_time();
SetBeginProtectionEvent(event_create(war_begin_protection_event, info, PASSES_PER_SEC(1)));
}
Arat:
if (GetType() == WAR_MAP_TYPE_FLAG)
{
AddFlagBase(0);
AddFlagBase(1);
AddFlag(0);
AddFlag(1);
}
Altına Ekle:
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 127 * 100 + 32000, 102 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 120 * 100 + 32000, 109 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 115 * 100 + 32000, 114 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 109 * 100 + 32000, 120 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 103 * 100 + 32000, 126 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 99 * 100 + 32000, 130 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 156 * 100 + 32000, 129 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 151 * 100 + 32000, 134 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 146 * 100 + 32000, 139 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 141 * 100 + 32000, 144 * 100 + 0, 2, false, 225, true);
CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 134 * 100 + 32000, 151 * 100 + 0, 2, false, 225, true);
-------------------------------------------------
//war_map.h
Arat:
void SetBeginEvent(LPEVENT pkEv);
Altına ekle:
void SetBeginProtectionEvent(LPEVENT pkEv);
Arat:
LPEVENT m_pkBeginEvent;
Altına ekle:
LPEVENT m_pkBeginProtectionEvent;
Arat:
void DecMember(LPCHARACTER ch);
Altına ekle:
DWORD GetStartTime();
bool GetBeginProtectionStatus();
void SetBeginProtectionStatus(bool bNewStat);
Arat:
bool m_bEnded;
Altına ekle:
bool m_bBeginProtectionCompleted;
DWORD m_dwFirstLogonTime;
Eksik olursa war_map.cpp ve war_map.h bırakıyorum;
Linkleri görebilmek için
giriş yap veya kayıt ol.
Linkleri görebilmek için
giriş yap veya kayıt ol.
Kanıt:
Linkleri görebilmek için
giriş yap veya kayıt ol.
Linkleri görebilmek için
giriş yap veya kayıt ol.
Linkleri görebilmek için
giriş yap veya kayıt ol.