• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Material system

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
One of my planned final fantasy systems. I also might make a role shift system like in ff13

Based on the system from final fantasy 12, This system allows you to add rewards for selling items. In the maps example: If you sell 2 adamants, and 2 diamonds, the shop I placed now has 1 light orb availible.

Registering items is easy, just call the following function:
function AddMaterial takes integer matA, integer matB, integer rwrd , integer NeededA, integer NeededB, unit shop returns nothing

matA is your first material's rawcode
matB is your second material rawcode
rwrd is the resulting items rawcode
NeededA is the amount of material A's that need to be sold
NeededB is the amounf of material B's that need to be sold
unit shop is the specific shop the reward is added to. Please note that if you want an item to appear at multiple shops, you have to call the function for each shop..

I did not add a way to remove item registries

Please excuse the screenshot, I couldn't find a relevant picture, and was too lazy to make a screenshot

Keywords:
Final, fantasy, 12, material, system, items, rewards, simple, rpg
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 13:41, 21st Mar 2010 TriggerHappy: Indent your code. Remove debug messages. Store the native calls you make so much into locals to reduce calls. Furthermore, don't use an O(n)...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

13:41, 21st Mar 2010
TriggerHappy:

Indent your code.
Remove debug messages.
Store the native calls you make so much into locals to reduce calls.
Furthermore, don't use an O(n) search.
 
Two things:

1) The use of this is very limited, as the system is not multi-player instancable. All players use the same counters and are able to buy the newly added item even if they never sold anything to the shop.

2) The script is very basic. An average coder could write something like this in a few minutes. But well ... as this is the spells section and there are also other minor things in here, I think its alright.
 
Two things:

1) The use of this is very limited, as the system is not multi-player instancable. All players use the same counters and are able to buy the newly added item even if they never sold anything to the shop.

2) The script is very basic. An average coder could write something like this in a few minutes. But well ... as this is the spells section and there are also other minor things in here, I think its alright.

yeah
 
Top