KODevelopers 438 #1 Oluşturuldu: Ekim 20, 2017 Merhaba arkadaşlar; TP ve Rez gibi respawn skillerin kullanımı sonrasında yakındaki karakterlerin görüntüsü gelmiyor. Region fonksiyonlarını kontrol ettim fakat pek bi sonuca varamadım. Karakter hareket ettikten sonra yakındaki kullanıcıların ve npclerin görüntüsü geliyor. Moveprocess fonksiyonunu örnek alarak yola çıktım fakat bi sonuca ulaşamadım tekrardan bu konuda fikiri olan var mı acaba ? Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
PENTAGRAM 921 #2 Ekim 21, 2017 tarihinde gönderildi AlıntıMerhaba arkadaşlar; TP ve Rez gibi respawn skillerin kullanımı sonrasında yakındaki karakterlerin görüntüsü gelmiyor. Region fonksiyonlarını kontrol ettim fakat pek bi sonuca varamadım. Karakter hareket ettikten sonra yakındaki kullanıcıların ve npclerin görüntüsü geliyor. Moveprocess fonksiyonunu örnek alarak yola çıktım fakat bi sonuca ulaşamadım tekrardan bu konuda fikiri olan var mı acaba ? CUser::Regene() fonksiyonunu kontrol et. Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
KODevelopers 438 #3 Konu Sahibi Ekim 21, 2017 tarihinde gönderildi AlıntıCUser::Regene() fonksiyonunu kontrol et. ASSERT(GetMap() != nullptr); _OBJECT_EVENT* pEvent = nullptr; _START_POSITION* pStartPosition = nullptr; float x = 0.0f, z = 0.0f; if (!isDead()) return; if (regene_type != 1 && regene_type != 2) regene_type = 1; if (regene_type == 2) { // Is our level high enough to be able to resurrect using this skill? if (GetLevel() // Do we have enough resurrection stones? || !RobItem(379006000, 3 * GetLevel())) return; } // If we're in a home zone, we'll want the coordinates from there. Otherwise, assume our own home zone. pStartPosition = g_pMain->m_StartPositionArray.GetData(GetZoneID()); if (pStartPosition == nullptr) return; UserInOut(INOUT_OUT); pEvent = GetMap()->GetObjectEvent(m_sBind); // If we're not using a spell to resurrect. if (magicid == 0) { // Resurrect at a bind/respawn point if (pEvent && pEvent->byLife == 1 && GetZoneID() != ZONE_DELOS) { SetPosition(pEvent->fPosX + x, 0.0f, pEvent->fPosZ + z); x = pEvent->fPosX; z = pEvent->fPosZ; } // Are we trying to respawn in a home zone? // If we're in a war zone (aside from snow wars, which apparently use different coords), use BattleZone coordinates. else if ((GetZoneID() m_byBattleZone))) { // Use the proper respawn area for our nation, as the opposite nation can // enter this zone at a war's invasion stage. x = (float)((GetNation() == KARUS ? pStartPosition->sKarusX : pStartPosition->sElmoradX) + myrand(0, pStartPosition->bRangeX)); z = (float)((GetNation() == KARUS ? pStartPosition->sKarusZ : pStartPosition->sElmoradZ) + myrand(0, pStartPosition->bRangeZ)); } else { short sx, sz; // If we're in a war zone (aside from snow wars, which apparently use different coords), use BattleZone coordinates. if ((GetZoneID() == ZONE_MORADON || GetZoneID() == ZONE_MORADON2) && isInArena()) { x = (float)(MINI_ARENA_RESPAWN_X + myrand(-MINI_ARENA_RESPAWN_RADIUS, MINI_ARENA_RESPAWN_RADIUS)); z = (float)(MINI_ARENA_RESPAWN_Z + myrand(-MINI_ARENA_RESPAWN_RADIUS, MINI_ARENA_RESPAWN_RADIUS)); } else if (GetZoneID() == ZONE_CHAOS_DUNGEON) { GetStartPositionRandom(sx, sz); x = sx; z = sz; } // For all else, just grab the start position (/town coordinates) from the START_POSITION table. else { GetStartPosition(sx, sz); x = sx; z = sz; } } SetPosition(x, 0.0f, z); m_LastX = x; m_LastZ = z; m_bResHpType = USER_STANDING; m_bRegeneType = REGENE_NORMAL; } else // we're respawning using a resurrect skill. { _MAGIC_TYPE5 * pType = g_pMain->m_Magictype5Array.GetData(magicid); if (pType == nullptr) return; MSpChange(-m_iMaxMp); // reset us to 0 MP. if (m_sWhoKilledMe == -1) ExpChange((m_iLostExp * pType->bExpRecover) / 100); // Restore m_bResHpType = USER_STANDING; m_bRegeneType = REGENE_MAGIC; ResetWindows(); } Packet result(WIZ_REGENE); result Send(&result); m_tLastRegeneTime = UNIXTIME; m_sWhoKilledMe = -1; m_iLostExp = 0; if (!isBlinking()) { result.Initialize(AG_USER_REGENE); result Send_AIServer(&result); } SetRegion(GetNewRegionX(), GetNewRegionZ()); UserInOut(INOUT_RESPAWN); g_pMain->RegionUserInOutForMe(this); g_pMain->RegionNpcInfoForMe(this); InitializeStealth(); SendUserStatusUpdate(USER_STATUS_DOT, USER_STATUS_CURE); SendUserStatusUpdate(USER_STATUS_POISON, USER_STATUS_CURE); if (isInArena()) SendUserStatusUpdate(USER_STATUS_SPEED, USER_STATUS_CURE); HpChange(GetMaxHealth()); InitType4(); RecastSavedMagic(); HpChange(GetMaxHealth()); // If we actually respawned (i.e. we weren't resurrected by a skill)... if (magicid == 0) { BlinkStart(); // In PVP zones (not war zones), we must kick out players if they no longer // have any national points. if (GetLoyalty() == 0 && (GetMap()->isWarZone() || isInPKZone())) KickOutZoneUser(); } bu şekilde ayarlı regene hangi blockta hata var acaba ? @ Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
PENTAGRAM 921 #4 Ekim 21, 2017 tarihinde gönderildi AlıntıSpoiler ASSERT(GetMap() != nullptr); _OBJECT_EVENT* pEvent = nullptr; _START_POSITION* pStartPosition = nullptr; float x = 0.0f, z = 0.0f; if (!isDead()) return; if (regene_type != 1 && regene_type != 2) regene_type = 1; if (regene_type == 2) { // Is our level high enough to be able to resurrect using this skill? if (GetLevel() // Do we have enough resurrection stones? || !RobItem(379006000, 3 * GetLevel())) return; } // If we're in a home zone, we'll want the coordinates from there. Otherwise, assume our own home zone. pStartPosition = g_pMain->m_StartPositionArray.GetData(GetZoneID()); if (pStartPosition == nullptr) return; UserInOut(INOUT_OUT); pEvent = GetMap()->GetObjectEvent(m_sBind); // If we're not using a spell to resurrect. if (magicid == 0) { // Resurrect at a bind/respawn point if (pEvent && pEvent->byLife == 1 && GetZoneID() != ZONE_DELOS) { SetPosition(pEvent->fPosX + x, 0.0f, pEvent->fPosZ + z); x = pEvent->fPosX; z = pEvent->fPosZ; } // Are we trying to respawn in a home zone? // If we're in a war zone (aside from snow wars, which apparently use different coords), use BattleZone coordinates. else if ((GetZoneID() m_byBattleZone))) { // Use the proper respawn area for our nation, as the opposite nation can // enter this zone at a war's invasion stage. x = (float)((GetNation() == KARUS ? pStartPosition->sKarusX : pStartPosition->sElmoradX) + myrand(0, pStartPosition->bRangeX)); z = (float)((GetNation() == KARUS ? pStartPosition->sKarusZ : pStartPosition->sElmoradZ) + myrand(0, pStartPosition->bRangeZ)); } else { short sx, sz; // If we're in a war zone (aside from snow wars, which apparently use different coords), use BattleZone coordinates. if ((GetZoneID() == ZONE_MORADON || GetZoneID() == ZONE_MORADON2) && isInArena()) { x = (float)(MINI_ARENA_RESPAWN_X + myrand(-MINI_ARENA_RESPAWN_RADIUS, MINI_ARENA_RESPAWN_RADIUS)); z = (float)(MINI_ARENA_RESPAWN_Z + myrand(-MINI_ARENA_RESPAWN_RADIUS, MINI_ARENA_RESPAWN_RADIUS)); } else if (GetZoneID() == ZONE_CHAOS_DUNGEON) { GetStartPositionRandom(sx, sz); x = sx; z = sz; } // For all else, just grab the start position (/town coordinates) from the START_POSITION table. else { GetStartPosition(sx, sz); x = sx; z = sz; } } SetPosition(x, 0.0f, z); m_LastX = x; m_LastZ = z; m_bResHpType = USER_STANDING; m_bRegeneType = REGENE_NORMAL; } else // we're respawning using a resurrect skill. { _MAGIC_TYPE5 * pType = g_pMain->m_Magictype5Array.GetData(magicid); if (pType == nullptr) return; MSpChange(-m_iMaxMp); // reset us to 0 MP. if (m_sWhoKilledMe == -1) ExpChange((m_iLostExp * pType->bExpRecover) / 100); // Restore m_bResHpType = USER_STANDING; m_bRegeneType = REGENE_MAGIC; ResetWindows(); } Packet result(WIZ_REGENE); result Send(&result); m_tLastRegeneTime = UNIXTIME; m_sWhoKilledMe = -1; m_iLostExp = 0; if (!isBlinking()) { result.Initialize(AG_USER_REGENE); result Send_AIServer(&result); } SetRegion(GetNewRegionX(), GetNewRegionZ()); UserInOut(INOUT_RESPAWN); g_pMain->RegionUserInOutForMe(this); g_pMain->RegionNpcInfoForMe(this); InitializeStealth(); SendUserStatusUpdate(USER_STATUS_DOT, USER_STATUS_CURE); SendUserStatusUpdate(USER_STATUS_POISON, USER_STATUS_CURE); if (isInArena()) SendUserStatusUpdate(USER_STATUS_SPEED, USER_STATUS_CURE); HpChange(GetMaxHealth()); InitType4(); RecastSavedMagic(); HpChange(GetMaxHealth()); // If we actually respawned (i.e. we weren't resurrected by a skill)... if (magicid == 0) { BlinkStart(); // In PVP zones (not war zones), we must kick out players if they no longer // have any national points. if (GetLoyalty() == 0 && (GetMap()->isWarZone() || isInPKZone())) KickOutZoneUser(); }bu şekilde ayarlı regene hangi blockta hata var acaba ? @Çevredeki karakterler görünmüyorsa, kod bu kısmı çalıştırdığı andaki karakter koordinatı hatalı demektir. SetRegion(GetNewRegionX(), GetNewRegionZ()); UserInOut(INOUT_RESPAWN); g_pMain->RegionUserInOutForMe(this); g_pMain->RegionNpcInfoForMe(this);Breakpoint koyarak karakterin bu kod bloğunu çalıştırmadan hemen önceki koordinatını kontrol et. Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
KODevelopers 438 #5 Konu Sahibi Ekim 21, 2017 tarihinde gönderildi Kordinatlar doğru gözüküyor kontrol ettiğimde ayrıca skill kullanmasakta örneğin czden maradona geçtiğizde bir kaç saniye karakterlerin görüntüsü gelmiyor illa haraket etmek ve karşı kullanıcınında hareket etmesi gerekiyor aksi halde görünmez oluyor Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş