-
Posts
194 -
Joined
-
Last visited
-
Days Won
23 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Everything posted by Distraught
-
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.
-
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!
-
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
- 2 replies
-
- 31
-
M2 Download Center Download Here ( Internal ) Hey guyz, I just made a simple but sexy enterpage. Download Feel free to use
- 1 reply
-
- 9
-
its kinda similar
-
RemoveFromCharacter Game Core
Distraught replied to cekaskartos8's topic in Community Support - Questions & Answers
when u get this error? ath throwing items out? -
Core is shutting down, why?
Distraught replied to Metin2Place's topic in Community Support - Questions & Answers
compile your game without stripping it and then debug it to let us see what happened -
you can just easily set limittype 0 and 1, etc to have more limits at the same time
-
Help for editing C++
Distraught replied to antrikos91's topic in Community Support - Questions & Answers
coding new systems is not a magic, start learning c++ and you'll be able to do so [Hidden Content]- 1 reply
-
- 1
-
Item giving armor shining
Distraught replied to mateo7788's topic in Community Support - Questions & Answers
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 -
Shop range showing distance
Distraught replied to ae5140's topic in Community Support - Questions & Answers
sqrt((targetX-yourX)^2 + (targetY-yourY)^2) -
Restrict items on QuickSlots
Distraught replied to zeimpekis9's topic in Community Support - Questions & Answers
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. -
then search for BeginAttack or something like that in char_battle.cpp and check that
-
Item giving armor shining
Distraught replied to mateo7788's topic in Community Support - Questions & Answers
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. -
if you attack a mob, do you also have to wait a few seconds to make it attack you?
-
compile your bin in debug mode and let us see the errors
-
for using their models and graphical stuff using their source is hard to prove, and I don't think they could
-
Penetration effect On Equip
Distraught replied to MDevelopers's topic in Community Support - Questions & Answers
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 -
Edit costume effect color in world editor?
Distraught replied to Jawwad's topic in Community Support - Questions & Answers
modify both of the particles -
Edit costume effect color in world editor?
Distraught replied to Jawwad's topic in Community Support - Questions & Answers
click on Time Bar button and then the play button -
Edit costume effect color in world editor?
Distraught replied to Jawwad's topic in Community Support - Questions & Answers
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) -
items slot , the time remains the same
Distraught replied to Sebypunct's topic in Community Support - Questions & Answers
could you paste your item.cpp and char_item.cpp here? -
can u paste your main.cpp, char.cpp and questlua_pc.cpp here?
-
Yang-Trading Bug
Distraught replied to RonnieBreathe's topic in Community Support - Questions & Answers
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) -
Penetration effect On Equip
Distraught replied to MDevelopers's topic in Community Support - Questions & Answers
show us your instancebase.cpp