PDA

View Full Version : |Suporte| não autobuff em offlevel



Odisk
23/03/2020, 04:13 PM
oi pessoal eu tenho um problema com o autobuff em offlevel por exemplo

Deixo em um local e devo consumir a mana que está fora do nível

Aqui está um exemplo com o mestre das almas

Eu já modifiquei o código de todas as formas e nada

Eles são os SRCs do Exteam.

se alguém puder me ajudar a corrigi-lo, estou aprendendo processo ..


Code:



//=====================================
// Dark Wizard Offline Experience
//=====================================
void cOffExp::DarkWizardOff(LPOBJ lpObj)
{
int SearchSkill = 0;
CMagicInf * lpMagic;

if(gObjGetMagicSearch( lpObj, 9) != NULL) SearchSkill = 9;
else if(gObjGetMagicSearch( lpObj, 445) != NULL) SearchSkill = 445;
else if(gObjGetMagicSearch( lpObj, 446) != NULL) SearchSkill = 446;
else if(gObjGetMagicSearch( lpObj, 447) != NULL) SearchSkill = 447;
else if(gObjGetMagicSearch( lpObj, 448) != NULL) SearchSkill = 448;
else if(gObjGetMagicSearch( lpObj, 449) != NULL) SearchSkill = 449;
else return;

lpMagic = gObjGetMagicSearch( lpObj, SearchSkill);
if(lpMagic==NULL) return;

gObjUseSkill.UseSkill(lpObj->m_Index, lpMagic,lpObj->X, lpObj->Y,0,0,-1);

int dis;
int tObjNum;
BYTE attr;
for (int n=0;n<MAX_VIEWPORT_MONSTER;n++)
{
tObjNum = lpObj->VpPlayer2[n].number;
if(lpObj->VpPlayer2[n].state == 0) continue;
if ( tObjNum >= 0 )
{
if ( gObj[tObjNum].Type == OBJ_MONSTER )
{
attr = MapC[gObj[tObjNum].MapNumber].GetAttr(gObj[tObjNum].X, gObj[tObjNum].Y);
if ( (attr&1) != 1 )
{
dis = gObjCalDistance(lpObj, &gObj[tObjNum]);
if(6 >= dis)
{
gObjAttack(lpObj, &gObj[tObjNum], lpMagic, FALSE, 1, 0, FALSE,0,0);
}
}
}
}
}

this->UseMana(lpObj->m_Index);
}


código para o qual o mana autobuff funciona.




void cOffExp::UseMana(int aIndex)
{
LPOBJ lpObj = &gObj[aIndex];

if(lpObj->Mana > 100) return;

int pos;

pos = gObjGetManaItemPos(aIndex);

if(pos == -1) return;

if( lpObj->pInventory[pos].m_Type == ITEMGET(14,4) ||
lpObj->pInventory[pos].m_Type == ITEMGET(14,5) ||
lpObj->pInventory[pos].m_Type == ITEMGET(14,6) )
{
int tMana = (lpObj->pInventory[pos].m_Value*10) - (gObj[aIndex].Level);

if ( tMana < 0 )
{
tMana=0;
}

switch ( lpObj->pInventory[pos].m_Type )
{
case ITEMGET(14,4):
tMana += ((int)(gObj[aIndex].MaxMana + gObj[aIndex].AddMana))*20/100;
break;
case ITEMGET(14,5):
tMana += ((int)(gObj[aIndex].MaxMana + gObj[aIndex].AddMana))*30/100;
break;
case ITEMGET(14,6):
tMana += ((int)(gObj[aIndex].MaxMana + gObj[aIndex].AddMana))*40/100;
break;
}

gObj[aIndex].Mana += tMana;

if ( gObj[aIndex].Mana > (gObj[aIndex].MaxMana+gObj[aIndex].AddMana-1.0f) )
{
gObj[aIndex].Mana = gObj[aIndex].MaxMana+gObj[aIndex].AddMana;
}

GCManaSend(aIndex, (int)gObj[aIndex].Mana, 0xFF, 0, (int)gObj[aIndex].BP);

if ( !gObjSearchItemMinus(&gObj[aIndex], pos, 1) )
{
gObjInventoryItemSet(aIndex, pos, -1);
gObj[aIndex].pInventory[pos].Clear();
GCInventoryItemDeleteSend(aIndex, pos, 1);
}
}
}

3 Dias 7 Horas:------- Atualizado -------

helppppppppp meeeeeeeeeeeeeeeeeeeeeeeeeee