xranzei 1
xranzei
Bvural41 1
Bvural41
kralhakan2009 1
kralhakan2009
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Vahsi Uzman 1
Vahsi Uzman
Cannn6161 1
Cannn6161
B 1
berione65
sen272 1
sen272
Mt2Hizmet 1
Mt2Hizmet
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Damage Rekor Sistemi

  • Konuyu başlatan Konuyu başlatan Koray'
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 19
  • Görüntüleme Görüntüleme 5K
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Koray'

Pasha37
Uzman
Katılım
21 Haz 2013
Konular
198
Mesajlar
1,742
Çözüm
8
Online süresi
17d 3h
Reaksiyon Skoru
2,660
Altın Konu
3
Başarım Puanı
278
MmoLira
714
DevLira
103
Ticaret - 0%
0   0   0

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

ss2015-10-23at03.44.56.jpg


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
Kod:
[COLOR=#BB0000][FONT=Verdana]m_pkMiningEvent = NULL;[/FONT][/COLOR]
[COLOR=#BB0000][FONT=Verdana]// END_OF_MINING[/FONT][/COLOR]

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



Arat:
Kod:
m_dwMountTime = 0;
Kod:

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



Arat:
Kod:
 //DELAYED_WARP
Kod:
[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]

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





Arat:
Kod:
int CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const
Kod:
[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]

Altına ekle:
Kod:
void CHARACTER::SetDamageRecord(int igetnewrecord){
Kod:
[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]


*char.h

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

Altına ekle:
Kod:
 LPEVENT m_pkRecordControlEvent;
Kod:
[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]


*char_battle.cpp
Arat:
Kod:
 if (GetHP() <= 0)
Kod:
[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]

Altına ekle:
Kod:
 if (pAttacker->IsPC()){
Kod:
[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]


*input_login.cpp
Arat:
Kod:
 if (g_noticeBattleZone)
Kod:
[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]

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


*questlua_global.cpp

Arat:
Kod:
 { "add_ox_quiz", _add_ox_quiz },
Kod:
Üstüne ekle:
Kod:
 { "reset_damage_record", _reload_damage_record },
Kod:
[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]

Arat:
Kod:
 void RegisterGlobalFunctionTable(lua_State* L)
Kod:
Üstüne ekle:
Kod:
 int _reload_damage_record(lua_State* L)
Kod:
[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]


Basit bir kontrol paneli:
Kod:
[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 oldu bu 34k olarak paylasılırsa daha ıyı olur
 
Sistem düşüncesi güzel olmuş fakat sürekli notice geçmesi server sağlığına zararlı olur adam yumruk atar düz vurur hava açar düz vurur item çıkarır düz vurur ve buda sürekli notice geçer böyle bir sıkıntı olmazmı?
 
Sistem düşüncesi güzel olmuş fakat sürekli notice geçmesi server sağlığına zararlı olur adam yumruk atar düz vurur hava açar düz vurur item çıkarır düz vurur ve buda sürekli notice geçer böyle bir sıkıntı olmazmı?

En yüksek damageyi noticeliyor :) mesela 4.999 damage yapılmış birdaha 4.999 damage yapılınca yazmayacak ; 5.000 oldugunda yazıcak.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

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

Geri
Üst