Jump to content

Distraught

Honorable Member
  • Posts

    194
  • Joined

  • Last visited

  • Days Won

    23
  • Feedback

    0%

Everything posted by Distraught

  1. Acutally you both are right. @metin2-factory says the ++i is running faster than the i++. It's true because i++ stores the old value and returns that and after adds 1 to the value of i. ++i only adds 1 and doesn't store the old value. BUT @Tasho is also right. I checked the runtime of both of our code (ran it 1.000.000 times and then calculated an average value). His code runs about 2x times faster than mine because of the optimalizations he did.
  2. M2 Download Center Download Here ( Internal ) Hey guyz, Today I made a small release. It's a new LUA function to check if all the members of the party have the specified item (and then it removes it). Let's start to make it work! Open party.h and search for: GetMemberMinLevel(); After add this: bool CheckItem(int targyID); Save and close the file. Open party.cpp and and the code below the function GetMemberMaxLevel: bool CParty::CheckItem(int targyID) { int dbszam = 0; itertype(m_memberMap) it = m_memberMap.begin(); while (it!=m_memberMap.end()) { if (!it->second.pCharacter) { ++it; continue; } if(it->second.pCharacter->CountSpecifyItem(targyID) > 0) dbszam++; ++it; } if(GetNearMemberCount() <= dbszam) { itertype(m_memberMap) it2 = m_memberMap.begin(); while (it2!=m_memberMap.end()) { if (!it2->second.pCharacter) { ++it2; continue; } if(it2->second.pCharacter->CountSpecifyItem(targyID) > 0) it2->second.pCharacter->RemoveSpecifyItem(targyID); ++it2; } }else{return false;} return true; } Save the file and close it. Open questlua_party.cpp and add this function: int party_check_item(lua_State* L) { DWORD item_vnum; if (lua_isnumber(L,1)) { item_vnum = (DWORD)lua_tonumber(L, 1); } else { lua_pushboolean(L, 0); return 1; } LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->GetParty()) lua_pushboolean(L,ch->GetParty()->CheckItem(item_vnum)); else lua_pushboolean(L, 0); return 1; } Add the line below after { "is_in_dungeon", party_is_in_dungeon }, { "check_item", party_check_item }, Compile the game and we're done. In quests it will return a boolean value. You can use it like: if party.check_item(72702) then d.join(207) end In this case it checks if all the party members have the item with the ID of 72702 and then it removes from them and warps them to the dungeon. Don't copy it or at least mention my name!
  3. M2 Download Center Download Here ( Internal ) Hey guyz, I made a quest checker that reads your quest and if it has any error then the program shows so. Download
  4. M2 Download Center Download Here ( Internal ) Hey guyz, I just made a simple but sexy enterpage. Download Feel free to use
  5. compile your game without stripping it and then debug it to let us see what happened
  6. you can just easily set limittype 0 and 1, etc to have more limits at the same time
  7. coding new systems is not a magic, start learning c++ and you'll be able to do so [Hidden Content]
  8. in the pythinnetworkstreamphasegamitem.cpp modify case ARMOR_RING like this: case ARMOR_RING: CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(kSpecialEffect.vid); pInstance->CInstanceBase::ArmorRing(); break; may it gonna work
  9. open char_quickslot.cpp and search for: if (pItem->IsDragonSoul()) return; modify: if (pItem->IsDragonSoul() || pItem->GetVnum() == YOURITEMID) return; If you wanna add more items: if (pItem->IsDragonSoul() || pItem->GetVnum() == YOURITEMID || pItem->GetVnum() == YOURITEMID2 || pItem->GetVnum() == YOURITEMID3) return; I'm working now so I couldn't test it, but I think it's gonna work.
  10. then search for BeginAttack or something like that in char_battle.cpp and check that
  11. go to game/src/char_item.cp and search for: else if (true == CItemVnumHelper::IsLovePendant(dwVnum)) after put something like: if (item->GetVnum() == YOURITEMID) { this->EffectPacket(ARMOR_RING); } Then search for: bool CHARACTER::UnequipItem(LPITEM item) to this function put this: if (item->GetVnum() == YOURITEMID) { this->EffectPacket(ARMOR_RING); } go to common/length.h and search for: SE_EQUIP_LOVE_PENDANT, then put this under: ARMOR_RING, Now you can compile your game. open UserInterface/PythonNetworkStreamPhaseGameItem.cpp in your client source and search for: case SE_EQUIP_LOVE_PENDANT: after put these: case ARMOR_RING: CInstanceBase::ArmorRing(); break; Go to InstanceBase.h and search for: void OnUntargeted(); Add under: void ArmorRing(); Search for: m_armorRefineEffect; Add under: bool ringeffect; Now go to InstanceBase.cpp and at the beginning declare it: bool ringeffect = false; now search for: void CInstanceBase::__ClearArmorRefineEffect() After this function put this: void CInstanceBase::ArmorRing() { if (!ringeffect) { __AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5); ringeffect = true; } else { __DetachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5); ringeffect = false; } } Now compile it. I couldn't test it, cause I'm working now but I think it's gonna work.
  12. if you attack a mob, do you also have to wait a few seconds to make it attack you?
  13. compile your bin in debug mode and let us see the errors
  14. for using their models and graphical stuff using their source is hard to prove, and I don't think they could
  15. as I see there's no effect after this (yknow like those little particles going around the armor) so just change the effect's number because it's the same as the effect number of potion effect or whatever after the calculation
  16. after you loaded it, scroll down to the "Edit Effect Color" or some button like this (I didn't find better pic, I'm working now and it's from google just marked the steps)
  17. can u paste your main.cpp, char.cpp and questlua_pc.cpp here?
  18. hmm you were right, because you commented out the fly effect, the compiler thinks the next line is what goes under the for comment out this part like this // for (int i = 1; i < m_lGold+1; i=i+500000)
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.