Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop.com Store Opened!
Torque MMO Kit - Open Sourced!
Torque MMO Kit - 1.5.2 Port Alpha Test
Torque MMO Kit - OSX Status

GarageGames.com irc.prairiegames.com
#mmoworkshop

PyTorque
TGB Web Browser


jburch

hallsofvalhalla - After a long epiphany
Leathel - FoHO pre-Alpha 2.42
OldRod - More Musings on the MMO Industry
xapken - nice
J.C. Smith - 0.0.4.1 Build Notes
Wolf Dreamer - Pointless blog of pointless things
AthlonJedi2 - Server Nuked !!!!!
gamer_goof - New character model GIRL1 available only $4
... MORE BLOGS!

My other project
A Message to all the new people.
MyGame
changing the primary class
See Ya Classes, Hello Skills!
XP Based Skills
fxFoliageReplicator zone loading...
Is it just me, or is it slow in ...
Places where NPC quest-givers ha...
TalentRaspel Grid

Creating New Skills

Creating new skills is very much like creating a spell. You first create an effect which gets added to a spell, the spell then gets added to the skill. There are some unique parameters to set up when creating a new skill and that is what we're going to discuss in this section.

One of the biggest benefits to choosing a skill over a spell is that skills do not use Mana. We're going to create a level one healing skill for Paladins called Healing Hands.

1. Create a new file and save it as: ~\test.game\genesis\skill\paladin.py. Add the following text and save:

from genesis.dbdict import DBClassSkill
from genesis.dbdict import DBSpellProto,DBEffectProto
from mud.world.defines import *

#--- DEFINES
durSecond = 6
durMinute = durSecond * 60
durHour = durMinute * 60


2. Open ~\test.game\genesis\skill\__init__.py and add the following text and save:

import paladin


3. In your new file paladin.py we'll begin by setting up the effect proto:

effect = DBEffectProto(name = "Paladin Healing Hands - Skill")
effect.addStat(RPG_EFFECT_STAGE_BEGIN,"health",2500)

Note: the maximum amount of health points this skill can be used to regain is 2500, we'll set up how this is determined shortly.

4. Next, we'll set up the spell that this effect gets assigned to:

spell = DBSpellProto()
spell.name = "Paladin Healing Hands - Skill"
spell.spellType = RPG_SPELL_HEALING
spell.target = RPG_TARGET_OTHER
spell.duration = 0
spell.castTime = 0
spell.castRange = 10
spell.recastTime = 0
spell.harmful = False
spell.addEffect("Paladin Healing Hands - Skill")
spell.beginMsg = "$src lays hands on $tgt!"
spell.sndBegin = "sfx/Magic_Appear01.ogg"

5. Now, we'll create the skill.

First, set up the skill prototype and give the skill its name:

skill = DBClassSkill(skillname = "Healing Hands")

Assign this skill to the Paladin class:

skill.type = ['Paladin']

Define how often this skill can be used by its minimum reuse time and maximum reuse time. We'll set it up to be reused in no shorter than 3 minutes and no longer than 6 minutes.

skill.minReuseTime = durMinute * 3
skill.maxReuseTime = durMinute * 6

Define at what level the skill is gained, at what level the skill gets capped, and the maximum value of the skill. In this example: the player gets the skill at level 5 and can gain up to 500 skill levels...since the level is capped at 50 we can determine that the player can obtain ~11 skill points per character level: 500/(50-5) = 11.1

skill.levelGained = 5
skill.levelCapped = 50
skill.maxValue = 500

We want this skill to automatically show up in the player's list of skills, so we'll assign the following:

skill.trained = False

Note: if this were set to 'True' then we'd need to set up a trainer or a quest reward to get this skill.

Finally, we add the spell proto to this skill:

skill.spellProto = "Paladin Healing Hands - Skill"


6. Save the file, then select World -> Compile World and verify that there are no errors in the message window.

7. Determine whether this is an active or passive skill. Active skills require the player to use the skill whereas passive skills are used automatically such as swimming when in water or 1HSlash when a 1HSlash weapon is equipped. This skill will be an active skill that players can assign to hotkeys/macros.

Open ~\mud\client\gui\skillinfo.py and add the following:

SKILLINFOS['Healing Hands']=SkillInfo('Healing Hands',False,"SPELLICON_1_0")

Here we define the name of the skill info and the name of the skill. We want this to be an active skill and we assign an icon.

8. Save the file, then select World -> Compile World and verify that there are no errors in the message window.

9. From inside the Torque MMO Kit IDE select World -> Edit Zone and choose one of your zones. Make sure you log in with a character that has a Paladin class. At level 5, you should note that the skill automatically appears in your skill window. Test out your new skill.




Mod Value on the skill created

The skill created uses the current value of the skill (such as value 5) out of the Max Value attainable (500). It then divides these values to obtain a modifier. The only issue with how this works is the following code in mud/world/skill.py

def DoSkillSpell(mob,skillname):
    from projectile import Projectile
    from spell import SpawnSpell
    
    mskill = mob.mobSkillProfiles[skillname]
    cskill = mskill.classSkill
    
    mv = mob.skillLevels.get(skillname,0)
    if not mv:
        return
    
    mod = float(mv)/float(cskill.maxValue)
    
    if mod < .1:
        mod = .1

You can see when the skill is called it will set the modifier of the current value against the max value and if the modifier is less than .1 it will now be .1. It will take 50 points in the skill till this is reached (roughly level 10 on the player). Just something to keep in mind.




Return to Tutorials