RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Spellcrafting version 2.3

X

Xanthos

Guest
That article seemed to validate my thinking on exeptions. I don't anticipate those exceptions firing at a rate of more than a couple a minute. Thats not a performance sensitive code path, it lead to a cleaner design and simpler code - bottlenecked all of the checking of results and reporting of exceptional conditions in one place. In this case I can guarantee you will not see any performance hit. I am not parameter checking with them. I used them in this case to end the processing once i had determined that the user had tried to do something that was inappropriate. At that point I dont want to muck up the code with lots of checking on the way back up the stack. I just want to jump to where the processing started and tell them what went wrong

Using Exceptions to iterate on the list of crafts - now that would be abusive! Using them to control general program flow would also be abusive. Using them to say "whoa we've gotten a few levels down the stack only to realize we should not have come here at all" - thats apropriate.

Many people share your view on exceptions - that they should only be used in extreme situation. That's just one of those debates that has been going on for that last 20 years.
 
X

Xanthos

Guest
I sense this turning into something more than a discussion of spellcrafting. PM me if you would like to know more about my background.

And now, back to the topic at hand...
 

Xeraz

Wanderer
Nombot2005 said:
im new to this craftables and i was wondering how do you install it?



Simply unzip every thing in your Custom script folder. No base script edits needed. U may add ingame spawner with GuardianOfTheMagics or the SpellcraftVendor as u wish.
 

Marak

Sorceror
Ive got a question we wanted to set it up so that players needed to have (Blacksmithing, Tinkering, Tailoring, Mage, Inscription, Eval Intelligence) at GM before they can use it - and once they reach it say 25% chace at 100 and 75% at 120 of success - now im no great shakes at scripting - actually couldnt script outta a wet paper bag - but if you can give me some hints ill have a crack at it :)
- Toxic
 
X

Xanthos

Guest
The chance for sucess is based purely on a roll of the dice and compared against kExplodeChance and kDestroyChance. This is done in the UseMagicJewels method.

The code uses the alchemy and inscription skill levels to determine the maximum property intensities that could be acheived by the crafter. The actual intensity is a random roll of the dice between this value and the minimum intenstiy for that property.

If you change the ComputeSkillScalar method to take the other skills into account, the property intensities will automagically be calculated based on the additional skills. You could then call this same method in UseMagicJewels to determine the success chance instead of relying on the kExplodeChance and kDestroyChance constants.

The code is fairly well factored to accomodate changes like this so it should be pretty straight forward to do what you want.
 

Marak

Sorceror
1/2 way there hit error

Hmm as i know bugger all about C#(or any programing language lol - im learning as i go here) ive come across an error im having trouble figureing out.

Thats the Line i modded \/
int skillValue = (int)(from.Skills[SkillName.Inscribe].Value + from.Skills[SkillName.Alchemy].Value + from.Skills[SkillName.Tinkering].Value + from.Skills[SkillName.Blacksmith].Value + from.Skills[SkillName.Tailoring].Value + from.Skills[SkillName.Magery].Value + from.Skills[SkillName.Carpentry]);

return (int)( (skillValue > 840 ? 840 : skillValue) / 84.0 );


and i get this error(which will probably be a really easy one to fix lol.

- Error: Scripts\....\spellcraft_7Skill.cs
: CS0019: <line 432, column 27> Operator '+' cannot be applied to operands of type 'double' and 'server.skill'.

Well i figure that means i cannot use +(go my powers of deduction!), so whats the best(or any) way to get around that? can i add 2 skills up at a time then combine the answers(2 at a time) - there has to be a better way than that lol - plus knowing me id still bugger it up... *sigh* id give somebody else's left leg to be able todo this lol.
 

Marak

Sorceror
Xanthos said:
You left out .Value on the last skill.

Well i feel quite stupid now dont i lol. Ok thats all working! sweet - now next question - did a bit of testing(and changed the break/fail chance's a bit) now how would i go about setting it so that they can only use spellcrafting when they have gained at least 100 in ALL 7 skills?(we use a 1400 skillcap so thats not a problem).
Btw thnx for your help mate :D

:Edit - At the moment its seems like you can spellcraft even if you have no skills whatsoever but your failure chance is a bit higher... grr! really gotta learn this quickly*
 
X

Xanthos

Guest
You could do a skill check in SpellCraftBookGump.cs just before the following line:

Code:
from.SendMessage( "Select the item to place this spellcraft on." );
I think I will put such a check in the next release. Thanks for the idea :)
 

Marak

Sorceror
Not a problem mate its the only way im going to learn atm is by modding other ppl's files :) and asking lots and lots of really stupid questions lol. Any word on when the next release will be it might be better for me(and the shard) if i wait for it lol. Now to go and look for a script with skill lookup so i can borrow the line from that lol - thnx for all your help mate.
 

Highlander

Wanderer
I just spellcrafted a weapon with:

- Damage increase 25%
- Hit Fireball 32%
- Hit Lighting 16%
- HitColdArea 40%


I have never seen a weapon with two Hit spell atributes (Magic arrow, harm, Fireball, Lighting) is that correct¿?

With a valorite Runic Hammer I just made 25 weapons a none got two of those atributes, maybe weapons should only have one Hit spell atribute.

PD: Two hit spell atributes is way imba.
 
X

Xanthos

Guest
Yes, you certainly can do un-natural things with spellcrafting *shudders* - as long as you are over the age of 18 its ok =) While one could place checks in the code to prevent such things, I think it is the spirit of spellcrafting to allow one to be creative in adding properties to items. With the runic system it's a total crap shoot. The checks would also add some overhead and complexity to the code which is already fairly complex.

I would solve this in another way. I would either increase the number of magic jewels required to spellcraft or increase the failure rate or both. If it is more costly and risky to use spellcrafting you will see people being more conservative with their use of it.

BTW, I am thinking of allowing admins indepent control over the number of magic jewels required for each craft. Then you could make things like the hit spell attributes cost more. I just dont know how to display this to the user...
 

Protius73

Sorceror
I love this system too. The mods you made are quite nice.


I was thinking though... rather then being in a book... how bout a tool that you dbl click and u get a Gump kinda like the tinkering menu.

That way you can make a tool that is use based( boosts economy). Gives you a larger menu to work in things like requirements for each spellcraft jewel. Like resources and what not... Im also thinking perhaps spellcraft should use up mana as well. This would make sense considering the crafters are basically enchanting the items. This would also open up a new set of requirements in that certain spellcrafts would require more mana then others.


Thats just my two cents. Im not a scripting god. But im learning=)
 

Marak

Sorceror
Protius73 said:
Ihow bout a tool that you dbl click and u get a Gump kinda like the tinkering menu.

That way you can make a tool that is use based( boosts economy).

Argh dont say that lol - i just finished setting the price on the vendor (100k for each book jewel - 500k for a blank book - 1k for each jewel and you have to be 7xGM to use it at all - that should take them a while but definatly be worth it when their finished...)
 
X

Xanthos

Guest
The tool idea has merit since it would make the user interface issues simpler. However, I like the idea of a book since it seems more in line with the RP aspects of this ancient craft of magics. From what I have seen, spellcrafting can be a significant boost to the economy of a shard. It's time consuming to fill a book and collect magic jewels and many will gladly pay well for these items.

Maybe I can do a mouse over property on the crafts in a book to show the jewel requirements.

I was also thinking of adding a property to the finished item that would give credit to the crafter. Something like "Enchanted by YourNameHere". Any thoughts on this?

BTW, has anyone caught on to my little candle trick? :)
 
Top