Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 04-27-2009, 04:40 PM   #1
UnKnOwN
New Member
 
Join Date: Nov 2002
Posts: 3
UnKnOwN is on a distinguished road
need help with a broken function

i spent many hours trying to get this to work but i cant get it to work for some reason.
It is for a godwars dystopia mud. I'm trying to get the samurai's swordtech fury attack to deal a certain amount of damage per hit, but no matter what i do, it still does the same damage.

in class_samurai.c
heres a snipplet of the swordtech fury code
and in fight.c, i defined the damage modifier
as you can see i tried to set the damage to be anywhere from 2500-5000 per hit, but even if i put 9999 or w/e, it still only does like 1k damage or less. i also tried adding the damage modifier right after the fury code, but it doesnt do anything.
UnKnOwN is offline   Reply With Quote
Old 04-27-2009, 06:39 PM   #2
Newworlds
Legend
 
Join Date: Aug 2007
Name: NewWorlds
Home MUD: New Worlds
Posts: 1,425
Newworlds will become famous soon enoughNewworlds will become famous soon enough
Re: need help with a broken function

I'm doubting many can help you with this jumble of code (many imbedded functions significant only to God Wars), but there is the creator of God Wars on here and his name is Kavir. You might try Pming him for some help.




My best guess is that you have a structured damage range that isn't modifiable OR this snippet:
if (dt == gsn_sfury && IS_CLASS(ch, CLASS_HIGHLANDER))
dam = number_range(2500,5000);
is false, thereby reverting to the structured damage range. Try debugging to ensure that your dam variable is used (a good trick is to remove the qualifier).
Newworlds is offline   Reply With Quote
Old 04-27-2009, 08:07 PM   #3
Mabus
Member
 
Join Date: Jan 2006
Posts: 213
Mabus is on a distinguished road
Re: need help with a broken function

You can also try over at .
Mabus is offline   Reply With Quote
Old 04-28-2009, 08:02 PM   #4
Baram
Member
 
Baram's Avatar
 
Join Date: Jan 2006
Location: Seoul
Home MUD: Tears of Polaris
Posts: 218
Baram is on a distinguished road
Re: need help with a broken function

As Newworlds said, it's going to be hard for most people to help you with but I'll take a stab at some things you can try.

Before I do, a couple notes...

1. I hope formatting (IE indentation) was just lost in the posting...

2. I'd recommend changing whatever that hard coded 33177 is into a marco or something else, generally bad practice to hard code numbers like that as it's meaning can be forgotten (where if it's a marco that's clearly named you'll always remember what it is) and if it ever changes it's MUCH easier to change a marco than go through all your code. I'm almost always a fan of finding another way of doing that, I'm assuming that's the vnum for some weapon or item, such as making it a flag/property on an item. Reason for that is if the item ever changes/no longer exists and that vnum gets reused you'll have some very strange and hard to track down bugs. Same deal with your races, a marco would be better than directly putting the numbers in, or better yet (though would require a rewrite of everything) a race database.

3. In your fight.c snippit you check "IS_CLASS(ch, CLASS_HIGHLANDER)" and then under it (inside that if block) you check "IS_CLASS(ch, CLASS_HIGHLANDER)" again, unless you cut out some code, why check it twice in a row?

Now for the code itself:

Ok, I lied... there just isn't enough code in there to really debug it, there's plenty of places the damage could get modified. I'd suggest spitting out some debug lines before this line:

if (dt == gsn_sfury && IS_CLASS(ch, CLASS_HIGHLANDER))

To verify what dt is, and then after:

dam = number_range(2500,5000);

To see what dam is, then continue spitting out dam for the rest of that routine up and to actually dealing the damage. Doing that you should get an idea of where it's changing, or if it's even getting set correctly at the start.

Good luck, wish I could have been more helpful.
Baram is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 01:45 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022