Jump to content

OtherChoice

Inactive Member
  • Posts

    91
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    0%

Everything posted by OtherChoice

  1. I don't actually know how sash system is made but if it uses packet to tell client when to execute sash stuff (effect and model) you may want to add a new packet in server source game/item.cpp: bool CHARACTER::UnequipItem(LPITEM item) and check for item->GetVnum() == Sash_vnums (use CItemVnumHelper::Your_Function or anything that fits your needs)
  2. What you are looking for is a quite composite task. Basically you can declare the effect inside playersettingmodule.py like this: chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DUST, "", "d:/ymir work/effect/etc/dust/dust.mse") chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HORSE_DUST, "", "d:/ymir work/effect/etc/dust/running_dust.mse") chrmgr.RegisterCacheEffect(chrmgr.EFFECT_HIT, "", "d:/ymir work/effect/hit/blow_1/blow_1_low.mse") chrmgr.RegisterCacheEffect(chrmgr.EFFECT_FISHING_ROD, "Bip01 R Hand", "d:/ymir work/effect/fishing_rod/fishing_effect.mse") #Bip01 R Hand is the standard hand bone, you can anyway attach it to every bone you desire then declare EFFECT_FISHING_ROD in InstanceBase.h in the effect enum and in PythonCharacterManagerModule.cpp add PyModule_AddIntConstant(poModule, "EFFECT_FISHING_ROD", CInstanceBase::EFFECT_FISHING_ROD); And then in InstanceBase.cpp in function: UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem) { DWORD refine = max(pItem->GetRefine() + pItem->GetSocketCount(),CItemData::ITEM_SOCKET_MAX_NUM) - CItemData::ITEM_SOCKET_MAX_NUM; switch (pItem->GetType()) { case CItemData::ITEM_TYPE_WEAPON: ..... case CItemData::ITEM_TYPE_ARMOR: ..... /*add->*/ case CItemData::ITEM_TYPE_ROD: if (any_condition_you_desire) __AttachEffect(EFFECT_FISHING_ROD); Anyway this is a very rough example beacuse i do not have enough information about the condition needed for this effect to show. Be careful: If you want to perform a serverside check of any type before applying this effect you might need to setup a packet work-around.
  3. Sorry mate but for the sake of a clean and readable code you should change this To something like this: If number(0,(denominator-1)) <= (numerator-1) where your chance is: numerator/denominator Lets say you want a 10% droprate so 1/10 chance: If number(0,9) <= 0 then or a 0,03% droprate == 3/10000 you will use: If number(0,9999) <= 2 then The best suggestion i can give you is to make a function inside your game source to call anytime you want to output a result of a chance: int game_rnd_chance(lua_State * L) { if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) { lua_pushboolean(L, false); } if (number(0,(int)lua_tonumber(L, 2)-1) <= (int)lua_tonumber(L,1)-1) lua_pushboolean(L, true); else lua_pushboolean(L, false); return 0; } void RegisterGameFunctionTable() { luaL_reg game_functions[] = { ..... { "rnd_chance", game_rnd_chance }, } } and then call it like this: if game.rnd_chance(numerator, denominator) == true then Anyway if you still want to stick with the code you wrote i suggest you to at least remove the redundant part: if number(1,100) > (100 - drop_chance) then // --> to --> // if number(1,100) <= (drop_chance) then
  4. On ServerSide source files in questlua_game.cpp the function is defined like this: int game_drop_item_with_ownership(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); LPITEM item = NULL; switch (lua_gettop(L)) { case 1: item = ITEM_MANAGER::instance().CreateItem((DWORD) lua_tonumber(L, 1)); break; case 2: case 3: item = ITEM_MANAGER::instance().CreateItem((DWORD) lua_tonumber(L, 1), (int) lua_tonumber(L, 2)); break; default: return 0; } if ( item == NULL ) { return 0; } if (lua_isnumber(L, 3)) { int sec = (int) lua_tonumber(L, 3); if (sec <= 0) { item->SetOwnership( ch ); } else { item->SetOwnership( ch, sec ); } } else item->SetOwnership( ch ); PIXEL_POSITION pos; pos.x = ch->GetX() + number(-200, 200); pos.y = ch->GetY() + number(-200, 200); item->AddToGround(ch->GetMapIndex(), pos); item->StartDestroyEvent(); return 0; } So the function you are trying to call is already accepting a second and a third parameter for quantity and ownership duration. You could simply use game.drop_item_with_ownership(item_vnum, item_quantity, ownership_duration) The StartDestroyEvent() function has a default value of sec = 300 defined in item.h but you can enter the time you desire as a parameter: item->StartDestroyEvent(time_you_desire);
  5. playersettingmodule.py : EDIT chrmgr.RegisterEffect(chrmgr.EFFECT_FLAME_ATTACK, "equip_right_hand", "d:/ymir work/effect/hit/blow_flame/flame_3_weapon.mse") TO chrmgr.RegisterCacheEffect(chrmgr.EFFECT_FLAME_ATTACK, "Bip01 R Hand", "d:/ymir work/effect/hit/blow_flame/flame_3_weapon.mse") (equip_right_hand >> Bip01 R Hand) It will work smoothly on every model (shaman, ninja, sura, warrior) Moreover this way the effect won't be displayed across clients since the combo index used is referred only to played character. To display the effect correctly the function may be modified this way InstanceBase.cpp void CInstanceBase::__ComboProcess() { if (isGetComboAttacking()) { if (!m_GraphicThingInstance.IsHandMode()) { __AttachEffect(EFFECT_FLAME_ATTACK2); } } } InstanceBase.h BOOL isGetComboAttacking(); InstanceBaseMovement.cpp BOOL CInstanceBase::isGetComboAttacking() { return m_GraphicThingInstance.isGetComboAttacking(); } ActorInstanceBattle.cpp BOOL CActorInstance::isGetComboAttacking() { if (!m_pkCurRaceMotionData) return FALSE; if (!m_pkCurRaceMotionData->isAttackingMotion()) return FALSE; const NRaceData::TMotionAttackData * c_pData = m_pkCurRaceMotionData->GetMotionAttackDataPointer(); if (NRaceData::MOTION_TYPE_COMBO != c_pData->iMotionType) return FALSE; if (m_lastMotionName == m_pkCurRaceMotionData->GetMotionFileName()) return FALSE; m_lastMotionName = m_pkCurRaceMotionData->GetMotionFileName(); return TRUE; } (ActorInstanceBattle.cpp) find "void CActorInstance::__OnEndCombo()", "void CActorInstance::__ClearCombo()" and within those add m_lastMotionName = NULL; ActorInstance.h BOOL isGetComboAttacking(); const char* m_lastMotionName; I know its a old question but someone might find this useful (can be applied to other effects like the lighting one in /effect/hit/blow_electric
  6. If he does not need that function he could do this way, but he may want to display the cube cost formatted the way NumberToMoneyString does...
  7. It could be a missing import if NumberToMoneyString is called from somewhere else or something wrong inside the function itself if you declared it inside CubeWindow.py. If you still have some question or can't find what's wrong please share your CubeWindow.py.
  8. Hello everyone, I do not usually ask others for help about developing but this time i encountered some difficoulties with something i'm not really into: 3d models. As a coder graphics and so on are my bane. Long story short this is my problem: i have a 3d model + texture and relative animation ready to use, it is correctly displayed in game but its position is wrong, it lays slightly under ground cutting the model in half. I understood the problem: the starting point (don't actually know specific terminology) is either set at the center of the model or anyhow wrong but i don't know how to fix it. I hope some of the good graphic developers of this forum will find some time to help me out. I will attach the model to this thread. Best regards. chest_colossus.rar
  9. To be clear: your function __CanAddItemAttr(self, dstSlotPos) has a wrong false However this function will return true for bonus 1,2,3,4 and false for 5,6,7 and it is used to check whether you can add a bonus with reinforce item (vnum 71085). What was your goal? having reinforce item higlighting the item?
  10. This is the function i have, as you can see the last part is different
  11. Both ITEM_ATTRIBUTE_SLOT_MAX_NUM and ITEM_SOCKET_SLOT_MAX_NUM are in Userinterface/GameType.h, and can be called as ATTRIBUTE_SLOT_MAX_NUM and METIN_SOCKET_MAX_NUM respectively within python scripts However sincerly i can't understand your code: attrCount = 0 //here you inizialize the constant for i in xrange(player.METIN_SOCKET_MAX_NUM): // for i in xrange(3): if player.GetItemAttribute(dstSlotPos, i) != 0: // GetItemAttribute: is this a custom function you made or are you using a incomplete type of the void //CPythonPlayer::GetItemAttribute(TItemPos Cell, DWORD dwAttrSlotIndex, BYTE * pbyType, short * psValue)? if so //it will check against ITEM_ATTRIBUTE_SLOT_MAX_NUM == 7 (it will return true for 5, 6 and 7th bonuses) return True if attrCount<4: //here if attrCount is 3, 2, 1 will return false is this intended? maybe attrCount>3 return False return False
  12. First make sure that void CHARACTER::RemoveGoodAffect() in char_affect.cpp is ok, it should be something like: Next go in char_skill.cpp and find: "if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_REMOVE_GOOD_AFFECT))" it should be something like this: Then, still in char_skill.cpp, check this: And if you find everything is ok then you can try 2 different things: 1)check you skill_proto in database but i highly doubt the problem is there 2)open every game/src/*.cpp and .h files in notepad++ -> Ctrl+F -> search for AFF_PABEOP in every opened document and go for every occurency manually checking if there's something wrong
  13. Finally solved. Solution: /game/src/db.cpp and /common/lenght.h were somehow wrong, still don't know where exactly since there were no error or difference i could tell, but when i replaced those files with older backup i had everything run smoothly
  14. I tried 4 different client i had with 3 different binary each, the result was always the same. Other icons display correctly only the account.account (safebox, autodrop, gold, exp) related ones don't
  15. Everything is shown correctly, syserr is clean, and .dds file is ok, even items 71015-71016-71017, which apply the same uiaffect, are working smoothly and showing their icon I'm thinking of some source typo in the game/src/db.cpp, but i have no real clue.
  16. Hello everyone, I encountered a weird problem while working on my local machine. Honestly its the first time i cannot solve a problem with some web searches and own investigations, that's why im starting this thread. This is the problem: mall bonus such as safebox, gold, drop, marriage, autodrop, are correctly applyed to accounts and are working perfectly in game, however client won't show their uiaffect on upperleft side of the screen. (every other affect such as skill or items is correctly shown) I run 40k, mainline_sg, client official 40k, and tried with some different client binary sources i had (same result). I thought my problem could have been in my uiaffectshower.py but it seemed to be ok while comparing to others i had. Sincerely i don't know what am i missing, but i hope some of you could help me find out a solution. Best regards.
×
×
  • 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.