Jump to content

Infinite Arrows


Recommended Posts

char_battle.cpp: In member function 'void CHARACTER::UseArrow(CItem*, DWORD)':
char_battle.cpp:2836: error: 'iCount' was not declared in this scope
gmake: *** [OBJDIR/char_battle.o] Error 1

 

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
    iCount = iCount - MIN(iCount, dwArrowCount);
    if (pkArrow->GetVnum() != 88005)
        pkArrow->SetCount(iCount);

        DWORD dwVnum = pkArrow->GetVnum();
    
    int iCount = pkArrow->GetCount();

    if (iCount == 0)
    {
        LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

        sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

        if (pkNewArrow)
            EquipItem(pkNewArrow);
    }
}

Edited by Haya
Link to comment
Share on other sites

char_battle.cpp: In member function 'void CHARACTER::UseArrow(CItem*, DWORD)':
char_battle.cpp:2836: error: 'iCount' was not declared in this scope
gmake: *** [OBJDIR/char_battle.o] Error 1

 

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
    iCount = iCount - MIN(iCount, dwArrowCount);
    if (pkArrow->GetVnum() != 88005)
        pkArrow->SetCount(iCount);

        DWORD dwVnum = pkArrow->GetVnum();
    
    int iCount = pkArrow->GetCount();

    if (iCount == 0)
    {
        LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

        sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

        if (pkNewArrow)
            EquipItem(pkNewArrow);
    }
}


 



 

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
  int iCount = pkArrow->GetCount();
	iCount = iCount - MIN(iCount, dwArrowCount);
  if (pkArrow->GetVnum() != 79503)
    pkArrow->SetCount(iCount);
  
	DWORD dwVnum = pkArrow->GetVnum();

	if (iCount == 0)
	{
		LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

		sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

		if (pkNewArrow)
			EquipItem(pkNewArrow);
	}
}

 

Edited by Rideas
  • Love 1
Link to comment
Share on other sites

@Rideas your function will forever try to re-equip new arrows each time an arrow is shot, provided only one arrow of type 79503 is equipped.

If you want to prevent vnum 79503 from reducing arrows, you are better off with an if(...) return; at the very beginning.

But in this way it does not cause problems .

 

Link to comment
Share on other sites

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
  int iCount = pkArrow->GetCount();
	iCount = iCount - MIN(iCount, dwArrowCount);
  if (pkArrow->GetVnum() != 79503)
    pkArrow->SetCount(iCount);
  
	DWORD dwVnum = pkArrow->GetVnum();

	if (iCount == 0)
	{
		LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

		sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

		if (pkNewArrow)
			EquipItem(pkNewArrow);
	}
}

 

It's work, possible partie client (root and item_proto server and client)

 

thank you

 

  • Love 1
Link to comment
Share on other sites

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
  int iCount = pkArrow->GetCount();
	iCount = iCount - MIN(iCount, dwArrowCount);
  if (pkArrow->GetVnum() != 79503)
    pkArrow->SetCount(iCount);
  
	DWORD dwVnum = pkArrow->GetVnum();

	if (iCount == 0)
	{
		LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

		sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

		if (pkNewArrow)
			EquipItem(pkNewArrow);
	}
}

 

It's work, possible partie client (root and item_proto server and client)

 

thank you

void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{
  int iCount = pkArrow->GetCount();
	iCount = iCount - MIN(iCount, dwArrowCount);
  if (pkArrow->GetVnum() != 79503)
    pkArrow->SetCount(iCount);
  
	DWORD dwVnum = pkArrow->GetVnum();

	if (iCount == 0)
	{
		LPITEM pkNewArrow = FindSpecifyItem(dwVnum);

		sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow));

		if (pkNewArrow)
			EquipItem(pkNewArrow);
	}
}

 

It's work, possible partie client (root and item_proto server and client)

 

thank you

 

No problem bro ;)

Edited by Rideas
  • Love 1
Link to comment
Share on other sites

  • 2 months later...

uitooltip

 

""""""
#1) Search: if item.ITEM_TYPE_WEAPON == itemType:
#2) Delete their declaration and paste:
        if item.ITEM_TYPE_WEAPON == itemType:
            self.__AppendLimitInformation()
            self.AppendSpace(5)
            if item.WEAPON_FAN == itemSubType:
                self.__AppendMagicAttackInfo()
                self.__AppendAttackPowerInfo()
            else:
                self.__AppendAttackPowerInfo()
                self.__AppendMagicAttackInfo()
            
            self.__AppendAffectInformation()
            self.__AppendAttributeInformation(attrSlot)
            
            self.AppendWearableInformation()
            if itemSubType != item.WEAPON_UNLIMITED_ARROW:
                self.__AppendMetinSlotInfo(metinSlot)
            else:
                bHasRealtimeFlag = 0
                for i in xrange(item.LIMIT_MAX_NUM):
                    (limitType, limitValue) = item.GetLimit(i)
                    if item.LIMIT_REAL_TIME == limitType:
                        bHasRealtimeFlag = 1
                
                if bHasRealtimeFlag == 1:
                    self.AppendMallItemLastTime(metinSlot[0])
""""""

this is not working here is my syserr:

1026 13:18:17932 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:23) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiAffectShower.py(line:8) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 891)

1026 13:18:17933 :: ============================================================================================================
1026 13:18:17933 :: Abort!!!!

 

Link to comment
Share on other sites

uitooltip

 

""""""
#1) Search: if item.ITEM_TYPE_WEAPON == itemType:
#2) Delete their declaration and paste:
        if item.ITEM_TYPE_WEAPON == itemType:
            self.__AppendLimitInformation()
            self.AppendSpace(5)
            if item.WEAPON_FAN == itemSubType:
                self.__AppendMagicAttackInfo()
                self.__AppendAttackPowerInfo()
            else:
                self.__AppendAttackPowerInfo()
                self.__AppendMagicAttackInfo()
            
            self.__AppendAffectInformation()
            self.__AppendAttributeInformation(attrSlot)
            
            self.AppendWearableInformation()
            if itemSubType != item.WEAPON_UNLIMITED_ARROW:
                self.__AppendMetinSlotInfo(metinSlot)
            else:
                bHasRealtimeFlag = 0
                for i in xrange(item.LIMIT_MAX_NUM):
                    (limitType, limitValue) = item.GetLimit(i)
                    if item.LIMIT_REAL_TIME == limitType:
                        bHasRealtimeFlag = 1
                
                if bHasRealtimeFlag == 1:
                    self.AppendMallItemLastTime(metinSlot[0])
""""""

this is not working here is my syserr:

1026 13:18:17932 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:23) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiAffectShower.py(line:8) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 891)

1026 13:18:17933 :: ============================================================================================================
1026 13:18:17933 :: Abort!!!!

 

How the fuck u can say don't working?

If u don't know to add some TAB's that don't mean don't work.

 

Read the eror: 

unindent does not match any outer indentation level (line 891)

U are blind ? TAB, tab missing.

The syserr say's clear unident line...

If u dont know what is a TAB here you go  https://en.wikipedia.org/wiki/Indent_style

 

Link to comment
Share on other sites

uitooltip

 

""""""
#1) Search: if item.ITEM_TYPE_WEAPON == itemType:
#2) Delete their declaration and paste:
        if item.ITEM_TYPE_WEAPON == itemType:
            self.__AppendLimitInformation()
            self.AppendSpace(5)
            if item.WEAPON_FAN == itemSubType:
                self.__AppendMagicAttackInfo()
                self.__AppendAttackPowerInfo()
            else:
                self.__AppendAttackPowerInfo()
                self.__AppendMagicAttackInfo()
            
            self.__AppendAffectInformation()
            self.__AppendAttributeInformation(attrSlot)
            
            self.AppendWearableInformation()
            if itemSubType != item.WEAPON_UNLIMITED_ARROW:
                self.__AppendMetinSlotInfo(metinSlot)
            else:
                bHasRealtimeFlag = 0
                for i in xrange(item.LIMIT_MAX_NUM):
                    (limitType, limitValue) = item.GetLimit(i)
                    if item.LIMIT_REAL_TIME == limitType:
                        bHasRealtimeFlag = 1
                
                if bHasRealtimeFlag == 1:
                    self.AppendMallItemLastTime(metinSlot[0])
""""""

this is not working here is my syserr:

1026 13:18:17932 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:23) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiAffectShower.py(line:8) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 891)

1026 13:18:17933 :: ============================================================================================================
1026 13:18:17933 :: Abort!!!!

 

How the fuck u can say don't working?

If u don't know to add some TAB's that don't mean don't work.

 

Read the eror: 

unindent does not match any outer indentation level (line 891)

U are blind ? TAB, tab missing.

The syserr say's clear unident line...

If u dont know what is a TAB here you go  https://en.wikipedia.org/wiki/Indent_style

 

Hey im not a pro i just started learning... Thanks anw but i got it covered

Link to comment
Share on other sites

  • 5 weeks later...

Announcements



×
×
  • 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.