Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Fix Bug de Zen (Con interfaces Abiertas)  (Visto 3724 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline NasLy Posteado: March 29, 2020, 02:46:14 AM

Por favor, Fixearlo ya que varias gente de Mier$$$ se ensaña en hacer daño.



ItemManager.cpp




Creditos:
File Emu
FG.Rih

Nunca es tarde para ser lo que podias haber sido.

Gracias:

b4nfter, elcrom, Domedica, nanokang, Hugo, zerg24, tupa110, axell, mauriciowins, tutu100, k33n00, zurect, Hoangtu34, CezarMaster, b0n3v, Watuyusei, adminel, dedicadobk, darkitox, darkes607, Xysad, zhangjianle865, Lucas2401, victhorinox, hoanmaster, yagoI2, warrior, dieguitox, glmmlg, xlichblack, komandirbk, Smudevelop, mugloves99, Shaper, GoldSun, milkaritas, samsunggon, RifleMaN_, c4nhsatcodong, stopk, KeyFinder, Zeus, visionmu, choosemu, animator, kimera, Hiếu Đại Ca, alexfy, ta6akus7, tiendoanit, Nexus, AmericaHost, thienthan1117, niceo, vnshell, ShadowWolf, thunwa1, cobyzero, idpnguyeni, ailsoncost, ruojing, showmax, mendani, zodiacobr, ddoadm, xlockee, PachoRasta, laulinh2, gpsturbo, Thor Host, deathsquad, nhanphu200, zlethanhlong, DarkovaX, dark, Kapocha33, admkolla, 日メリーのRu, SetecSoft, xj9mk45w, sannea, Hahn, pulsefire, DarkEternity, muzic25, Dieguinho, GabrielDevel, Nucanor, matheusgom, Cartman, Kosh, kaisudo, nguqua, Odisk, Higgs, kayito, neeck1234, ConejoMalo, roxtste, zerosp, 161012, dhaomao, thanhbinhqht, waltervg91, [GM]KING, calabocajea, Nakamura, Genilson23, Jean LR, 423646802, luciferlg, s00x, leones55, comelon666, Chupulum, Lude, seedmaker, Almdar, axeman192, fer1992, emciel, tito99, z3r0x, smiley, Supremo, privdens, NguyenAnh, once_tao, Daniel@, Liaon, Plate98, hiep, pquintal, AZURE, sagat202, allhoy, LTP Team, trkgncmg, dasgrid, TzCr4ck, LionRooT, Llalex, christoferdz, xtestx, onlinezajzaj, fivqt, agastin10, melo920, KhongGianOL, xpam, reveage, kallixtho, mrhung95, boncha, realman, andreyzz, Denis Alves, dahouzi, Berlan Barbalho, stark98, beibei, digimoncik, k12leito, xaxx10, ZabiinoOo, Shaman, HaPKoTuK, spartacus, Karuritoku, TheKing027, smallz170, Pyke, Ryuno, fenospro, elitingo, emersonx13, Van_Bom, darkjano, kaiocnx, wolffrox, PhantomKr, AntiChetO, cri0, Keko, djagripnos, dlawls662, GX_KYO, SbaGomez, gauyeutho, Natzugen, CorsarioDgx, artem, fabianm, gacon201294, dizzys, Peluuca, dreamboy7, SaintZeus, soberano

Offline emersonx13 #1 Posteado: March 29, 2020, 01:05:43 PM

Poderia detalhar mejor el bug como funciona?

Update 44 is ready!!!

Offline NasLy #2 Posteado: March 29, 2020, 04:13:20 PM

Poderia detalhar mejor el bug como funciona?

Detallado en el Titulo: "Bug de zen con Interfaces Abiertas"

Si pedis como funciona. NO ESPERES.

#Tuservermu es para AYUDAR  a los Server no ARRUINARLOS.

Nunca es tarde para ser lo que podias haber sido.

Gracias:


Offline TzCr4ck #3 Posteado: April 07, 2020, 06:07:30 PM

Hola, sabes si este bug está en los sources de louis S6 Up13 ?? Tengo que aplicar esto o ya está fix? Saludos


Offline waltervg91 #4 Posteado: August 13, 2020, 07:30:07 PM

Con esto no funciona la opcion repair all que tienen algunas NPC.


Offline Odisk #5 Posteado: August 13, 2020, 10:45:47 PM

no entiendo bien el bug debeia ser mas explicado xd


Offline Jean LR #6 Posteado: August 14, 2020, 11:25:13 AM

no entiendo bien el bug debeia ser mas explicado xd
Esta especificado, que el costo del repair era menos del que decía con ciertas interfaces abiertas, en un server slow o no rebirth donde el oro valga era un problema


Offline emersonx13 #7 Posteado: August 15, 2020, 01:19:16 PM | Modificado: August 15, 2020, 01:38:55 PM by emersonx13

This CHECK IS WRONG


lpObj->Interface.type == INTERFACE_SHOP)

if you put this in source you never will be able to repair itens in NPCS....
So you are look for the real fix to prevent this Zen Dupes in Repair function is that I provide below



Credits: Emershow, por pensar um pouco e test

Update 44 is ready!!!

Offline SaintZeus #8 Posteado: August 15, 2020, 02:38:15 PM

This CHECK IS WRONG


lpObj->Interface.type == INTERFACE_SHOP)

if you put this in source you never will be able to repair itens in NPCS....
So you are look for the real fix to prevent this Zen Dupes in Repair function is that I provide below
 
Credits: Emershow, por pensar um pouco e test
Lo deje asi y al apretar en "reparar todo" desaparece todo el ZEN.


Code: [Select]
if (
lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)

return lpObj->Money;
}


Offline waltervg91 #9 Posteado: August 15, 2020, 05:00:22 PM

This CHECK IS WRONG


lpObj->Interface.type == INTERFACE_SHOP)

if you put this in source you never will be able to repair itens in NPCS....
So you are look for the real fix to prevent this Zen Dupes in Repair function is that I provide below
 
Credits: Emershow, por pensar um pouco e test
Lo deje asi y al apretar en "reparar todo" desaparece todo el ZEN.


Code: [Select]
if (
lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)

return lpObj->Money;
}
No debes copiar el return lpObj->Money luego de la comprobacion IF, alli tienes que mostrar un mensaje y retornar 0 para que no haga la reparación mientras se cumplan esas condiciones.
Aquí te dejo el código por las dudas:


[/code]


Offline SaintZeus #10 Posteado: August 15, 2020, 05:15:23 PM

This CHECK IS WRONG


lpObj->Interface.type == INTERFACE_SHOP)

if you put this in source you never will be able to repair itens in NPCS....
So you are look for the real fix to prevent this Zen Dupes in Repair function is that I provide below
 
Credits: Emershow, por pensar um pouco e test
Lo deje asi y al apretar en "reparar todo" desaparece todo el ZEN.


Code: [Select]
if (
lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)

return lpObj->Money;
}
No debes copiar el return lpObj->Money luego de la comprobacion IF, alli tienes que mostrar un mensaje y retornar 0 para que no haga la reparación mientras se cumplan esas condiciones.
Aquí te dejo el código por las dudas:
 [/code]
Me hace lo mismo y tengo que relogear...
Asi funciona pero esta mal no?

Code: [Select]
if (
lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)

 {
 gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,"No puedes reparar items en este momento");
 return 0;
 }
}


Offline waltervg91 #11 Posteado: August 15, 2020, 05:37:54 PM | Modificado: August 15, 2020, 05:43:30 PM by waltervg91

Con eso quedas tal cual esta la configuración inicial donde no deja reparar en los NPC. acá te paso mi código completo de esa función a ver si te funciona:
Code: [Select]
int CItemManager::RepairItem(LPOBJ lpObj,CItem* lpItem,int slot,int type) // OK
{
if (lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(492));
return 0;
}
if(lpItem->m_Slot == 0xFF || INVENTORY_WEAR_RANGE(lpItem->m_Slot) == 0)
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(0,41)) // Minning Axe
{
return 0;
}

if(gItemStack.GetItemMaxStack(lpItem->m_Index) > 0)
{
return 0;
}

if(lpItem->m_Slot == 8 && lpItem->m_Index != GET_ITEM(13,4))
{
return 0;
}

if(lpItem->IsLuckyItem() != 0 || lpItem->m_IsPeriodicItem != 0 || lpItem->IsPentagramItem() != 0)
{
return 0;
}

//if(lpItem->m_Index == GET_ITEM(4,7) || lpItem->m_Index == GET_ITEM(4,15)) // Bolt,Arrow
//{
// return 0;
//}

if(lpItem->m_Index >= GET_ITEM(12,130) && lpItem->m_Index <= GET_ITEM(12,135)) // Mini Wings
{
return 0;
}

if(lpObj->Interface.type != INTERFACE_TRAINER && (lpItem->m_Index == GET_ITEM(13,4) || lpItem->m_Index == GET_ITEM(13,5)))
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(13,20) && (lpItem->m_Level >= 0 && lpItem->m_Level <= 2)) // Wizard's Ring,Starter Ring
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(13,10) || (lpItem->m_Index >= GET_ITEM(13,38) && lpItem->m_Index <= GET_ITEM(13,42)) || lpItem->m_Index == GET_ITEM(13,68) || lpItem->m_Index == GET_ITEM(13,76) || lpItem->m_Index == GET_ITEM(13,122)) // Rings
{
return 0;
}

int money = this->GetItemRepairMoney(lpItem,type);

money = ((money<0)?0:money);

if(lpObj->Money < ((DWORD)money))
{
return 0;
}

lpObj->Money -= money;

lpItem->Convert(lpItem->m_Index,lpItem->m_Option1,lpItem->m_Option2,lpItem->m_Option3,lpItem->m_NewOption,lpItem->m_SetOption,lpItem->m_JewelOfHarmonyOption,lpItem->m_ItemOptionEx,lpItem->m_SocketOption,lpItem->m_SocketOptionBonus);

lpItem->m_Durability = lpItem->m_BaseDurability;

if(INVENTORY_WEAR_RANGE(slot) != 0 && lpItem->CheckDurabilityState() != 0)
{
gObjectManager.CharacterCalcAttribute(lpObj->Index);
}

this->GCItemDurSend(lpObj->Index,slot,(BYTE)lpItem->m_Durability,0);

if(lpItem->m_Index == GET_ITEM(13,4))
{
GCPetItemInfoSend(lpObj->Index,1,0,slot,lpItem->m_PetItemLevel,lpItem->m_PetItemExp,(BYTE)lpItem->m_Durability);
}

if(lpItem->m_Index == GET_ITEM(13,5))
{
GCPetItemInfoSend(lpObj->Index,0,0,slot,lpItem->m_PetItemLevel,lpItem->m_PetItemExp,(BYTE)lpItem->m_Durability);
}

return lpObj->Money;
}

Gracias:


Offline SaintZeus #12 Posteado: August 15, 2020, 05:52:53 PM

Con eso quedas tal cual esta la configuración inicial donde no deja reparar en los NPC. acá te paso mi código completo de esa función a ver si te funciona:
Code: [Select]
int CItemManager::RepairItem(LPOBJ lpObj,CItem* lpItem,int slot,int type) // OK
{
if (lpObj->Interface.type == INTERFACE_TRADE||
lpObj->Interface.type == INTERFACE_WAREHOUSE||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_SHOP ||
lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP ||
//--
lpObj->Interface.type == INTERFACE_TRADE && lpObj->Interface.type == INTERFACE_WAREHOUSE && lpObj->Interface.type == INTERFACE_SHOP)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(492));
return 0;
}
if(lpItem->m_Slot == 0xFF || INVENTORY_WEAR_RANGE(lpItem->m_Slot) == 0)
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(0,41)) // Minning Axe
{
return 0;
}

if(gItemStack.GetItemMaxStack(lpItem->m_Index) > 0)
{
return 0;
}

if(lpItem->m_Slot == 8 && lpItem->m_Index != GET_ITEM(13,4))
{
return 0;
}

if(lpItem->IsLuckyItem() != 0 || lpItem->m_IsPeriodicItem != 0 || lpItem->IsPentagramItem() != 0)
{
return 0;
}

//if(lpItem->m_Index == GET_ITEM(4,7) || lpItem->m_Index == GET_ITEM(4,15)) // Bolt,Arrow
//{
// return 0;
//}

if(lpItem->m_Index >= GET_ITEM(12,130) && lpItem->m_Index <= GET_ITEM(12,135)) // Mini Wings
{
return 0;
}

if(lpObj->Interface.type != INTERFACE_TRAINER && (lpItem->m_Index == GET_ITEM(13,4) || lpItem->m_Index == GET_ITEM(13,5)))
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(13,20) && (lpItem->m_Level >= 0 && lpItem->m_Level <= 2)) // Wizard's Ring,Starter Ring
{
return 0;
}

if(lpItem->m_Index == GET_ITEM(13,10) || (lpItem->m_Index >= GET_ITEM(13,38) && lpItem->m_Index <= GET_ITEM(13,42)) || lpItem->m_Index == GET_ITEM(13,68) || lpItem->m_Index == GET_ITEM(13,76) || lpItem->m_Index == GET_ITEM(13,122)) // Rings
{
return 0;
}

int money = this->GetItemRepairMoney(lpItem,type);

money = ((money<0)?0:money);

if(lpObj->Money < ((DWORD)money))
{
return 0;
}

lpObj->Money -= money;

lpItem->Convert(lpItem->m_Index,lpItem->m_Option1,lpItem->m_Option2,lpItem->m_Option3,lpItem->m_NewOption,lpItem->m_SetOption,lpItem->m_JewelOfHarmonyOption,lpItem->m_ItemOptionEx,lpItem->m_SocketOption,lpItem->m_SocketOptionBonus);

lpItem->m_Durability = lpItem->m_BaseDurability;

if(INVENTORY_WEAR_RANGE(slot) != 0 && lpItem->CheckDurabilityState() != 0)
{
gObjectManager.CharacterCalcAttribute(lpObj->Index);
}

this->GCItemDurSend(lpObj->Index,slot,(BYTE)lpItem->m_Durability,0);

if(lpItem->m_Index == GET_ITEM(13,4))
{
GCPetItemInfoSend(lpObj->Index,1,0,slot,lpItem->m_PetItemLevel,lpItem->m_PetItemExp,(BYTE)lpItem->m_Durability);
}

if(lpItem->m_Index == GET_ITEM(13,5))
{
GCPetItemInfoSend(lpObj->Index,0,0,slot,lpItem->m_PetItemLevel,lpItem->m_PetItemExp,(BYTE)lpItem->m_Durability);
}

return lpObj->Money;
}
Ahora si, muchas gracias

Gracias:


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
3 Replies
2282 Views
Last post April 07, 2017, 06:14:48 PM
by AltairN17
6 Replies
2538 Views
Last post March 31, 2018, 08:18:47 PM
by osvaldo1811
8 Replies
2510 Views
Last post August 31, 2018, 08:29:14 PM
by robercar40
13 Replies
9893 Views
Last post August 05, 2026, 02:05:07 AM
by VadimashRS
3 Replies
2142 Views
Last post December 15, 2020, 11:51:06 AM
by StevenDX