Hallo Community,
ich habe ein Problem und eine Frage zugleich.
Bei mir auf dem Server dropt man zwischendurch ein Item mit der ID "300".
Allerdings gibt es keine Einträge davon in der "mob_drop_item" oder anderswo.
Aus diesem Grund habe ich mich in der Source etwas umgeschaut und folgendes gefunden:
Code
- // DROPEVENT_CHARSTONE
- // drop_char_stone 1
- // drop_char_stone.percent_lv01_10 5
- // drop_char_stone.percent_lv11_30 10
- // drop_char_stone.percent_lv31_MX 15
- // drop_char_stone.level_range 10
- static struct DropEvent_CharStone
- {
- int percent_lv01_10;
- int percent_lv11_30;
- int percent_lv31_MX;
- int level_range;
- bool alive;
- DropEvent_CharStone()
- {
- percent_lv01_10 = 100;
- percent_lv11_30 = 200;
- percent_lv31_MX = 300;
- level_range = 10;
- alive = false;
- }
- } gs_dropEvent_charStone;
- static int __DropEvent_CharStone_GetDropPercent(int killer_level)
- {
- int killer_levelStep = (killer_level-1)/10;
- switch (killer_levelStep)
- {
- case 0:
- return gs_dropEvent_charStone.percent_lv01_10;
- case 1:
- case 2:
- return gs_dropEvent_charStone.percent_lv11_30;
- }
- return gs_dropEvent_charStone.percent_lv31_MX;
- }
- static void __DropEvent_CharStone_DropItem(CHARACTER & killer, CHARACTER & victim, ITEM_MANAGER& itemMgr, std::vector<LPITEM>& vec_item)
- {
- if (!gs_dropEvent_charStone.alive)
- return;
- int killer_level = killer.GetLevel();
- int dropPercent = __DropEvent_CharStone_GetDropPercent(killer_level);
- int MaxRange = 10000;
- if (LC_IsCanada() == true)
- MaxRange = 20000;
- if (number(1, MaxRange) <= dropPercent)
- {
- int log_level = (test_server || killer.GetGMLevel() >= GM_LOW_WIZARD) ? 0 : 1;
- int victim_level = victim.GetLevel();
- int level_diff = victim_level - killer_level;
- if (level_diff >= +gs_dropEvent_charStone.level_range || level_diff <= -gs_dropEvent_charStone.level_range)
- {
- sys_log(log_level,
- "dropevent.drop_char_stone.level_range_over: killer(%s: lv%d), victim(%s: lv:%d), level_diff(%d)",
- killer.GetName(), killer.GetLevel(), victim.GetName(), victim.GetLevel(), level_diff);
- return;
- }
- static const int Stones[] = { 30210, 30211, 30212, 30213, 30214, 30215, 30216, 30217, 30218, 30219, 30258, 30259, 30260, 30261, 30262, 30263 };
- int item_vnum = Stones[number(0, _countof(Stones))];
- LPITEM p_item = NULL;
- if ((p_item = itemMgr.CreateItem(item_vnum, 1, 0, true)))
- {
- vec_item.push_back(p_item);
- sys_log(log_level,
- "dropevent.drop_char_stone.item_drop: killer(%s: lv%d), victim(%s: lv:%d), item_name(%s)",
- killer.GetName(), killer.GetLevel(), victim.GetName(), victim.GetLevel(), p_item->GetName());
- }
- }
- }
- bool DropEvent_CharStone_SetValue(const std::string& name, int value)
- {
- if (name == "drop_char_stone")
- {
- gs_dropEvent_charStone.alive = value;
- if (value)
- sys_log(0, "dropevent.drop_char_stone = on");
- else
- sys_log(0, "dropevent.drop_char_stone = off");
- }
- else if (name == "drop_char_stone.percent_lv01_10")
- gs_dropEvent_charStone.percent_lv01_10 = value;
- else if (name == "drop_char_stone.percent_lv11_30")
- gs_dropEvent_charStone.percent_lv11_30 = value;
- else if (name == "drop_char_stone.percent_lv31_MX")
- gs_dropEvent_charStone.percent_lv31_MX = value;
- else if (name == "drop_char_stone.level_range")
- gs_dropEvent_charStone.level_range = value;
- else
- return false;
- sys_log(0, "dropevent.drop_char_stone: %d", gs_dropEvent_charStone.alive ? true : false);
- sys_log(0, "dropevent.drop_char_stone.percent_lv01_10: %f", gs_dropEvent_charStone.percent_lv01_10/100.0f);
- sys_log(0, "dropevent.drop_char_stone.percent_lv11_30: %f", gs_dropEvent_charStone.percent_lv11_30/100.0f);
- sys_log(0, "dropevent.drop_char_stone.percent_lv31_MX: %f", gs_dropEvent_charStone.percent_lv31_MX/100.0f);
- sys_log(0, "dropevent.drop_char_stone.level_range: %d", gs_dropEvent_charStone.level_range);
- return true;
- }
- // END_OF_DROPEVENT_CHARSTONE
Da meine C++ Kenntnisse nicht so weit reichen,
würde ich gerne wissen was diese Funktion bewirkt und vielleich sogar die Ursache meines Problems ist.
Ich bin dankbar für jede Hilfe.
Mfg.
#edit
Was noch komisch ist, ist das der Gegenstand mit der vnum "300" nicht in der Db existiert.
In den Log files steht folgendes:
Bitte melden Sie sich an, um diesen Link zu sehen.