[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Tie INT to spell success, etc...
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Tie INT to spell success, etc...

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Buck   USA  (23 posts)  [Biography] bio
Date Tue 20 Jul 2004 08:05 PM (UTC)
Message

This is my first post, so forgive me being a tad longwinded just this once, but I have to get this out of the way:
Nick, you are THE MAN!!

After a year of learning OLC thru various win-blows executables, I tried downloading every flavor of SMAUG source I could find, no, ALL of them. Not one would compile clean out of the box, and I needed that, because I was such a newb. But thanks to your INSANELY detailed idiot-proof instructions, I downloaded Cygwin and SMAUG 1.4aMXP and -poof- except for a simple error you accounted for right there in the faq, I was in business. I am new to UNIX and C, but thru reading documentation, help files and a lot of t & e, I am making minor code changes on my own, successfully. So thanks for getting me off to such a good start! Now on to my question.
I want to make intelligence affect the chance of a spell being cast successfully, beyond the current prarameters. What I have in mind is this: For benign spells, the chance should be affected by x-percent per stat point over or under a zero point, say 16. This would be added (I guess) to the index in const.c? For aggressive spells, a comparison would be made between the caster and victims' INT stats, with the difference being calculated as, say 5 percent per point, more or less - or zero. So if you could offer some details on how to go about this, I can tweak the numbers thru t&e, as I have already figured out how to alter the existing stat indeces and their reference to raise max stats successfully, but this goes into fight.c and magic.c apparently, and there's alot there to confuse a novice like me. Plus, I know, its adding a new parameter to int_app, etc... I'm running on WinXP and haven't encountered any problems I couldn't solve yet. The code is practically unmodded, just a few small tweaks here and there; color stuff, etc... Sorry again to be so wordy and thanks in advance for any help you can give.

-Buck.
tbgamecock@yahoo.com
"I am Homer of Borg. Prepare to be assim... ooooo, Doughnuts!"
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #1 on Wed 21 Jul 2004 03:14 AM (UTC)

Amended on Wed 21 Jul 2004 03:15 AM (UTC) by Nick Cash

Message
I know this is rather simple minded, but you could just add an if check in do_cast to add it like you planned. Its rather difficult to say where exactly to put it. Here's something simple to work off perhaps:


int percent, i;

for ( i = 0; i < ch->mod_int; i++ )
{
  percent += 5;

  if ( percent > 100 )
   percent = 100;
}

if ( number_range(1,100) > percent )
{
  send_to_char( "You begin the arcane gestures but mess up!\n\r", ch );
  return;
}

Again, thats really simplistic and is perhaps not what your looking for. Was just a thought. :)

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Buck   USA  (23 posts)  [Biography] bio
Date Reply #2 on Wed 21 Jul 2004 06:57 AM (UTC)

Amended on Mon 26 Jul 2004 02:53 PM (UTC) by Buck

Message
Well simplistic is fine with me, in fact, it shouldn't be much more than a couple if statements. What I want to do is this: When casting a non-offensive spell, an intelligence stat of, say, 16 would have no effect on the probability of success. 17 INT would increase the chance by, say, 5 percent, etc...; 15 INT would decrease it by five, etc... For an offensive spell, however, some manner of compare would need to subtract the victims' INT stat from the caster's, with that remainder (...-1, 0, 1, 2...) corresponding to a modifying factor of, say, 5 percent, e.g. I cast <some spell> at a pc/npc who has 17 INT; I have 19 INT, so 19 - 17 = 2 * 5% = a 10 percent increase in probability of success. I don't want to create an alternate outcome, just add a modifier to the existing logic stream that currently dictates success probability. Hope that makes sense :)

-Buck.
tbgamecock@yahoo.com
"I am Homer of Borg. Prepare to be assim... ooooo, Doughnuts!"
[Go to top] top

Posted by Buck   USA  (23 posts)  [Biography] bio
Date Reply #3 on Mon 26 Jul 2004 02:55 PM (UTC)
Message
Tryin' to keep this one alive :) Anyone?

-Buck.
tbgamecock@yahoo.com
"I am Homer of Borg. Prepare to be assim... ooooo, Doughnuts!"
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 27 Jul 2004 03:30 AM (UTC)
Message
I'm not really an expert on how SMAUG spells are coded, but what you want to do sounds simple enough. First you check if the spell is offensive, not sure how, and then compare the intelligence of the caster to the target. What part of this are you having problems with?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Buck   USA  (23 posts)  [Biography] bio
Date Reply #5 on Tue 27 Jul 2004 03:53 AM (UTC)
Message
Well, I'm not sure where to inject the conditions or exactly how to parse them. I've been toying w/ an executable Win version for a year or more, but I'm only a veteran of a month or so of coding the source. I'm hoping for a template I could use to modify other stats as well. I'm grateful for whatever help I can get :)

-Buck.
tbgamecock@yahoo.com
"I am Homer of Borg. Prepare to be assim... ooooo, Doughnuts!"
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,444 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]