Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

In this guide, we will demonstrate how to modify the arrow usage functionality to create "permanent arrows" within your game. This adjustment will ensure that arrows do not get consumed after use and will allow for a new type of interaction with arrow items.

Modifications to Apply

1. Update char_battle.cpp

Start by accessing the char_battle.cpp file and locate the following function:

 
This is the hidden content, please

2. Implement the Revised Function

Next, you will need to rewrite the UseArrow function to properly handle arrow usage. Your updated function should look like this:

 
This is the hidden content, please

Explanation of Changes

In the revised version of the UseArrow method, we maintain the original functionality to retrieve the arrow count and its virtual number (Vnum). However, we introduce the logic to adjust the arrow count without permanently decreasing it, allowing for the concept of "permanent arrows." This is accomplished by retrieving another arrow of the same type if the count of the currently used arrow reaches zero.

 

With this implementation, arrows used in your game will no longer be consumed permanently, allowing players to enjoy a more flexible gameplay experience. Be sure to test the changes thoroughly to ensure they function as intended within the context of your game's mechanics.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...