Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Currency Items that can add up Max HP/MP


Ravey
 Share

Recommended Posts

Hello,

Okay so here comes an easy question, i want to add something to basic calculations, and that is where it would count with 'rare' items to add Max HP/MP

Here is the line…. you know..

GetPlayerMaxVital = (GetPlayerStat(index, Intelligence)) - 1

So i want it to count the number of certain currency items and add it up to the value... so simply said if one had 10 Intelligence, 4 Batteries, 7 Soul Stones and 2 Sparks, minus 1... that player would have 22 maximum MP.... i want to add them some individual multiply values as well, but i only demand to know the way how it can be done to check for the items.

I want only(?) 8 rare items to work with this, would it cause the game to be slow?

Thanks in advance.
Link to comment
Share on other sites

@RyokuHasu:

> That one word makes me not want to help.

Maybe English isn't his first language and he doesn't know how to use the word. It's posts like that that aren't helpful at all, seriously.
If you can't help him, don't even post. It's about helping them out, not criticizing their diction.
(I do apologize I'm being a bit hypocritical here because I have nothing to say to help his issue, but this bothered me tremendously)
Link to comment
Share on other sites

Oh, my apologies for that. And i do know how to use that word, I even checked it in a dictionary, i do not think it's so bad to say.

To make everyone sure, i will be very grateful, and i value your opinion about it… even though, as said above, you should not post here to criticise what i typed.

Anyhow, peace.
Link to comment
Share on other sites

Ok there might be a better way to do this than use currency items, you could make a new item type based on currency. Then make a new pannel on the Item editor that fills in the information you want. Then on the server side (in modPlayer) write out the new item type and its functions under sub use item.

to see how to add an Item type and write out its functions http://www.touchofdeathforums.com/smf/index.php/topic,64806.0.html

(this is not what you want, its just a refrence to show you how to add a new type of item)

At least this gives you direction of where to start.

hope this helps.
Link to comment
Share on other sites

Just a little question, wouldn't Sub UseItem do it when the item is used, eg. double clicked?

My custom idea is that, it would add up to a new "secret" stat that would be invisible to the users, and would be accounted for in the calculations in modCombat… but a question is... is there a way to count all items of the said type (reffering about the new item type) in player's inventory and get them into one value(new stat)? then it would be something like...

       ```
Case MP
            Select Case GetPlayerClass(index)
                Case 1
                    GetPlayerMaxVital = (GetPlayerStat(index, Intelligence)) + (GetPlayerStat(index, Charges) * 3)
```
Thank you for the idea, it is a better way to do it. Hoping to figure it out with the help of you all, I'm willing to learn.
Link to comment
Share on other sites

Ok…

Make some constants ( one for each item you make) and set them each as long

on the server in the sub GiveInvItem and sub TakeInvItem have it check for the ammount of each of your special items everytime you change somthing in your inventory , in those subs count up the amount of the items they have and set the constants to the total amounts.

Lastly add the constants to the Max Vital equations like you wanted to do.

TADA your calculations no "useItem" needed
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...