• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS] 2008-02-01 New weaponType

Lejjo

New Member
Joined
Sep 21, 2007
Messages
78
Reaction score
1
What is this code?
This code wil enable fist as a weaponType. So, if you want a certain weapon to be fist fighting, follow my simple steps.

Start of the code:
const.h

Add...
Code:
	WEAPON_FIST = 8

...under
Code:
WEAPON_AMMO = 7,
Note to add "," after the "7".


items.cpp

Add...
Code:
									else if(strcasecmp(strValue.c_str(), "fist") == 0){
										it.weaponType = WEAPON_FIST;
									}

...under
Code:
									else if(strcasecmp(strValue.c_str(), "ammunition") == 0){
										it.weaponType = WEAPON_AMMO;
									}


player.cpp

Add...
Code:
case WEAPON_FIST:

...under
Code:
case WEAPON_WAND:



Add...
Code:
		case WEAPON_FIST:
		{
			attackSkill = getSkill(SKILL_FIST, SKILL_LEVEL);
			break;
		}

...under
Code:
		case WEAPON_DIST:
		{
			attackSkill = getSkill(SKILL_DIST, SKILL_LEVEL);
			break;
		}


spells.cpp

Add...
Code:
case WEAPON_FIST:

...under
Code:
case WEAPON_AXE:


weapons.cpp

Add...
Code:
case WEAPON_FIST:

...under
Code:
case WEAPON_CLUB:



Add...
Code:
		case WEAPON_FIST:
		{
			skill = SKILL_FIST;
			return true;
		}

...under
Code:
		case WEAPON_AXE:
		{
			skill = SKILL_AXE;
			return true;
			break;
		}
End of the code:

Rebuild all and now you can add:
Code:
	<item id="5875" name="sniper gloves">
		<attribute key="description" value="They are the pride of the paladin guild."/>
		<attribute key="weight" value="400"/>
		<attribute key="defense" value="22"/>
		<attribute key="attack" value="19"/>
		[COLOR="Red"]<attribute key="weaponType" value="fist"/>[/COLOR]
	</item>

Please leave a comment :)
And if there is a better way to do this, please tell me then. Still learning :)

Yours,
Kadj
 
nice, but no usable for me, fist is fist, no weapon :)

Please try make enchanted weapons system like on 8.1 is. ;]
 
Back
Top