Hikayeler

Reklam vermek için turkmmo@gmail.com

Rekor DMG sistemi

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

recep7878

Level 5
TM Üye
Üye
Katılım
4 Nis 2009
Konular
83
Mesajlar
920
Reaksiyon Skoru
143
Altın Konu
0
Başarım Puanı
102
TM Yaşı
17 Yıl 20 Gün
MmoLira
20
DevLira
0

Metin2 EP, Valorant VP dahil tüm oyun ürünlerini en uygun fiyatlarla bulabilir, Item ve Karakterlerinizi hızlıca satabilirsiniz. HEMEN TIKLA!

3aa3020fc8.jpg



Korayın 2015'te yazdığı sistemdir.

Yapılan en yüksek hasarı sisteme kaydeder ve yeni rekor kırıldıkça duyuru geçer isteğe göre ödül felanda ekleyebilirsiniz


*char.cpp
Arat:

Kod:
 // MINING[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]m_pkMiningEvent = NULL;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]// END_OF_MINING[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Üstüne ekle:
Kod:
 m_pkRecordControlEvent = NULL;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]



Arat:
Kod:
m_dwMountTime = 0;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Üstüne ekle:
Kod:
m_nGetDamageRecord = quest::CQuestManager::instance().GetEventFlag("dam age_record");[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]



Arat:
Kod:
 //DELAYED_WARP[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]event_cancel(&m_pkWarpEvent);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]event_cancel(&m_pkCheckSpeedHackEvent);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]//END_DELAYED_WARP[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Altına ekle:
Kod:
event_cancel(&m_pkRecordControlEvent);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]





Arat:
Kod:
int CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return CTableBySkill::instance().GetSkillPowerByLevelFrom Type(GetJob(), GetSkillGroup(), MINMAX(0, level, SKILL_MAX_LEVEL), bMob);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Altına ekle:
Kod:
void CHARACTER::SetDamageRecord(int igetnewrecord){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]m_nGetDamageRecord = igetnewrecord;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]void CHARACTER::CheckDamageRecord(){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int igetnewrecord = quest::CQuestManager::instance().GetEventFlag("dam age_record");[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (igetnewrecord != GetDamageRecord())[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]SetDamageRecord(igetnewrecord);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]EVENTFUNC(record_check_event)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]char_event_info* info = dynamic_cast<char_event_info*>(event->info);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (info == NULL)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]sys_err("record_check_event> <Factor> Null pointer");[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return 0;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]LPCHARACTER ch = info->ch;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (ch == NULL) { // <Factor>[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return 0;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]ch->CheckDamageRecord();[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]return PASSES_PER_SEC(10);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]void CHARACTER::InitRecordControlEvent(){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (m_pkRecordControlEvent)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return;[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]char_event_info* info = AllocEventInfo<char_event_info>();[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]info->ch = this;[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]m_pkRecordControlEvent = event_create(record_check_event, info, PASSES_PER_SEC(10));[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]


*char.h

Arat:
Kod:
 int m_iMaxAggro;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]// End of Battle[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Altına ekle:
Kod:
 LPEVENT m_pkRecordControlEvent;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int m_nGetDamageRecord;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]public:[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]void InitRecordControlEvent();[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int GetDamageRecord() const { return m_nGetDamageRecord; }[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]void SetDamageRecord(int igetnewrecord);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]void CheckDamageRecord();[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]


*char_battle.cpp

Arat:
Kod:
 if (GetHP() <= 0)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]Stun();[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]if (pAttacker && !pAttacker->IsNPC())[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]m_dwKillerPID = pAttacker->GetPlayerID();[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]else[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]m_dwKillerPID = 0;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Altına ekle:
Kod:
 if (pAttacker->IsPC()){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int newdam = dam;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (newdam > GetDamageRecord()) {[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]SetDamageRecord(newdam);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]quest::CQuestManager::instance().RequestSetEventFl ag("damage_record", newdam);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]quest::CQuestManager::instance().RequestSetEventFl ag("damage_record_own", pAttacker->GetPlayerID());[/FONT][/COLOR]




[COLOR=#BB0000][FONT=Verdana]char buf[250];[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]snprintf(buf, sizeof(buf), "%s isimli oyuncu %d damage ile damage rekorunu kırdı !", pAttacker->GetName(), dam);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]SendNotice(buf);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]


*input_login.cpp

Arat:
Kod:
 if (g_noticeBattleZone)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (FN_is_battle_zone(ch))[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("ÀÌ ¸Ê¿¡¼± °­Á¦ÀûÀÎ ´ëÀüÀÌ ÀÖÀ»¼ö µµ ÀÖ½À´Ï´Ù."));[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("ÀÌ Á¶Ç׿¡ µ¿ÀÇÇÏÁö ¾ÊÀ»½Ã"));[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("º»ÀÎÀÇ ÁÖ¼º ¹× ºÎ¼ºÀ¸·Î µ¹¾Æ°¡½Ã±â ¹Ù¶ø´Ï´Ù."));[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]

Altına ekle:
Kod:
ch->InitRecordControlEvent();[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]


*questlua_global.cpp

Arat:
Kod:
 { "add_ox_quiz", _add_ox_quiz },[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]
Üstüne ekle:

Kod:
 { "reset_damage_record", _reload_damage_record },[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{ "get_damage_record", _get_damage_record },[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{ "get_damage_record_owner", _get_damage_record_owner },[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]

Arat:
Kod:
 void RegisterGlobalFunctionTable(lua_State* L)[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]
Üstüne ekle:

Kod:
 int _reload_damage_record(lua_State* L)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]quest::CQuestManager::instance().SetEventFlag("dam age_record", 0);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]SendNotice("Damage rekoru sifirlandi");[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]return 1;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]int _get_damage_record(lua_State* L)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int iDamageRecord = quest::CQuestManager::instance().GetEventFlag("dam age_record");[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (iDamageRecord)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]lua_pushnumber(L, iDamageRecord);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]else[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]lua_pushnumber(L, 0);[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]return 1;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]int _get_damage_record_owner(lua_State* L)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]{[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]int iDamageRecordOwnerPid = quest::CQuestManager::instance().GetEventFlag("dam age_record_own");[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (iDamageRecordOwnerPid){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]LPCHARACTER chRecordOwner = CHARACTER_MANAGER::instance().FindByPID(iDamageRec ordOwnerPid);[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if (chRecordOwner){[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]lua_pushstring(L, chRecordOwner->GetName());[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]return 1;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]}[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]


Basit bir kontrol paneli:
Kod:
[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]--[[[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]Yeni quest fonksiyonlarını quest_functions dosyasına ekleyin:[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]get_damage_record[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]get_damage_record_owner[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]reset_damage_record[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]--]][/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]quest dmg_record begin[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]state start begin[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]when 20094.chat."Damage Rekor " with pc.is_gm() begin[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local s = select("Rekoru Sifirla", "Rekor sahibi", "Rekoru Oto Duyur", "Iptal")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if s == 1 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]reset_damage_record()[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]elseif s == 2 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local record, owner = get_damage_record(), get_damage_record_owner()[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]say_title("Damage Rekor bilgi")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]say("Damage rekoru:")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]say(record)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]say("Damage rekoru Sahibi:")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]say(owner)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]elseif s == 3 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local s_duyuru = select("Duyuruyu Ac", "Duyuruyu Kapat", "Iptal")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]if s_duyuru == 1 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]clear_server_timer("oto_duyuru_rekor")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]server_loop_timer("oto_duyuru_rekor", 40)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]syschat("Otomatik Duyuru kisa sure icinde baslatilacak")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]elseif s_duyuru == 2 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]clear_server_timer("oto_duyuru_rekor")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]syschat("Otomatik Duyuru durduruldu")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]elseif s_duyuru == 3 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]elseif s == 4 then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]when oto_duyuru_rekor.server_timer begin[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local time = os.date("%X")[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local splitData = dmg_record.split(time, ':')[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local newtime = tostring(splitData[1].. ":".. splitData[2])[/FONT][/COLOR]


[COLOR=#BB0000][FONT=Verdana]if newtime == "00:30" or newtime == "01:30" or newtime == "02:30" or newtime == "03:30" or newtime == "04:30" or newtime == "05:30" or newtime == "06:30" or newtime == "07:30" or newtime == "08:30" or newtime == "09:30" or newtime == "10:30" or newtime == "11:30" or newtime == "12:30" or newtime == "13:30" or newtime == "14:30" or newtime == "15:30" or newtime == "16:30" or newtime == "17:30" or newtime == "18:30" or newtime == "19:30" or newtime == "20:30" or newtime == "21:30" or newtime == "22:30" or newtime == "23:30" then[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local record, owner = get_damage_record(), get_damage_record_owner()[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]notice_all("Guncel damage rekor sahibi: "..owner .." Rekoru: "..record)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]




[COLOR=#BB0000][FONT=Verdana]function split(command_, x)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return dmg_record.split_(command_,x)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]function split_(string_,delimiter)[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local result = { }[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local from = 1[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]local delim_from, delim_to = string.find( string_, delimiter, from )[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]while delim_from do[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]table.insert( result, string.sub( string_, from , delim_from-1 ) )[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]from = delim_to + 1[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]delim_from, delim_to = string.find( string_, delimiter, from )[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]table.insert( result, string.sub( string_, from ) )[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]return result[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]end[/FONT][/COLOR]
 
Moderatör tarafında düzenlendi:
Güzel sistem teşekkürler.
 
3aa3020fc8.jpg


Korayın 2015'te yazdığı sistemdir.

Yapılan en yüksek hasarı sisteme kaydeder ve yeni rekor kırıldıkça duyuru geçer isteğe göre ödül felanda ekleyebilirsiniz


*char.cpp
Arat:

Kod:
    // MINING
    m_pkMiningEvent = NULL;
    // END_OF_MINING

Üstüne ekle:
Kod:
    m_pkRecordControlEvent = NULL;



Arat:
Kod:
m_dwMountTime = 0;

Üstüne ekle:
Kod:
m_nGetDamageRecord = quest::CQuestManager::instance().GetEventFlag("damage_record");



Arat:
Kod:
    //DELAYED_WARP
    event_cancel(&m_pkWarpEvent);
    event_cancel(&m_pkCheckSpeedHackEvent);
    //END_DELAYED_WARP

Altına ekle:
Kod:
event_cancel(&m_pkRecordControlEvent);





Arat:
Kod:
int    CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const
{
    return CTableBySkill::instance().GetSkillPowerByLevelFromType(GetJob(), GetSkillGroup(), MINMAX(0, level, SKILL_MAX_LEVEL), bMob);
}

Altına ekle:
Kod:
void CHARACTER::SetDamageRecord(int igetnewrecord){
    m_nGetDamageRecord = igetnewrecord;
}


void CHARACTER::CheckDamageRecord(){
    int igetnewrecord = quest::CQuestManager::instance().GetEventFlag("damage_record");
    if (igetnewrecord != GetDamageRecord())
        SetDamageRecord(igetnewrecord);
}


EVENTFUNC(record_check_event)
{
    char_event_info* info = dynamic_cast<char_event_info*>(event->info);
    if (info == NULL)
    {
        sys_err("record_check_event> <Factor> Null pointer");
        return 0;
    }


    LPCHARACTER    ch = info->ch;
    if (ch == NULL) { // <Factor>
        return 0;
    }


    ch->CheckDamageRecord();


    return PASSES_PER_SEC(10);
}


void CHARACTER::InitRecordControlEvent(){
    if (m_pkRecordControlEvent)
        return;


    char_event_info* info = AllocEventInfo<char_event_info>();


    info->ch = this;


    m_pkRecordControlEvent = event_create(record_check_event, info, PASSES_PER_SEC(10));
}


*char.h

Arat:
Kod:
        int                    m_iMaxAggro;
        // End of Battle

Altına ekle:
Kod:
        LPEVENT                m_pkRecordControlEvent;
        int                    m_nGetDamageRecord;
    public:
        void                InitRecordControlEvent();
        int                    GetDamageRecord() const        { return m_nGetDamageRecord; }
        void                SetDamageRecord(int igetnewrecord);
        void                CheckDamageRecord();


*char_battle.cpp

Arat:
Kod:
    if (GetHP() <= 0)
    {
        Stun();


        if (pAttacker && !pAttacker->IsNPC())
            m_dwKillerPID = pAttacker->GetPlayerID();
        else
            m_dwKillerPID = 0;
    }

Altına ekle:
Kod:
    if (pAttacker->IsPC()){
        int newdam = dam;
        if (newdam > GetDamageRecord()) {
            SetDamageRecord(newdam);
            quest::CQuestManager::instance().RequestSetEventFlag("damage_record", newdam);
            quest::CQuestManager::instance().RequestSetEventFlag("damage_record_own", pAttacker->GetPlayerID());




            char buf[250];
            snprintf(buf, sizeof(buf), "%s isimli oyuncu %d damage ile damage rekorunu kırdı !", pAttacker->GetName(), dam);
            SendNotice(buf);
        }
    }


*input_login.cpp

Arat:
Kod:
    if (g_noticeBattleZone)
    {
        if (FN_is_battle_zone(ch))
        {
            ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("ÀÌ ¸Ê¿¡¼± °­Á¦ÀûÀÎ ´ëÀüÀÌ ÀÖÀ»¼ö µµ ÀÖ½À´Ï´Ù."));
            ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("ÀÌ Á¶Ç׿¡ µ¿ÀÇÇÏÁö ¾ÊÀ»½Ã"));
            ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("º»ÀÎÀÇ ÁÖ¼º ¹× ºÎ¼ºÀ¸·Î µ¹¾Æ°¡½Ã±â ¹Ù¶ø´Ï´Ù."));
        }
    }

Altına ekle:
Kod:
ch->InitRecordControlEvent();


*questlua_global.cpp

Arat:
Kod:
            {    "add_ox_quiz",                    _add_ox_quiz                    },
Üstüne ekle:
Kod:
            {    "reset_damage_record",            _reload_damage_record            },
            {    "get_damage_record",            _get_damage_record                },
            {    "get_damage_record_owner",        _get_damage_record_owner        },

Arat:
Kod:
    void RegisterGlobalFunctionTable(lua_State* L)
Üstüne ekle:
Kod:
    int _reload_damage_record(lua_State* L)
    {
        quest::CQuestManager::instance().SetEventFlag("damage_record", 0);
        SendNotice("Damage rekoru sifirlandi");


        return 1;
    }


    int _get_damage_record(lua_State* L)
    {
        int iDamageRecord = quest::CQuestManager::instance().GetEventFlag("damage_record");
        if (iDamageRecord)
            lua_pushnumber(L, iDamageRecord);
        else
            lua_pushnumber(L, 0);


        return 1;
    }


    int _get_damage_record_owner(lua_State* L)
    {
        int iDamageRecordOwnerPid = quest::CQuestManager::instance().GetEventFlag("damage_record_own");
        if (iDamageRecordOwnerPid){
            LPCHARACTER chRecordOwner = CHARACTER_MANAGER::instance().FindByPID(iDamageRecordOwnerPid);
            if (chRecordOwner){
                lua_pushstring(L, chRecordOwner->GetName());
            }
        }


        return 1;
    }


Basit bir kontrol paneli:
Kod:
--[[
Yeni quest fonksiyonlarını quest_functions dosyasına ekleyin:
get_damage_record
get_damage_record_owner
reset_damage_record
--]]
quest dmg_record begin
    state start begin
        when 20094.chat."Damage Rekor " with pc.is_gm() begin
            local s = select("Rekoru Sifirla", "Rekor sahibi", "Rekoru Oto Duyur", "Iptal")
            if s == 1 then
                reset_damage_record()
            elseif s == 2 then
                local record, owner = get_damage_record(), get_damage_record_owner()
                say_title("Damage Rekor bilgi")
                say("Damage rekoru:")
                say(record)
                say("Damage rekoru Sahibi:")
                say(owner)
            elseif s == 3 then
                local s_duyuru = select("Duyuruyu Ac", "Duyuruyu Kapat", "Iptal")
                if s_duyuru == 1 then
                    clear_server_timer("oto_duyuru_rekor")
                    server_loop_timer("oto_duyuru_rekor", 40)
                    syschat("Otomatik Duyuru kisa sure icinde baslatilacak")
                elseif s_duyuru == 2 then
                    clear_server_timer("oto_duyuru_rekor")
                    syschat("Otomatik Duyuru durduruldu")
                elseif s_duyuru == 3 then
                    return
                end
            elseif s == 4 then
                return
            end
        end


        when oto_duyuru_rekor.server_timer begin
            local time = os.date("%X")
            local splitData = dmg_record.split(time, ':')
            local newtime = tostring(splitData[1].. ":".. splitData[2])


            if newtime == "00:30" or newtime == "01:30" or newtime == "02:30" or newtime == "03:30" or newtime == "04:30" or newtime == "05:30" or newtime == "06:30" or newtime == "07:30" or newtime == "08:30" or newtime == "09:30" or newtime == "10:30" or newtime == "11:30" or newtime == "12:30" or newtime == "13:30" or newtime == "14:30" or newtime == "15:30" or newtime == "16:30" or newtime == "17:30" or newtime == "18:30" or newtime == "19:30" or newtime == "20:30" or newtime == "21:30" or newtime == "22:30" or newtime == "23:30" then
                local record, owner = get_damage_record(), get_damage_record_owner()
                notice_all("Guncel damage rekor sahibi: "..owner .." Rekoru: "..record)
            end
        end




        function split(command_, x)
            return dmg_record.split_(command_,x)
        end
        function split_(string_,delimiter)
            local result = { }
            local from  = 1
            local delim_from, delim_to = string.find( string_, delimiter, from  )
            while delim_from do
                table.insert( result, string.sub( string_, from , delim_from-1 ) )
                from  = delim_to + 1
                delim_from, delim_to = string.find( string_, delimiter, from  )
            end
            table.insert( result, string.sub( string_, from  ) )
            return result
        end
    end
end

Thanks PC gelince alicam bir dal not et &#128514;
 
Sistem güzel sağolasın fakat şöyle bir sorun var yeni açılan yüksek onlineli bir servere eklendiği zaman her hasarda yukardan yazı geçecek sonuçta yeni olduğu için her sn daha fazla hasar cıkacak o yüzden sisteme güncelleme getirilir 10-20k üzeri hasarlardan sonra yazı çıkması ayarlanırsa dha güzel olur diye düşünüyorum.
 
Son düzenleme:
Sistem güzel sağolasın fakat şöyle bir sorun var yeni açılan yüksek onlineli bir servere eklendiği zaman her hasarda yukardan yazı geçecek sonuçta yeni olduğu için her sn daha fazla hasar cıkacak o yüzden sisteme güncelleme getirilir 10-20k üzeri hasarlardan sonra yazı çıkması ayarlanırsa dha güzel olur diye düşünüyorum.

Birisi ilk olarak ws'de 8k Attı ise 8K'dan aşağısı bildirim olarak geçmez 7.999 bildirime girmez 8.001 ise girer birisi max olarak 20k attı ise 21k atanın noticesi geçer buyüzden bir sıkıntı olucağını sanmıyorum
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

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

Geri
Üst