Problem with skills that consume items

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Problem with skills that consume items

Post by XavierElf »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 3472
L2JDP Revision Number:6575

Is it normal that skills use items at the end of cast, like scrolls of escape, major heal and etc? :shock:
I think it should be like:
Updated:
L2Character.java

Code: Select all

 private void beginCast(L2Skill skill, boolean simultaneously)	{		...		if (effectWhileCasting)		{		...		}		else		{[color=#0000BF]+		// Consume Items if necessary and Send the Server->Client packet InventoryUpdate with Item modification to all the L2Character[/color][color=#0000BF]+		if (skill.getItemConsume() > 0)[/color][color=#0000BF]+		{[/color][color=#0000BF]+			if (!destroyItemByItemId("Consume", skill.getItemConsumeId(), skill.getItemConsume(), null, false))[/color][color=#0000BF]+			{[/color][color=#0000BF]+				sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));[/color][color=#0000BF]+                       if (simultaneously)[/color][color=#0000BF]+                            setIsCastingSimultaneouslyNow(false);[/color][color=#0000BF]+                       else[/color][color=#0000BF]+                            setIsCastingNow(false);[/color][color=#0000BF]+                        if (this instanceof L2PcInstance)[/color][color=#0000BF]+                            getAI().setIntention(AI_INTENTION_ACTIVE);[/color][color=#0000BF]+				return;[/color][color=#0000BF]+			}[/color][color=#0000BF]+			}[/color]		}		...	}...public void onMagicHitTimer(L2Object[] targets, L2Skill skill, int coolTime, boolean instant, boolean simultaneously)	{		...[color=#FF0000]-			// Consume Items if necessary and Send the Server->Client packet InventoryUpdate with Item modification to all the L2Character[/color][color=#FF0000]-				if (skill.getItemConsume() > 0)[/color][color=#FF0000]-			{[/color][color=#FF0000]-				if (!destroyItemByItemId("Consume", skill.getItemConsumeId(), skill.getItemConsume(), null, false))[/color][color=#FF0000]-				{[/color][color=#FF0000]-					sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));[/color][color=#FF0000]-					abortCast();[/color][color=#FF0000]-					return;[/color][color=#FF0000]-				}[/color][color=#FF0000]-			}[/color]		...	} 
Last edited by XavierElf on Tue Sep 08, 2009 10:50 pm, edited 1 time in total.
Sry for my bad english...
User avatar
XavierElf
Posts: 92
Joined: Wed May 14, 2008 3:39 am
Location: Russia

Re: Problem with skills that consume items

Post by XavierElf »

Also fix on DP side to prevent spamming items like SoE, SoR, etc.
ItemSkills.java

Code: Select all

[color=#0000BF]+					if (!playable.isCastingNow()) {[/color]						playable.stopMove(null);						playable.doCast(itemSkill);[color=#0000BF]+					} else {[/color][color=#0000BF]+						playable.sendPacket(ActionFailed.STATIC_PACKET);[/color][color=#0000BF]+						return;[/color][color=#0000BF]+					}[/color] 
Sry for my bad english...
toastgodsupreme
Posts: 750
Joined: Sun Dec 07, 2008 7:01 pm
Location: Poland

Re: Problem with skills that consume items

Post by toastgodsupreme »

This may explain the bottle of souls glitch (not sure if on the l2jdp it's been moved back to the potions handler but if you don't have enough souls and you try to create an empty bottle it glitches, so i've moved mine back into potions handler and run the check for enough souls before usage).
Post Reply