avertuss 48 Posted April 10, 2019 Share Posted April 10, 2019 Hi. I have bool CNewPetActor::Update(DWORD deltaTime) { bool bResult = true; // Ćę ÁÖŔÎŔĚ Á׾ú°ĹłŞ, ĽŇČŻµČ ĆęŔÇ »óĹ°ˇ ŔĚ»óÇϴٸé ĆęŔ» ľřľÚ. (NOTE: °ˇ˛ű°ˇ´Ů ŔĚ·± Ŕú·± ŔĚŔŻ·Î ĽŇČŻµČ ĆęŔĚ DEAD »óĹÂżˇ şüÁö´Â °ćżě°ˇ ŔÖŔ˝-_-;) // ĆęŔ» ĽŇČŻÇŃ ľĆŔĚĹŰŔĚ ľř°ĹłŞ, ł»°ˇ °ˇÁř »óĹ°ˇ ľĆ´Ď¶ó¸é ĆęŔ» ľřľÚ. if (IsSummoned()) { if (m_pkOwner->IsImmortal() && Pet_Skill_Table[16][2 + m_dwskill[m_dwslotimm]] <= (get_global_time() - m_dwImmTime)*10) { //m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "%d - %d diff %d Skilltable %d", get_global_time(), m_dwImmTime, (get_global_time() - m_dwImmTime) * 10, Pet_Skill_Table[16][2 + m_dwskill[m_dwslotimm]]); m_dwImmTime = 0; m_pkOwner->SetImmortal(0); } } // if (m_pkOwner->IsDead() || (IsSummoned() && m_pkChar->IsDead()) || (IsSummoned() && (m_pkOwner->GetExchange() || m_pkOwner->GetMyShop() || m_pkOwner->GetShopOwner() || m_pkOwner->IsOpenSafebox() || m_pkOwner->IsCubeOpen() || m_dwduration <= 0)) // || NULL == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID()) // || ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetOwner() != this->GetOwner() // ) if((this->GetSummonItemVID() != 0 && (NULL == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID()) || ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetOwner() != this->GetOwner()))) { m_pkOwner->SetQuestFlag("PetSystems.pet_vnum", 0); m_pkOwner->SetQuestFlag("pet_item_id.pet_vnum", 0); this->Unsummon(); return true; } if(this->IsSummoned() && HasOption(EPetOption_Followable)) { bResult = bResult && this->_UpdateFollowAI(); } return bResult; } and quest quest PetSystems begin state start begin function get_pet_info(itemVnum) pet_info_map = { -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx [55701] = { 34041, "'s Kleiner Affe", 0}, [55702] = { 34045, "'s Kleine Spinne", 0}, [55703] = { 34049, "'s Kleiner Razador", 0}, [55704] = { 34053, "'s Kleiner Nemere", 0}, } itemVnum = tonumber(itemVnum) return pet_info_map[itemVnum] end when login with pc.getqf("pet_vnum") != 0 begin item.select(pc.getqf("pet_item_id")) newpet.summon(pc.getqf("pet_vnum"), petName, false) end when 55701.use or 55702.use or 55703.use or 55704.use begin local pet_info = PetSystems.get_pet_info(item.vnum) pc.setqf("pet_item_id", item.get_id()) if null != pet_info then local mobVnum = pet_info[1] local petName = pet_info[2] if true == newpet.is_summon(mobVnum) then newpet.unsummon(mobVnum) pc.setqf("pet_vnum", 0) else if newpet.count_summoned() < 1 then newpet.summon(mobVnum, petName, false) pc.setqf("pet_vnum", mobVnum) else syschat("You already summoned a pet.") end end -- if pet.is_summon end -- if null != pet_info end -- when end end Pet summons after relog but he doesn't give real bonuses. For example without pet: 103014 with pet: 104971, after relog 103166. Any ideas? Link to comment Share on other sites More sharing options...
Endymion 320 Posted April 10, 2019 Share Posted April 10, 2019 QuestFlag - int ItemID - dword btw 1 Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 11, 2019 Author Share Posted April 11, 2019 21 godzin temu, Endymion napisał: QuestFlag - int ItemID - dword btw Thanks for advice but i guess that isn't reason why it doesn't work well. Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted April 11, 2019 Premium Share Posted April 11, 2019 Shitty c++ at least remove useless comments... You're using "null" key to check in LUA? You're passing deltaTime var without use it? Pet bonus are from SQL, item_proto on the call item, you know? https://stackoverflow.com/questions/31323443/lua-whats-the-difference-between-null-and-nil Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 11, 2019 Author Share Posted April 11, 2019 2 godziny temu, WeedHex napisał: Shitty c++ at least remove useless comments... You're using "null" key to check in LUA? You're passing deltaTime var without use it? Pet bonus are from SQL, item_proto on the call item, you know? https://stackoverflow.com/questions/31323443/lua-whats-the-difference-between-null-and-nil I used that "system" with old pet system and it works well so idk. So how i can make it? I know that bonuses are from mysql. Any tips? Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 13, 2019 Author Share Posted April 13, 2019 f5. How can i use GiveBuffs() from pet system in input_login? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now