Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char __stdcall AdvMng_4_Arena(HiHook* hook, void* AvdMng, _Hero_* hero, _MapItem_* obj, bool isHuman)
- {
- _AdvMgr_* AvdMan = (_AdvMgr_*)AvdMng;
- char result = isHuman;
- int SelectedSkill;
- bool isMagical = obj->os_type;
- if (!CALL_2(int, __thiscall, 0x4E5630, hero, obj)) //check if visited
- {
- if (isHuman)
- {
- CALL_3(int, __thiscall, 0x415CC0, AvdMan, 0, -1); //AdvMgr_SetTimer
- CALL_4(void, __thiscall, 0x415D40, AvdMan, 0, 1, 1); //AdvMgr_UpdateInfoPanel
- if (!isMagical)
- b_MsgBoxQ(o_Advevent_TXT->GetString(0), 10, -1, -1, 31, 2, 32, 2, -1, 0, -1, 0);
- else
- b_MsgBoxQ((char*)o_Advevent_2[0].c_str(), 10, -1, -1, 33, 2, 34, 2, -1, 0, -1, 0);
- if (o_WndMgr->result_dlg_item_id == 30729)
- {
- SelectedSkill = 0;
- }
- else if (o_WndMgr->result_dlg_item_id == 30730)
- {
- SelectedSkill = 1;
- }
- else
- return result;
- }
- else
- {
- if (isMagical)
- if (hero->power > hero->knowledge)
- if (hero->knowledge > 25 && hero->power < 99)
- SelectedSkill = 0;
- else
- SelectedSkill = 1;
- else //Проверка на переполнение не нужна, так как знания больше силы, а значит силе есть куда расти
- SelectedSkill = 0;
- else
- if (hero->attack > hero->defence)
- SelectedSkill = 1;
- else
- SelectedSkill = 0;
- }
- if (isMagical)
- SelectedSkill += 2;
- switch (SelectedSkill)
- {
- case 0:
- hero->attack += 2;
- if (hero->attack > 99)
- hero->attack = 99;
- break;
- case 1:
- hero->defence += 2;
- if (hero->defence > 99)
- hero->defence = 99;
- break;
- case 2:
- hero->power += 2;
- if (hero->power > 99)
- hero->power = 99;
- break;
- case 3:
- hero->knowledge += 2;
- if (hero->knowledge > 99)
- hero->knowledge = 99;
- break;
- default:
- break;
- }
- return CALL_2(int, __thiscall, 0x4E5650, hero, obj); //set as visited
- }
- if (isHuman)
- {
- if (!isMagical)
- b_MsgBoxQ(o_Advevent_TXT->GetString(1), 1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0);
- else
- b_MsgBoxQ((char*)o_Advevent_2[1].c_str(), 1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0);
- result = (o_WndMgr->result_dlg_item_id == DIID_OK);
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement