[RESOLVED]Items that only certain characters can use(not equipments)

Started by Spoofus, November 21, 2008, 08:39:32 am

Previous topic - Next topic

Spoofus

hey yall, i have a question that may involve a script here so i post in the area(move if needed)

ok i was thinking for when Blizz-ABS 2.0 gets done i know i was going to use pets for my game..
so i was curious if there is a way to have items that raise stats like say foods you would feed the pet..
cause i was thinking of not having pets level up instead you use items to raise their stats and the same for the pet skills too...but for skills have different items specified for the pets and one for the hero,etc. that teaches them skills/spells

i mean i know you make the item in the database  :haha: but if you do it that way as far as i know all the characters
are able to use them.



My Blog site I am working on: http://spoofus.weebly.com/

winkio

I think this could be more easily done by linking each of these items to a common event.  Then, you can simply detect which actor you are using it on and handle appropriately.

Spoofus

i thought of that but im horrible with event scripting....i tend to mess them up somewhere and cant figure out where i went wrong..but i may try my hand at it


My Blog site I am working on: http://spoofus.weebly.com/

Fantasist

Spoiler: ShowHide
#==============================================================================
# ** Actor-specific Item Usability
#------------------------------------------------------------------------------
# by Fantasist
# Version 1.0
# 21-Nov-2008
#------------------------------------------------------------------------------
# Version History:
#
#   v1.0 - First release
#------------------------------------------------------------------------------
# Description:
#
#     This scriptlet enables you to define which items can't be used by each
#   actor. For example, actor ID 4 (who maybe a robot) cannot use "Potion".
#   Similarly, actor ID 1 (Arshes) cannot use "Recharge Cell".
#------------------------------------------------------------------------------
# Compatibility:
#
#    - Should be compatible with most scripts.
#------------------------------------------------------------------------------
# Instructions:
#
#   Place this below "Scene_Debug" and above "Main"
#------------------------------------------------------------------------------
# Configuration:
#
#     Scroll down and you'll find the configuration.
#
#   The main syntax is:
#
#     when ACTOR_ID then [IDs of all items which this actor CAN'T use]
#
#   Examples:
#
#     when 1 then [1, 2] # Arshes can't use "Potion" and "High Potion".
#
#     when 7 then [10, 11, 12] # Gloria can't use "Full Tonic", "Antidote" and
#                              # "Dispell Herb".
#
#   NOTE: For all actors without a configuration, items are usable by default.
#         So if Basil can use all items, then you don't need to configure for
#         ID 2.
#------------------------------------------------------------------------------
# Issues:
#
#     None that I know of.
#------------------------------------------------------------------------------
# Credits and Thanks:
#
#   Credits: Fantasist, for making this
#   Thanks: Spoofus, for requesting this
#------------------------------------------------------------------------------
# Notes:
#
#   If you have any problems or suggestions, you can find me at:
#
#    - www.chaos-project.com
#    - www.quantumcore.forumotion.com
#
#   Enjoy ^_^
#============================================================================

#==============================================================================
# * Game_Actor
#==============================================================================

class Game_Actor
 
  def item_cant_use?(item_id)
    usable_item_ids = case id
    #==========================================================================
    # * CONFIG BEGIN
    #==========================================================================
    when 1 then [1]
    when 2 then [2]
    # when ACTOR_ID then [IDs of all items which this actor CAN'T use]
    #==========================================================================
    # * CONFIG END
    #==========================================================================
    else return true
    end
    return !usable_item_ids.include?(item_id)
  end
 
  def item_effect(item)
    return false if item_cant_use?(item.id)
    super
  end
 
end
<3

I'll request Bliz to add this to Tons.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Spoofus

whaaaaaatcha your te man Fantasist

it is so simple it is amazing *powers up*
nice work as always  :-* (yes i am blowing kisses to you lol)


My Blog site I am working on: http://spoofus.weebly.com/

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Spoofus

lol did i just get powered up for blowing a kiss to you fantasist? if so i should do it more often :haha:
(im not gay btw) :haha:


My Blog site I am working on: http://spoofus.weebly.com/

Fantasist

Quotelol did i just get powered up for blowing a kiss to you fantasist?

I'm not gay either >_<
Well, you're good at spriting and I just saw that you didn't have energy, so I powered you up. Besides, you're a nice guy and I still haven't done that CMS you requested >.<
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Spoofus

lol thats fine on the CMS to be honest i forgot bout it till you just said that lol......and thanks for teh compleiments  :)
your a really nice guy to and i do like alot of your work


My Blog site I am working on: http://spoofus.weebly.com/

Fantasist

Quotelol thats fine on the CMS to be honest i forgot bout it till you just said that lol

That's a relief... but I'll still do it, I just don't know when.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Spoofus

eh like i said when you took it up im not in a hurry for it..if you want to do you can i guess if not dont worry bout it :)


My Blog site I am working on: http://spoofus.weebly.com/

Fantasist

Thanks, got it :D

...can I nag you about the resolved tag or is there anything else you need? (old mod habits... hard to get over them -_-)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Spoofus

nerp you helped me out faster than i thought on  this subject :) so guess it should be resolved then eh :haha:


My Blog site I am working on: http://spoofus.weebly.com/