Home

[Package Index | Mudlib Index | Effect Index]

File /std/basic/enchant.c

Module to handle the amount of magical charge (enchantment) of an object has. The maximum enchantment of an item is determined by by its weight - the material of composition is not yet taken into account.

Enchanting an object will add to its value, and, if the object is an item of armour, will improve its armour class.

Written by Pinkfish

Method index

Public Functions

These are functions that everyone can access.

.

    enchant_string
    string enchant_string()
    

    This method returns the current enchantment string for the object. The string is created from the percentage of the max enchantment that it is enchanted to. If the object is also a talisman, an identifying string is appended to the enchantment message.

    These messages are only visible to creators and players who can see octarine.

    If the property "octarine_mess" is set, then this will be printed instead of the automatically generated enchantment message.

    If the property "talisman_mess" is set, then this will be printed instead of the automatically generated talisman message if appropriate.

    • Returns:
      the enchantment string and talisman string
    • See also:
      set_enchant(), add_enchant(), query_max_enchant() and query_enchant()
        query_degrade_enchant
        int query_degrade_enchant()
        

        This method returns the maximum enchantment before the enchantment starts to degrade.
        • Returns:
          the enchantment level which enchantment degrades to
            query_enchant
            int query_enchant()
            

            This method queries the current enchantment level.
            • Parameters:
              number - the new enchantment level
            • See also:
              enchant_string(), set_enchant(), query_max_enchant() and add_enchant()
                query_enchant_set_time
                int query_enchant_set_time()
                

                This method returns the time the time the enchantment was set.
                • Returns:
                  the time the enchantment was set
                    query_max_enchant
                    int query_max_enchant()
                    

                    This method returns the maximum possible enchantment for the object. This is based on its weight.
                    • Returns:
                      the maximum enchantment
                        query_real_enchant
                        int query_real_enchant()
                        

                        This method returns the actual enchant of the object.
                        • Returns:
                          the actual enchant value
                            set_degrade_enchant
                            void set_degrade_enchant(int enchant)
                            

                            This method sets the enchantment at which things start to degrade.
                            • Parameters:
                              enchant - the enchantment level to set it at
                                set_enchant
                                void set_enchant(int number)
                                

                                This method sets the current enchantment level. If it is greator than the max enchantment level then it will be set to the maximum enchantment level.
Valid HTML 4.01 Transitional
Valid CSS!
Read More