def onContextEntry( char, target, tag  ):
	skill = tag - 1
	if ( char.dead or skill < 0 ):
		return True

	baseToSet = int( target.skill[ skill ] / ( 1000.0 / MAX_TEACHING ) )
	if ( baseToSet > MAX_TEACHING ):
		baseToSet = MAX_TEACHING
	elif ( baseToSet < MIN_TEACHING ):
		#target.say( str( baseToSet ) )
		return True
	pointsToLearn = baseToSet - char.skill[ skill ]
	#it shouldn't be able to teach a skill above the chars skillcap
	pointsToLearn = min( pointsToLearn, char.skillcap[ skill ] - char.skill[ skill ] )
	if ( pointsToLearn <= 0 ): # Player knows more than me
		return True

	target.say( 1019077, affix = " " + str( pointsToLearn*10 ), prepend = False, socket = char.socket ) # I will teach thee all I know, if paid the amount in full.  The price is:

	# using text instead of cliloc, because cliloc will hide the last message
	target.say( tr("For less I shall teach thee less.") ) #For less I shall teach thee less.
	#target.say( 1043108, socket = char.socket ) #For less I shall teach thee less.

	char.settag("npctrainer", str( target.serial ) )
	char.settag("trainningskill", str( skill ) )
	return True
Beispiel #2
0
def onContextEntry(char, target, tag):
    skill = tag - 1
    if (char.dead or skill < 0):
        return True

    baseToSet = int(target.skill[skill] / (1000.0 / MAX_TEACHING))
    if (baseToSet > MAX_TEACHING):
        baseToSet = MAX_TEACHING
    elif (baseToSet < MIN_TEACHING):
        #target.say( str( baseToSet ) )
        return True
    pointsToLearn = baseToSet - char.skill[skill]
    #it shouldn't be able to teach a skill above the chars skillcap
    pointsToLearn = min(pointsToLearn,
                        char.skillcap[skill] - char.skill[skill])
    if (pointsToLearn <= 0):  # Player knows more than me
        return True

    target.say(
        1019077,
        affix=" " + str(pointsToLearn * 10),
        prepend=False,
        socket=char.socket
    )  # I will teach thee all I know, if paid the amount in full.  The price is:

    # using text instead of cliloc, because cliloc will hide the last message
    target.say(tr("For less I shall teach thee less.")
               )  #For less I shall teach thee less.
    #target.say( 1043108, socket = char.socket ) #For less I shall teach thee less.

    char.settag("npctrainer", str(target.serial))
    char.settag("trainningskill", str(skill))
    return True
from system.makemenus import CraftItemAction, MakeMenu, findmenu, generateNamefromDef
from wolfpack.utilities import hex2dec, tobackpack, createlockandkey
import random
import skills.blacksmithing
from copy import deepcopy

extended_carpentry = int( wolfpack.settings.getbool("General", "Extended Carpentry", False, True) )

# Use metals list from Blacksmithing, but test for carpentry skill
CARPENTRYMETALS = deepcopy(skills.blacksmithing.METALS)
for metal in CARPENTRYMETALS:
	metal[1] = CARPENTRY

if extended_carpentry:
	WOOD = [
			[tr('Beech Wood'), CARPENTRY, 0, ['1bd7', '1bda'], 0, 'beech'],
			[tr('Apple Wood'), CARPENTRY, 300, ['board_apple'], 1748, 'apple'],
			[tr('Peach Wood'), CARPENTRY, 350, ['board_peach'], 1856, 'peach'],
			[tr('Pear Wood'), CARPENTRY, 400, ['board_pear'], 1002, 'pear'],
			[tr('Cedar Wood'), CARPENTRY, 450, ['board_cedar'], 2107, 'cedar'],
			[tr('Willow Wood'), CARPENTRY, 500, ['board_willow'], 1513, 'willow'],
			[tr('Cypress Wood'), CARPENTRY, 550, ['board_cypress'], 2413, 'cypress'],
			[tr('Oak Wood'), CARPENTRY, 600, ['board_oak'], 1049, 'oak'],
			[tr('Walnut Wood'), CARPENTRY, 650, ['board_walnut'], 1839, 'walnut'],
			[tr('Yew Wood'), CARPENTRY, 700, ['board_yew'], 1502, 'yew'],
			[tr('Tropical Wood'), CARPENTRY, 750, ['board_tropical'], 1889, 'tropical']
	]
else:
	WOOD = [
			[tr('Wood'), CARPENTRY, 0, ['1bd7', '1bda'], 0, 'wood'],
	]
Beispiel #4
0
from wolfpack import console
from wolfpack.consts import *
from wolfpack import properties, settings, getdefinition
from math import ceil
from system.makemenus import CraftItemAction, MakeMenu, findmenu, generateNamefromDef
from wolfpack.utilities import hex2dec, tobackpack, tr
from wolfpack.properties import itemcheck, fromitem

extended_carpentry = int(
    settings.getbool("General", "Extended Carpentry", False, True))

if extended_carpentry:
    WOOD = [
        [
            tr('Beech Wood'), BOWCRAFT, 0,
            ['1bd7', '1bda', '1bdd', '1bde', '1bdf', '1be0', '1be1', '1be2'],
            0, 'beech'
        ],
        [
            tr('Apple Wood'), BOWCRAFT, 300, ['board_apple', 'log_apple'],
            1748, 'apple'
        ],
        [
            tr('Peach Wood'), BOWCRAFT, 350, ['board_peach', 'log_peach'],
            1856, 'peach'
        ],
        [
            tr('Pear Wood'), BOWCRAFT, 400, ['board_pear', 'log_pear'], 1002,
            'pear'
        ],
#  ( (  ;._ \\ ctr # Last Modification: Created                 #
#################################################################

from wolfpack import console
from wolfpack.consts import *
from wolfpack import properties, settings, getdefinition
from math import ceil
from system.makemenus import CraftItemAction, MakeMenu, findmenu, generateNamefromDef
from wolfpack.utilities import hex2dec, tobackpack, tr
from wolfpack.properties import itemcheck, fromitem

extended_carpentry = int( settings.getbool("General", "Extended Carpentry", False, True) )

if extended_carpentry:
	WOOD = [
			[tr('Beech Wood'), BOWCRAFT, 0, ['1bd7', '1bda', '1bdd', '1bde', '1bdf', '1be0', '1be1', '1be2'], 0, 'beech'],
			[tr('Apple Wood'), BOWCRAFT, 300, ['board_apple', 'log_apple'], 1748, 'apple'],
			[tr('Peach Wood'), BOWCRAFT, 350, ['board_peach', 'log_peach'], 1856, 'peach'],
			[tr('Pear Wood'), BOWCRAFT, 400, ['board_pear', 'log_pear'], 1002, 'pear'],
			[tr('Cedar Wood'), BOWCRAFT, 450, ['board_cedar', 'log_cedar'], 2107, 'cedar'],
			[tr('Willow Wood'), BOWCRAFT, 500, ['board_willow', 'log_willow'], 1513, 'willow'],
			[tr('Cypress Wood'), BOWCRAFT, 550, ['board_cypress', 'log_cypress'], 2413, 'cypress'],
			[tr('Oak Wood'), BOWCRAFT, 600, ['board_oak', 'log_oak'], 1049, 'oak'],
			[tr('Walnut Wood'), BOWCRAFT, 650, ['board_walnut', 'log_walnut'], 1839, 'walnut'],
			[tr('Yew Wood'), BOWCRAFT, 700, ['board_yew', 'log_yew'], 1502, 'yew'],
			[tr('Tropical Wood'), BOWCRAFT, 750, ['board_tropical', 'log_tropical'], 1889, 'tropical']
	]
else:
	WOOD = [
			[tr('Wood'), BOWCRAFT, 0, ['1bd7', '1bda', '1bdd', '1bde', '1bdf', '1be0', '1be1', '1be2'], 0, 'beech'],
	]
Beispiel #6
0
from wolfpack.utilities import hex2dec, tobackpack, createlockandkey
import random
import skills.blacksmithing
from copy import deepcopy

extended_carpentry = int(
    wolfpack.settings.getbool("General", "Extended Carpentry", False, True))

# Use metals list from Blacksmithing, but test for carpentry skill
CARPENTRYMETALS = deepcopy(skills.blacksmithing.METALS)
for metal in CARPENTRYMETALS:
    metal[1] = CARPENTRY

if extended_carpentry:
    WOOD = [
        [tr('Beech Wood'), CARPENTRY, 0, ['1bd7', '1bda'], 0, 'beech'],
        [tr('Apple Wood'), CARPENTRY, 300, ['board_apple'], 1748, 'apple'],
        [tr('Peach Wood'), CARPENTRY, 350, ['board_peach'], 1856, 'peach'],
        [tr('Pear Wood'), CARPENTRY, 400, ['board_pear'], 1002, 'pear'],
        [tr('Cedar Wood'), CARPENTRY, 450, ['board_cedar'], 2107, 'cedar'],
        [tr('Willow Wood'), CARPENTRY, 500, ['board_willow'], 1513, 'willow'],
        [
            tr('Cypress Wood'), CARPENTRY, 550, ['board_cypress'], 2413,
            'cypress'
        ], [tr('Oak Wood'), CARPENTRY, 600, ['board_oak'], 1049, 'oak'],
        [tr('Walnut Wood'), CARPENTRY, 650, ['board_walnut'], 1839, 'walnut'],
        [tr('Yew Wood'), CARPENTRY, 700, ['board_yew'], 1502, 'yew'],
        [
            tr('Tropical Wood'), CARPENTRY, 750, ['board_tropical'], 1889,
            'tropical'
        ]