Example #1
0
def checkhit(attacker, defender, time):
	# Get the skills used by the attacker and defender
	attackerWeapon = attacker.getweapon()
	defenderWeapon = defender.getweapon()
	attackerSkill = combat.utilities.weaponskill(attacker, attackerWeapon, True)
	defenderSkill = combat.utilities.weaponskill(defender, defenderWeapon, True)

	combat.utilities.playswinganimation(attacker, defender, attackerWeapon)

	# Retrieve the skill values
	attackerValue = attacker.skill[attackerSkill] / 10
	defenderValue = defender.skill[defenderSkill] / 10
	
	# Calculate the hit chance
	bonus = 0 # Get the weapon "accuracy" status
	bonus += properties.fromchar(attacker, HITBONUS) # Get the attackers AttackChance bonus
	attackChance = (attackerValue + 20.0) * (100 + bonus)

	# Calculate the defense chance
	bonus = properties.fromchar(defender, DEFENSEBONUS) # Get the defenders defend chance
	defendChance = (defenderValue + 20.0) * (100 + bonus)

	# Give a minimum chance of 2%
	chance = max(0.02, attackChance / (defendChance * 2.0))

	# Scale the chance using the ability
	ability = getability(attacker)
	if ability:
		chance = ability.scalehitchance(attacker, defender, chance)

	return checkskill(attacker, attackerSkill, chance)
Example #2
0
def checkhit(attacker, defender, time):
    # Get the skills used by the attacker and defender
    attackerWeapon = attacker.getweapon()
    defenderWeapon = defender.getweapon()
    attackerSkill = combat.utilities.weaponskill(attacker, attackerWeapon,
                                                 True)
    defenderSkill = combat.utilities.weaponskill(defender, defenderWeapon,
                                                 True)

    combat.utilities.playswinganimation(attacker, defender, attackerWeapon)

    # Retrieve the skill values
    attackerValue = attacker.skill[attackerSkill] / 10
    defenderValue = defender.skill[defenderSkill] / 10

    # Calculate the hit chance
    bonus = 0  # Get the weapon "accuracy" status
    bonus += properties.fromchar(
        attacker, HITBONUS)  # Get the attackers AttackChance bonus

    # attacker gets 10% bonus when they're under divine fury
    if attacker.hasscript('magic.divinefury'):
        bonus += 10

    if attacker.hastag('hitlowerattack'):
        bonus -= 25  # Under Hit Lower Attack effect -> 25% malus

    attackChance = (attackerValue + 20.0) * (100 + bonus)

    # Calculate the defense chance
    bonus = properties.fromchar(
        defender, DEFENSEBONUS)  # Get the defenders defend chance
    # defender loses 20% bonus when they're under divine fury
    if defender.hasscript('magic.divinefury'):
        bonus -= 20

    if defender.hastag('hitlowerdefense'):
        bonus -= 25  # Under Hit Lower Defense effect -> 25% malus

    defendChance = (defenderValue + 20.0) * (100 + bonus)

    # Give a minimum chance of 2%
    chance = max(0.02, attackChance / (defendChance * 2.0))

    # Scale the chance using the ability
    ability = getability(attacker)
    if ability:
        chance = ability.scalehitchance(attacker, defender, chance)

    return checkskill(attacker, attackerSkill, chance)
Example #3
0
def potion( char, potion, refreshtype ):
	socket = char.socket

	if not canUsePotion( char, potion ):
		return False

	# refresh potion
	if refreshtype == 18:
		amount = char.maxstamina / 4
		
		# Apply Enhancepotions Bonus
		enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
		if enhancepotions > 0:
			amount += (enhancepotions * amount) / 100
							
		char.stamina = min(char.maxstamina, char.stamina + amount)
		char.updatestamina()
	# total refresh potion
	elif refreshtype == 19:
		char.stamina = char.maxstamina
		char.updatestamina()
	else:
		return False

	if char.stamina > char.maxstamina:
		char.stamina = char.maxstamina
		char.updatestamina()
		return False

	char.action( ANIM_FIDGET3 )
	char.soundeffect( SOUND_DRINK1 )
	consumePotion( char, potion, POTIONS[ refreshtype ][ POT_RETURN_BOTTLE ] )
	return True
Example #4
0
	def consumerequirements(self, char, mode, args=[], target=None, item=None):
		if char.gm:
			return True

		# Check Basic Requirements before proceeding (Includes Death of Caster etc.)
		if not self.checkrequirements(char, mode, args, target, item):
			fizzle(char)
			return 0

		# Check Skill
		if self.skill != None:
			if mode == MODE_BOOK:
				circle = self.circle - 1
			else:
				circle = self.circle - 3
			minskill = max(0, int((1000 / 7) * circle - 200))
			maxskill = min(1200, int((1000 / 7) * circle + 200))

			if not char.checkskill(self.skill, minskill, maxskill):
				char.message(502632)
				fizzle(char)
				return 0

		# Consume Mana
		if mode == MODE_BOOK:
			if self.mana != 0:
				mana = self.scalemana(char, MODE_BOOK, self.mana)
				char.mana = max(0, char.mana - mana)
				char.updatemana()

			# Consume Reagents
			if not char.npc and len(self.reagents) > 0:
				lowerreagentcost = properties.fromchar(char, LOWERREAGENTCOST)

				if lowerreagentcost == 0 or lowerreagentcost < random.randint(0, 99):
					consumeReagents(char.getbackpack(), self.reagents.copy())

		# Reduced Skill, Reduced Mana, No Reagents
		elif mode == MODE_SCROLL:
			if self.mana != 0:
				mana = self.scalemana(char, MODE_SCROLL, self.mana)
				char.mana = max(0, char.mana - mana)
				char.updatemana()

			# Remove one of the scrolls
			if item.amount == 1:
				item.delete()
			else:
				item.amount -= 1
				item.update()

		# No requirements at all
		elif mode == MODE_WAND:
			pass

		# Set the next spell delay
		self.setspelldelay(char, mode)

		return 1
Example #5
0
def checkhit(attacker, defender, time):
	# Get the skills used by the attacker and defender
	attackerWeapon = attacker.getweapon()
	defenderWeapon = defender.getweapon()
	attackerSkill = combat.utilities.weaponskill(attacker, attackerWeapon, True)
	defenderSkill = combat.utilities.weaponskill(defender, defenderWeapon, True)

	combat.utilities.playswinganimation(attacker, defender, attackerWeapon)

	# Retrieve the skill values
	attackerValue = attacker.skill[attackerSkill] / 10
	defenderValue = defender.skill[defenderSkill] / 10

	# Calculate the hit chance
	bonus = 0 # Get the weapon "accuracy" status
	bonus += properties.fromchar(attacker, HITBONUS) # Get the attackers AttackChance bonus

	# attacker gets 10% bonus when they're under divine fury
	if attacker.hasscript('magic.divinefury'):
		bonus += 10

	if attacker.hastag('hitlowerattack'):
		bonus -= 25 # Under Hit Lower Attack effect -> 25% malus

	attackChance = (attackerValue + 20.0) * (100 + bonus)

	# Calculate the defense chance
	bonus = properties.fromchar(defender, DEFENSEBONUS) # Get the defenders defend chance
	# defender loses 20% bonus when they're under divine fury
	if defender.hasscript('magic.divinefury'):
		bonus -= 20

	if defender.hastag('hitlowerdefense'):
		bonus -= 25 # Under Hit Lower Defense effect -> 25% malus

	defendChance = (defenderValue + 20.0) * (100 + bonus)

	# Give a minimum chance of 2%
	chance = max(0.02, attackChance / (defendChance * 2.0))

	# Scale the chance using the ability
	ability = getability(attacker)
	if ability:
		chance = ability.scalehitchance(attacker, defender, chance)

	return checkskill(attacker, attackerSkill, chance)
Example #6
0
	def consumereagents(self, char, mode, args=[]):
		if not char.npc and len(self.reagents) > 0:
			lowerreagentcost = properties.fromchar(char, LOWERREAGENTCOST)

			if lowerreagentcost == 0 or lowerreagentcost < random.randint(0, 99):
				#char.socket.sysmessage(str(consumeReagents(char.getbackpack(), self.reagents.copy())))
				if consumeReagents(char.getbackpack(), self.reagents.copy()):
					arcanegem.ConsumeCharges( char )
Example #7
0
def onShowStatus(char, packet):
    damagebonus = properties.fromchar(char, DAMAGEBONUS)

    # Get weapon properties if applicable
    (mindamage, maxdamage) = properties.getdamage(char)

    # Scale damage
    mindamage = int(combat.aos.scaledamage(char, mindamage, 0))
    maxdamage = int(combat.aos.scaledamage(char, maxdamage, 0))

    packet.setshort(62, properties.fromchar(
        char, RESISTANCE_PHYSICAL))  # Physical resistance
    packet.setshort(70,
                    properties.fromchar(char,
                                        RESISTANCE_FIRE))  # Fire Resistance
    packet.setshort(72,
                    properties.fromchar(char,
                                        RESISTANCE_COLD))  # Cold Resistance
    packet.setshort(74, properties.fromchar(
        char, RESISTANCE_POISON))  # Poison Resistance
    packet.setshort(76, properties.fromchar(
        char, RESISTANCE_ENERGY))  # Energy Resistance
    packet.setshort(78, properties.fromchar(char, LUCK))  # Luck
    packet.setshort(80, mindamage)  # Min. Damage
    packet.setshort(82, maxdamage)  # Max. Damage
    if char.hastag('tithing_points'):
        packet.setint(84, char.gettag('tithing_points'))  # Tithing Points
    else:
        packet.setint(84, 0)
Example #8
0
def potion( char, potion, healtype ):
	socket = char.socket
	if not canUsePotion( char, potion ):
		return False

	if char.poison > -1 or ismortallywounded(char):
		# You can not heal yourself in your current state.
		socket.clilocmessage(1005000)
		return False

	if char.hitpoints >= char.maxhitpoints:
		socket.clilocmessage(1049547)
		if char.hitpoints > char.maxhitpoints:
			char.hitpoints = char.maxhitpoints
			char.updatehealth()
		return False

	# Compare
	if socket.hastag('heal_pot_timer'):
		elapsed = int( socket.gettag( "heal_pot_timer" ) )
		if elapsed > time.time():
			# Broken Timer
			if time.time() - elapsed > HEAL_POT_DELAY:
				socket.deltag('heal_pot_timer')
			else:
				socket.clilocmessage( 500235 ) # You must wait 10 seconds before using another healing potion.
				return False

	socket.settag( "heal_pot_timer", time.time() + HEAL_POT_DELAY)
	amount = 0

	# Lesser Heal
	if healtype == 1:
		amount = random.randint( POTION_LESSERHEAL_RANGE[0], POTION_LESSERHEAL_RANGE[1] )
	# Heal
	elif healtype == 2:
		amount = random.randint( POTION_HEAL_RANGE[0], POTION_HEAL_RANGE[1] )
	# Greater Heal
	elif healtype == 3:
		amount = random.randint( POTION_GREATERHEAL_RANGE[0], POTION_GREATERHEAL_RANGE[1] )

	# Apply Enhancepotions Bonus
	enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
	if enhancepotions > 0:
		amount += (enhancepotions * amount) / 100

	char.hitpoints = min( char.hitpoints + amount, char.maxhitpoints ) # We don't heal over our maximum health

	# Resend Health
	char.updatehealth()
	char.socket.clilocmessage( 1060203, unicode(amount) )

	char.action( ANIM_FIDGET3 )
	char.soundeffect( SOUND_DRINK1 )
	consumePotion( char, potion, POTIONS[ healtype ][ POT_RETURN_BOTTLE ] )

	return True
Example #9
0
    def consumereagents(self, char, mode, args=[]):
        if not char.npc and len(self.reagents) > 0:
            lowerreagentcost = properties.fromchar(char, LOWERREAGENTCOST)

            if lowerreagentcost == 0 or lowerreagentcost < random.randint(
                    0, 99):
                #char.socket.sysmessage(str(consumeReagents(char.getbackpack(), self.reagents.copy())))
                if consumeReagents(char.getbackpack(), self.reagents.copy()):
                    arcanegem.ConsumeCharges(char)
Example #10
0
def potion(char, potion, manatype):
    socket = char.socket
    if not canUsePotion(char, potion):
        return False

    if char.mana >= char.maxmana:
        socket.sysmessage(tr('You are already at full mana.'))
        if char.mana > char.maxmana:
            char.mana = char.maxmana
            char.updatemana()
        return False

    # Compare
    if socket.hastag('mana_pot_timer'):
        elapsed = int(socket.gettag('mana_pot_timer'))
        if elapsed > time.time():
            # Broken Timer
            if time.time() - elapsed > MANA_POT_DELAY:
                socket.deltag('mana_pot_timer')
            else:
                socket.sysmessage(
                    tr('You must wait a few seconds before using another mana potion.'
                       ))
                return False

    socket.settag('mana_pot_timer', time.time() + MANA_POT_DELAY)
    amount = 0

    # Lesser Mana
    if manatype == 22:
        amount = randint(POTION_LESSERMANA_RANGE[0],
                         POTION_LESSERMANA_RANGE[1])
    # Mana
    elif manatype == 23:
        amount = randint(POTION_MANA_RANGE[0], POTION_MANA_RANGE[1])
    # Greater Mana
    elif manatype == 24:
        amount = randint(POTION_GREATERMANA_RANGE[0],
                         POTION_GREATERMANA_RANGE[1])

    # Apply Enhancepotions Bonus
    enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
    if enhancepotions > 0:
        amount += (enhancepotions * amount) / 100

    char.mana = min(char.mana + amount,
                    char.maxmana)  # We don't add mana over our maximum mana

    # Resend Mana
    char.updatemana()

    char.action(ANIM_FIDGET3)
    char.soundeffect(SOUND_DRINK1)
    consumePotion(char, potion, POTIONS[manatype][POT_RETURN_BOTTLE])

    return True
Example #11
0
def potion(char, potion, agilitytype):
    socket = char.socket
    bonus = 0

    if not canUsePotion(char, potion):
        return False

    # Agility
    if agilitytype == 7:
        bonus = 10
    # Greater Agility
    elif agilitytype == 8:
        bonus = 20
    # Oops!
    else:
        return False

    # Apply Enhancepotions Bonus
    enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
    if enhancepotions > 0:
        bonus += (enhancepotions * bonus) / 100

    if char.hastag("dex_pot_timer"):
        # Compare
        elapsed = int(char.gettag("dex_pot_timer"))

        # Some bug occured
        if elapsed - time.time() > AGILITY_TIME:
            char.deltag('dex_pot_timer')
        elif elapsed > time.time():
            socket.clilocmessage(
                502173)  # You are already under a similar effect.
            return False

    char.settag('dex_pot_timer', time.time() + AGILITY_TIME)

    if char.dexterity + bonus < 1:
        bonus = -(char.strength - 1)

    char.dexterity2 += bonus
    char.dexterity += bonus
    char.stamina = min(char.stamina, char.maxstamina)
    char.updatestamina()
    char.updatestats()

    char.addtimer(int(AGILITY_TIME * 1000), statmodifier_expire, [1, bonus], 1,
                  1, "magic_statmodifier_1", statmodifier_dispel)

    char.action(ANIM_FIDGET3)
    char.soundeffect(SOUND_DRINK1)
    char.effect(0x375a, 10, 15)
    char.soundeffect(SOUND_AGILITY_UP)
    consumePotion(char, potion, POTIONS[agilitytype][POT_RETURN_BOTTLE])

    return True
Example #12
0
def potion( char, potion, agilitytype ):
	socket = char.socket
	bonus = 0

	if not canUsePotion( char, potion ):
		return False

	# Agility
	if agilitytype == 7:
		bonus = 10
	# Greater Agility
	elif agilitytype == 8:
		bonus = 20
	# Oops!
	else:
		return False

	# Apply Enhancepotions Bonus
	enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
	if enhancepotions > 0:
		bonus += (enhancepotions * bonus) / 100

	if char.hastag( "dex_pot_timer" ):
		# Compare
		elapsed = int( char.gettag( "dex_pot_timer" ) )

		# Some bug occured
		if elapsed - time.time() > AGILITY_TIME:
			char.deltag('dex_pot_timer')
		elif elapsed > time.time():
				socket.clilocmessage(502173) # You are already under a similar effect.
				return False

	char.settag( 'dex_pot_timer', time.time() + AGILITY_TIME )

	if char.dexterity + bonus < 1:
		bonus = -(char.strength - 1)

	char.dexterity2 += bonus
	char.dexterity += bonus
	char.stamina = min( char.stamina, char.maxstamina )
	char.updatestamina()
	char.updatestats()

	char.addtimer( int( AGILITY_TIME * 1000 ), "magic.utilities.statmodifier_expire", [1, bonus], 1, 1, "magic_statmodifier_1", "magic.utilities.statmodifier_dispel" )

	char.action( ANIM_FIDGET3 )
	char.soundeffect( SOUND_DRINK1 )
	char.effect( 0x375a, 10, 15 )
	char.soundeffect( SOUND_AGILITY_UP )
	consumePotion( char, potion, POTIONS[ agilitytype ][ POT_RETURN_BOTTLE ] )

	return True
Example #13
0
	def scaledamage(self, char, target, bonus, dice, sides):
		damage = rolldice(dice, sides, bonus) * 100.0

		bonus = char.skill[INSCRIPTION] / 100.0
		bonus += char.intelligence / 10.0
		bonus += properties.fromchar(char, SPELLDAMAGEBONUS)
		damage *= 1.0 + bonus / 100.0

		char.checkskill(self.damageskill, 0, 1200)
		damage *= (30 + (9 * char.skill[self.damageskill]) / 100.0) / 100.0

		return max(1, int(damage / 100.0))
Example #14
0
def potion(char, potion, strengthtype):
    socket = char.socket
    if not canUsePotion(char, potion):
        return False

    bonus = 0

    # Agility
    if strengthtype == 9:
        bonus = 10
    # Greater Agility
    elif strengthtype == 10:
        bonus = 20
    # Oops!
    else:
        return False

    # Apply Enhancepotions Bonus
    enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
    if enhancepotions > 0:
        bonus += (enhancepotions * bonus) / 100

    if char.hastag("str_pot_timer"):
        # Compare
        elapsed = int(char.gettag("str_pot_timer"))

        if elapsed - time.time() > STRENGTH_TIME:
            char.deltag('str_pot_timer')
        elif elapsed > time.time():
            socket.clilocmessage(
                502173)  # You are already  under a similar effect
            return False

    char.settag("str_pot_timer", time.time() + STRENGTH_TIME)

    if char.strength + bonus < 1:
        bonus = -(char.strength - 1)
    char.strength2 += bonus
    char.strength += bonus
    char.hitpoints = min(char.hitpoints, char.maxhitpoints)
    char.updatehealth()
    char.updatestats()

    char.addtimer(int(STRENGTH_TIME * 1000.0), statmodifier_expire, [0, bonus],
                  1, 1, "magic_statmodifier_0", statmodifier_dispel)

    char.action(ANIM_FIDGET3)
    char.soundeffect(SOUND_DRINK1)
    char.effect(0x375a, 10, 15)
    char.soundeffect(SOUND_STRENGTH_UP)
    consumePotion(char, potion, POTIONS[strengthtype][POT_RETURN_BOTTLE])

    return True
Example #15
0
def scaledamage(char, damage, checkskills=True, checkability=False):
    if checkskills:
        char.checkskill(TACTICS, 0, 1200)  # Tactics gain
        char.checkskill(ANATOMY, 0, 1200)  # Anatomy gain

    weapon = char.getweapon()

    # Get the total damage bonus this character gets
    bonus = properties.fromchar(char, DAMAGEBONUS)

    if char.hasscript('magic.horrificbeast'):
        bonus += 25

    if char.hasscript('magic.divinefury'):
        bonus += 10

    # For axes a lumberjacking skill check is made to gain
    # in that skill
    if weapon and weapon.type == 1002:
        if checkskills:
            char.checkskill(LUMBERJACKING, 0, 1000)
        bonus += char.skill[LUMBERJACKING] * 0.02

        # If above grandmaster grant an additional 10% bonus for axe weapon users
        if char.skill[LUMBERJACKING] >= 1000:
            bonus += 10

    # Only players get strength boni (or human npcs!)
    if not char.npc or weapon:
        # Strength bonus
        bonus += char.strength * 0.3

        # If strength is above 100, grant an extra 5 percent bonus
        if char.strength >= 100:
            bonus += 5

        # Anatomy bonus
        bonus += char.skill[ANATOMY] * 0.05

        # Grant another 5 percent for anatomy grandmasters
        if char.skill[ANATOMY] >= 1000:
            bonus += 5

        # Tactics bonus
        bonus += char.skill[TACTICS] * 0.0625

        # Add another 6.25 percent for grandmasters
        if char.skill[TACTICS] >= 1000:
            bonus += 6.25

    damage = damage + damage * (bonus / 100.0)

    return max(1, floor(damage))
Example #16
0
def scaledamage(char, damage, checkskills = True, checkability = False):
	if checkskills:
		char.checkskill(TACTICS, 0, 1200) # Tactics gain
		char.checkskill(ANATOMY, 0, 1200) # Anatomy gain

	weapon = char.getweapon()

	# Get the total damage bonus this character gets
	bonus = properties.fromchar(char, DAMAGEBONUS)

	if char.hasscript('magic.horrificbeast'):
		bonus += 25

	if char.hasscript('magic.divinefury'):
		bonus += 10

	# For axes a lumberjacking skill check is made to gain
	# in that skill
	if weapon and weapon.type == 1002:
		if checkskills:
			char.checkskill(LUMBERJACKING, 0, 1000)
		bonus += char.skill[LUMBERJACKING] * 0.02

		# If above grandmaster grant an additional 10% bonus for axe weapon users
		if char.skill[LUMBERJACKING] >= 1000:
			bonus += 10

	# Only players get strength boni (or human npcs!)
	if not char.npc or weapon:
		# Strength bonus
		bonus += char.strength * 0.3

		# If strength is above 100, grant an extra 5 percent bonus
		if char.strength >= 100:
			bonus += 5

		# Anatomy bonus
		bonus += char.skill[ANATOMY] * 0.05

		# Grant another 5 percent for anatomy grandmasters
		if char.skill[ANATOMY] >= 1000:
			bonus += 5

		# Tactics bonus
		bonus += char.skill[TACTICS] * 0.0625

		# Add another 6.25 percent for grandmasters
		if char.skill[TACTICS] >= 1000:
			bonus += 6.25

	damage = damage + damage * (bonus / 100.0)

	return max(1, floor(damage))
Example #17
0
def potiondamage( cserial, target, iserial, dmgbonus, potiontype ):
	char = wolfpack.findchar( cserial )
	item = wolfpack.finditem( iserial )

	if not item or not char:
		return False

	# Damage Range
	if potiontype == 11:
		damage = randint( POTION_LESSEREXPLOSION_RANGE[0], POTION_LESSEREXPLOSION_RANGE[1] )
	elif potiontype == 12:
		damage = randint( POTION_EXPLOSION_RANGE[0], POTION_EXPLOSION_RANGE[1] )
	elif potiontype == 13:
		damage = randint( POTION_GREATEREXPLOSION_RANGE[0], POTION_GREATEREXPLOSION_RANGE[1] )
	else:
		damage = randint( POTION_LESSEREXPLOSION_RANGE[0], POTION_GREATEREXPLOSION_RANGE[1] )

	# Bonuses
	if char.skill[ALCHEMY] == 1200:
		bonus = 10
	elif char.skill[ALCHEMY] >= 1100:
		bonus = randint(8,9)
	elif char.skill[ALCHEMY] >= 1000:
		bonus = randint(6,7)
	else:
		bonus = randint(0,5)
	if item.amount > 1:
		damage = damage * item.amount
	if dmgbonus > 1:
		damage *= dmgbonus
	damage += bonus

	# Apply Enhancepotions Bonus
	enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
	if enhancepotions > 0:
		damage += (enhancepotions * damage) / 100

	if not item.container:
		if target.distanceto( item ) > 1:
			damage = ( damage / target.distanceto( item ) )

	# Flamestrike effect
	if damage >= ( target.maxhitpoints / 2 ):
		target.effect(0x3709, 10, 30)
	target.effect( explosions[randint(0,2)], 20, 10)

	# Let the target defend himself if he isn't fighting yet
	if not target.attacktarget:
		target.fight(char)

	energydamage(target, char, damage, fire=100 )
	return
Example #18
0
def potion( char, potion, manatype ):
	socket = char.socket
	if not canUsePotion( char, potion ):
		return False

	if char.mana >= char.maxmana:
		socket.sysmessage( tr('You are already at full mana.') )
		if char.mana > char.maxmana:
			char.mana = char.maxmana
			char.updatemana()
		return False

	# Compare
	if socket.hastag('mana_pot_timer'):
		elapsed = int( socket.gettag( 'mana_pot_timer' ) )
		if elapsed > time.time():
			# Broken Timer
			if time.time() - elapsed > MANA_POT_DELAY:
				socket.deltag('mana_pot_timer')
			else:
				socket.sysmessage( tr('You must wait a few seconds before using another mana potion.') ) 
				return False

	socket.settag( 'mana_pot_timer', time.time() + MANA_POT_DELAY )
	amount = 0

	# Lesser Mana
	if manatype == 22:
		amount = randint( POTION_LESSERMANA_RANGE[0], POTION_LESSERMANA_RANGE[1] )
	# Mana
	elif manatype == 23:
		amount = randint( POTION_MANA_RANGE[0], POTION_MANA_RANGE[1] )
	# Greater Mana
	elif manatype == 24:
		amount = randint( POTION_GREATERMANA_RANGE[0], POTION_GREATERMANA_RANGE[1] )

	# Apply Enhancepotions Bonus
	enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
	if enhancepotions > 0:
		amount += (enhancepotions * amount) / 100

	char.mana = min( char.mana + amount, char.maxmana ) # We don't add mana over our maximum mana

	# Resend Mana
	char.updatemana()

	char.action( ANIM_FIDGET3 )
	char.soundeffect( SOUND_DRINK1 )
	consumePotion( char, potion, POTIONS[ manatype ][ POT_RETURN_BOTTLE ] )

	return True
Example #19
0
def potion( char, potion, strengthtype ):
	socket = char.socket
	if not canUsePotion( char, potion ):
		return False

	bonus = 0

	# Agility
	if strengthtype == 9:
		bonus = 10
	# Greater Agility
	elif strengthtype == 10:
		bonus = 20
	# Oops!
	else:
		return False

	# Apply Enhancepotions Bonus
	enhancepotions = properties.fromchar(char, ENHANCEPOTIONS)
	if enhancepotions > 0:
		bonus += (enhancepotions * bonus) / 100

	if char.hastag( "str_pot_timer" ):
		# Compare
		elapsed = int( char.gettag( "str_pot_timer" ) )

		if elapsed - time.time() > STRENGTH_TIME:
			char.deltag('str_pot_timer')
		elif elapsed > time.time():
			socket.clilocmessage(502173) # You are already  under a similar effect
			return False

	char.settag( "str_pot_timer", time.time() + STRENGTH_TIME )

	if char.strength + bonus < 1:
		bonus = -(char.strength - 1)
	char.strength2 += bonus
	char.strength += bonus
	char.hitpoints = min(char.hitpoints, char.maxhitpoints)
	char.updatehealth()
	char.updatestats()

	char.addtimer( int(STRENGTH_TIME * 1000.0), statmodifier_expire, [0, bonus], 1, 1, "magic_statmodifier_0", statmodifier_dispel )

	char.action( ANIM_FIDGET3 )
	char.soundeffect( SOUND_DRINK1 )
	char.effect( 0x375a, 10, 15 )
	char.soundeffect( SOUND_STRENGTH_UP )
	consumePotion( char, potion, POTIONS[ strengthtype ][ POT_RETURN_BOTTLE ] )

	return True
Example #20
0
def scaledamage(attacker, mindamage, maxdamage, evintscale):
	damage = random.randint(mindamage, maxdamage)
	
	# This is using a different algorithm than usual
	damage += int(attacker.skill[EVALUATINGINTEL] * evintscale)
	
	bonus = attacker.skill[INSCRIPTION] / 100.0
	if attacker.player:
		bonus += attacker.intelligence / 10.0
		bonus += properties.fromchar(attacker, SPELLDAMAGEBONUS)

	damage += int((damage * bonus) / 100)

	return damage
def scaledamage(attacker, mindamage, maxdamage, evintscale):
	damage = random.randint(mindamage, maxdamage)
	
	# This is using a different algorithm than usual
	damage += int(attacker.skill[EVALUATINGINTEL] * evintscale)
	
	bonus = attacker.skill[INSCRIPTION] / 100.0
	if attacker.player:
		bonus += attacker.intelligence / 10.0
		bonus += properties.fromchar(attacker, SPELLDAMAGEBONUS)

	damage += int((damage * bonus) / 100)

	return damage
Example #22
0
    def setspelldelay(self, char, mode):
        if char.npc:
            pass
        elif char.socket:
            castrecovery = -properties.fromchar(char, CASTRECOVERYBONUS)
            castrecovery += 6
            castrecovery += self.castrecovery

            if castrecovery < 0:
                castrecovery = 0

            delay = float(castrecovery) / 4.0

            char.socket.settag('spell_delay', time.time() + delay)
Example #23
0
	def setspelldelay(self, char, mode):
		if char.npc:
			pass
		elif char.socket:
			castrecovery = - properties.fromchar(char, CASTRECOVERYBONUS)
			castrecovery += 6
			castrecovery += self.castrecovery

			if castrecovery < 0:
				castrecovery = 0

			delay = float(castrecovery) / 4.0

			char.socket.settag('spell_delay', time.time() + delay)
Example #24
0
def consecratedweapon(defender):
    physical = properties.fromchar(defender, RESISTANCE_PHYSICAL)
    fire = properties.fromchar(defender, RESISTANCE_FIRE)
    cold = properties.fromchar(defender, RESISTANCE_COLD)
    poison = properties.fromchar(defender, RESISTANCE_POISON)
    energy = properties.fromchar(defender, RESISTANCE_ENERGY)

    low = physical
    type = 0

    if fire < low:
        low = fire
        type = 1
    if cold < low:
        low = cold
        type = 2
    if poison < low:
        low = poison
        type = 3
    if energy < low:
        low = energy
        type = 4
    physical = fire = cold = poison = energy = 0

    if type == 0:
        physical = 100
    elif type == 1:
        fire = 100
    elif type == 2:
        cold = 100
    elif type == 3:
        poison = 100
    elif type == 4:
        energy = 100

    return (physical, fire, cold, poison, energy)
Example #25
0
    def scalemana(self, char, mode, mana):
        if mode == MODE_SCROLL:
            mana = (mana + 1) / 2

        scalar = 1.0
        if char.hasscript('magic.mindrot'):
            scalar = 1.25
            if char.npc:
                scalar = 2.0

        # Lower Mana Cost
        lmc = properties.fromchar(char, LOWERMANACOST) / 100.0
        scalar -= lmc / 100

        return max(0, int(mana * scalar))
Example #26
0
	def scalemana(self, char, mode, mana):
		if mode == MODE_SCROLL:
			mana = (mana + 1) / 2

		scalar = 1.0
		if char.hasscript('magic.mindrot'):
			scalar = 1.25
			if char.npc:
				scalar = 2.0

		# Lower Mana Cost
		lmc = properties.fromchar(char, LOWERMANACOST) / 100.0
		scalar -= lmc / 100

		return max(0, int(mana * scalar))
Example #27
0
def consecratedweapon( defender ):
	physical = properties.fromchar(defender, RESISTANCE_PHYSICAL)
	fire = properties.fromchar(defender, RESISTANCE_FIRE)
	cold = properties.fromchar(defender, RESISTANCE_COLD)
	poison = properties.fromchar(defender, RESISTANCE_POISON)
	energy = properties.fromchar(defender, RESISTANCE_ENERGY)

	low = physical
	type = 0

	if fire < low:
		low = fire
		type = 1
	if cold < low:
		low = cold
		type = 2
	if poison < low:
		low = poison
		type = 3
	if energy < low:
		low = energy
		type = 4
	physical = fire = cold = poison = energy = 0

	if type == 0:
		physical = 100
	elif type == 1:
		fire = 100
	elif type == 2:
		cold = 100
	elif type == 3:
		poison = 100
	elif type == 4:
		energy = 100

	return (physical, fire, cold, poison, energy)
Example #28
0
def scaledamage(char, damage, checkskills = 1):
	if checkskills:
		char.checkskill(TACTICS, 0, 1200) # Tactics gain
		char.checkskill(ANATOMY, 0, 1200) # Anatomy gain

	weapon = char.getweapon()

	# Get the total damage bonus this character gets
	bonus = properties.fromchar(char, DAMAGEBONUS)

	# For axes a lumberjacking skill check is made to gain
	# in that skill
	if weapon and weapon.type == 1002:
		if checkskills:
			char.checkskill(LUMBERJACKING, 0, 1000)
		bonus += char.skill[LUMBERJACKING] * 0.02

		# If above grandmaster grant an additional 10% bonus for axe weapon users
		if char.skill[LUMBERJACKING] >= 1000:
			bonus += 10

	# Strength bonus
	bonus += char.strength * 0.3

	# If strength is above 100, grant an extra 5 percent bonus
	if char.strength >= 100:
		bonus += 5

	# Anatomy bonus
	bonus += char.skill[ANATOMY] * 0.05

	# Grant another 5 percent for anatomy grandmasters
	if char.skill[ANATOMY] >= 1000:
		bonus += 5

	# Tactics bonus
	bonus += char.skill[TACTICS] * 0.0625

	# Add another 6.25 percent for grandmasters
	if char.skill[TACTICS] >= 1000:
		bonus += 6.25

	damage = damage + damage * bonus / 100.0
	return max(1, floor(damage))
Example #29
0
def energydamage(target, source, amount, physical=0, fire=0, cold=0, poison=0, energy=0, noreflect=0, damagetype=DAMAGE_MAGICAL, ignorephysical = False):
	if not target:
		raise RuntimeError, "Invalid arguments for energydamage."

	amount = max(1, amount)

	if physical + fire + cold + poison + energy == 0:
		raise RuntimeError, "Invalid arguments for energydamage."

	damage = 0

	if physical > 0:
		physical = amount * (physical / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_PHYSICAL) / 100.0

		if ignorephysical:
			resistance = 0 # Zero resistance

		damage = max(0, physical - (physical * resistance))

		if source and not noreflect and damage > 0:
			reflectphysical = properties.fromchar(target, REFLECTPHYSICAL)
			reflect = reflectphysical / 100.0 * damage

			if reflect > 0:
				energydamage(source, target, reflect, physical=100, noreflect=1)
				#target.effect(0x22c6, 10, 16)
				#target.movingeffect(0x22c6, source, 0, 0, 14)

	if fire > 0:
		fire = amount * (fire / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_FIRE) / 100.0
		damage += max(0, fire - (fire * resistance))

	if cold > 0:
		cold = amount * (cold / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_COLD) / 100.0
		damage += max(0, cold - (cold * resistance))

	if poison > 0:
		poison = amount * (poison / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_POISON) / 100.0
		damage += max(0, poison - (poison * resistance))

	if energy > 0:
		energy = amount * (energy / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_ENERGY) / 100.0
		damage += max(0, energy - (energy * resistance))

	damage = int(max(1, damage))
	return target.damage(damagetype, damage, source)
def energydamage(target, source, amount, physical=0, fire=0, cold=0, poison=0, energy=0, noreflect=0, damagetype=DAMAGE_MAGICAL, ignorephysical = False):
	if not target:
		raise RuntimeError, "Invalid arguments for energydamage."

	amount = max(1, amount)

	if physical + fire + cold + poison + energy == 0:
		raise RuntimeError, "Invalid arguments for energydamage."

	damage = 0

	if physical > 0:
		physical = amount * (physical / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_PHYSICAL) / 100.0

		if ignorephysical:
			resistance = 0 # Zero resistance

		damage = max(0, physical - (physical * resistance))

		if source and not noreflect and damage > 0:
			reflectphysical = properties.fromchar(target, REFLECTPHYSICAL)
			reflect = reflectphysical / 100.0 * damage

			if reflect > 0:
				energydamage(source, target, reflect, physical=100, noreflect=1)
				#target.effect(0x22c6, 10, 16)
				#target.movingeffect(0x22c6, source, 0, 0, 14)

	if fire > 0:
		fire = amount * (fire / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_FIRE) / 100.0
		damage += max(0, fire - (fire * resistance))

	if cold > 0:
		cold = amount * (cold / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_COLD) / 100.0
		damage += max(0, cold - (cold * resistance))

	if poison > 0:
		poison = amount * (poison / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_POISON) / 100.0
		damage += max(0, poison - (poison * resistance))

	if energy > 0:
		energy = amount * (energy / 100.0)
		resistance = properties.fromchar(target, RESISTANCE_ENERGY) / 100.0
		damage += max(0, energy - (energy * resistance))

	damage = max(1, damage)
	return target.damage(damagetype, damage, source)
Example #31
0
    def scaledamage(self, char, target, bonus, dice, sides):
        damage = rolldice(dice, sides, bonus) * 100.0

        bonus = char.skill[INSCRIPTION] / 100.0
        bonus += char.intelligence / 10.0
        spelldamagebonus = properties.fromchar(char, SPELLDAMAGEBONUS)

        # Spell Damage Bonus is capped at 15% against players
        if target and target.player and spelldamagebonus > 15:
            spelldamagebonus = 15

        bonus += spelldamagebonus

        damage *= 1.0 + bonus / 100.0

        char.checkskill(self.damageskill, 0, 1200)
        damage *= (30 + (9 * char.skill[self.damageskill]) / 100.0) / 100.0

        return max(1, int(damage / 100.0))
Example #32
0
	def scaledamage(self, char, target, bonus, dice, sides):
		damage = rolldice(dice, sides, bonus) * 100.0

		bonus = char.skill[INSCRIPTION] / 100.0
		bonus += char.intelligence / 10.0
		spelldamagebonus = properties.fromchar(char, SPELLDAMAGEBONUS)

		# Spell Damage Bonus is capped at 15% against players
		if target and target.player and spelldamagebonus > 15:
			spelldamagebonus = 15

		bonus += spelldamagebonus

		damage *= 1.0 + bonus / 100.0

		char.checkskill(self.damageskill, 0, 1200)
		damage *= (30 + (9 * char.skill[self.damageskill]) / 100.0) / 100.0

		return max(1, int(damage / 100.0))
Example #33
0
def onShowStatus(char, packet):
	damagebonus = properties.fromchar(char, DAMAGEBONUS)

	# Get weapon properties if applicable
	(mindamage, maxdamage) = properties.getdamage(char)

	# Scale damage
	mindamage = int(combat.aos.scaledamage(char, mindamage, 0))
	maxdamage = int(combat.aos.scaledamage(char, maxdamage, 0))

	packet.setshort(62, properties.fromchar(char, RESISTANCE_PHYSICAL)) # Physical resistance
	packet.setshort(70, properties.fromchar(char, RESISTANCE_FIRE)) # Fire Resistance
	packet.setshort(72, properties.fromchar(char, RESISTANCE_COLD)) # Cold Resistance
	packet.setshort(74, properties.fromchar(char, RESISTANCE_POISON)) # Poison Resistance
	packet.setshort(76, properties.fromchar(char, RESISTANCE_ENERGY)) # Energy Resistance
	packet.setshort(78, properties.fromchar(char, LUCK)) # Luck
	packet.setshort(80, mindamage) # Min. Damage
	packet.setshort(82, maxdamage) # Max. Damage
Example #34
0
	def calcdelay(self, char, mode):
		# Wands and commands don't have a delay
		if mode == MODE_WAND or mode == MODE_CMD:
			return 0

		# Get the AOS bonus from all items the character wears
		castspeed = 3 - properties.fromchar(char, CASTSPEEDBONUS)

		# Under the influence of the protection spell
		# spells are cast more slowly
		if char.propertyflags & 0x20000:
			castspeed += 2

		castspeed += self.circle

		if castspeed < 1:
			castspeed = 1

		# Was: floor((delay / 4.0) * 1000)
		#char.message(str(castspeed / 4.0))
		return castspeed * 250
Example #35
0
    def calcdelay(self, char, mode):
        # Wands and commands don't have a delay
        if mode == MODE_WAND or mode == MODE_CMD:
            return False

        # Get the AOS bonus from all items the character wears
        castspeed = 3

        # Under the influence of the protection spell
        # spells are cast more slowly
        if char.propertyflags & 0x20000:
            castspeed += 2

        # Cast Speed Bonus is capped at 2
        castspeed -= min(2, properties.fromchar(char, CASTSPEEDBONUS))

        castspeed += self.castspeed

        if castspeed < 1:
            castspeed = 1

        # Was: floor((delay / 4.0) * 1000)
        #char.message(str(castspeed / 4.0))
        return castspeed * 250
Example #36
0
	def consumereagents(self, char, mode, args=[]):
		if not char.npc and len(self.reagents) > 0:
			lowerreagentcost = properties.fromchar(char, LOWERREAGENTCOST)

			if lowerreagentcost == 0 or lowerreagentcost < random.randint(0, 99):
				consumeReagents(char.getbackpack(), self.reagents.copy())
Example #37
0
	def scalemana(self, char, mode, mana):
		if mode == MODE_SCROLL:
			mana = (mana + 1) / 2

		percent = properties.fromchar(char, LOWERMANACOST) / 100.0
		return max(0, mana - int(percent * float(mana)))
def sendGump( char, args, target ):

	char.socket.closegump( 0x10101010 )

	pages = 3
	page = 1
	if AGEOFSHADOWS:
		pages = 5

	loreGump = cGump ( 0, 0, 0, 250, 50 )
	#page 1
	loreGump.startPage( page )
	loreGump.addGump( 100, 100, 2080 )
	loreGump.addGump( 118, 137, 2081 )
	loreGump.addGump( 118, 207, 2081 )
	loreGump.addGump( 118, 277, 2081 )
	loreGump.addGump( 118, 347, 2083 )
	loreGump.addGump( 140, 137, 2091 )
	loreGump.addGump( 140, 334, 2091 )

	loreGump.addHtmlGump( 147, 108, 210, 18, "<div align=center><i>%s</i></div>" % target.char.name, 0, 0 )

	loreGump.addGump( 128,152, 2086 )
	loreGump.addXmfHtmlGump( 147, 150, 160, 18, 0x1003F9, 0, 0, 200 ) # Attributes

	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003EA, 0, 0, 16000229 ) # Hits
	loreGump.addHtmlGump( 280, 168, 75, 18, "<div align=right>%i/%i</div>" % ( target.char.health, target.char.strength ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 186, 160, 18, 0x1003EB, 0, 0, 16000229 ) # Stamina
	loreGump.addHtmlGump( 280, 186, 75, 18, "<div align=right>%i/%i</div>" % ( target.char.stamina, target.char.dexterity ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 204, 160, 18, 0x1003EC, 0, 0, 16000229 ) # Mana
	loreGump.addHtmlGump( 280, 204, 75, 18, "<div align=right>%i/%i</div>" % ( target.char.mana, target.char.intelligence ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 222, 160, 18, 0xFB0EF, 0, 0, 16000229 ) # Strength
	loreGump.addHtmlGump( 320, 222, 35, 18, "<div align=right>%i</div>" % target.char.strength, 0, 0 )

	loreGump.addXmfHtmlGump( 153, 240, 160, 18, 0x2DC731, 0, 0, 16000229 ) # Dexterity
	loreGump.addHtmlGump( 320, 240, 35, 18, "<div align=right>%i</div>" % target.char.dexterity, 0, 0 )

	loreGump.addXmfHtmlGump( 153, 258, 160, 18, 0x2DC730, 0, 0, 16000229 ) # Intelligence
	loreGump.addHtmlGump( 320, 258, 35, 18, "<div align=right>%i</div>" % target.char.intelligence, 0, 0 )

	loreGump.addGump( 128, 278, 2086 )

	if AGEOFSHADOWS:
		loreGump.addXmfHtmlGump( 147, 276, 160, 18, 1049594, 0, 0, 200 ) # Loyalty Rating

		loyalty = 0
		if target.char.hastag("loyalty"):
			try:
				loyalty = int(target.char.gettag("loyalty"))
			except:
				loyalty = 0

		if not target.char.tamed:
			loreGump.addXmfHtmlGump( 153, 294, 160, 18, 1061643, 0, 0, 16000229 ) # Wild
		else:
			loreGump.addXmfHtmlGump( 153, 294, 160, 18, int(1049594 + loyalty), 0, 0, 16000229 )

	else:
		loreGump.addXmfHtmlGump( 147, 276, 160, 18, 0x2DCAB8, 0, 0, 200 ) # Miscellaneous

		#loreGump.addXmfHtmlGump( 153, 294, 160, 18, 0x1003ED, 0, 0, 16000229 ) # Armor Rating
		#loreGump.addHtmlGump( 320, 294, 35, 18, "<div align=right>%i</div>" % target.char.defense, 0, 0 )

	loreGump.addPageButton( 340, 358, 0x15E1, 0x15E5, page + 1 )
	loreGump.addPageButton( 317, 358, 0x15E3, 0x15E7, pages )

	# Resistances
	if AGEOFSHADOWS:
		page += 1
		loreGump.startPage( page )
		loreGump.addGump( 100, 100, 2080 )
		loreGump.addGump( 118, 137, 2081 )
		loreGump.addGump( 118, 207, 2081 )
		loreGump.addGump( 118, 277, 2081 )
		loreGump.addGump( 118, 347, 2083 )
		loreGump.addGump( 140, 137, 2091 )
		loreGump.addGump( 140, 334, 2091 )

		loreGump.addHtmlGump( 147, 108, 210, 18, "<div align=center><i>%s</i></center>" % target.char.name, 0, 0 )

		loreGump.addGump( 128, 152, 2086 )
		loreGump.addXmfHtmlGump( 147, 150, 160, 18, 1061645, 0, 0, 200 ) # Resistances

		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 1061646, 0, 0, 16000229 ) # Physical
		loreGump.addHtmlGump( 280, 168, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, RESISTANCE_PHYSICAL), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 186, 160, 18, 1061647, 0, 0, 16000229 ) # Fire
		loreGump.addHtmlGump( 280, 186, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, RESISTANCE_FIRE), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 204, 160, 18, 1061648, 0, 0, 16000229 ) # Cold
		loreGump.addHtmlGump( 280, 204, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, RESISTANCE_COLD), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 222, 160, 18, 1061649, 0, 0, 16000229 ) # Poison
		loreGump.addHtmlGump( 280, 222, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, RESISTANCE_POISON), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 240, 160, 18, 1061650, 0, 0, 16000229 ) # Energy
		loreGump.addHtmlGump( 280, 240, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, RESISTANCE_ENERGY), 0, 0 )

		loreGump.addPageButton( 340, 358, 0x15E1, 0x15E5, page + 1 )
		loreGump.addPageButton( 317, 358, 0x15E3, 0x15E7, page - 1 )

	# Damage
	if AGEOFSHADOWS:
		page += 1
		loreGump.startPage( page )
		loreGump.addGump( 100, 100, 2080 )
		loreGump.addGump( 118, 137, 2081 )
		loreGump.addGump( 118, 207, 2081 )
		loreGump.addGump( 118, 277, 2081 )
		loreGump.addGump( 118, 347, 2083 )
		loreGump.addGump( 140, 137, 2091 )
		loreGump.addGump( 140, 334, 2091 )

		loreGump.addHtmlGump( 147, 108, 210, 18, "<div align=center><i>%s</i></center>" % target.char.name, 0, 0 )

		loreGump.addGump( 128, 152, 2086 )
		loreGump.addXmfHtmlGump( 147, 150, 160, 18, 1017319, 0, 0, 200 ) # Damage

		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 1061646, 0, 0, 16000229 ) # Physical
		loreGump.addHtmlGump( 280, 168, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_PHYSICAL), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 186, 160, 18, 1061647, 0, 0, 16000229 ) # Fire
		loreGump.addHtmlGump( 280, 186, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_FIRE), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 204, 160, 18, 1061648, 0, 0, 16000229 ) # Cold
		loreGump.addHtmlGump( 280, 204, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_COLD), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 222, 160, 18, 1061649, 0, 0, 16000229 ) # Poison
		loreGump.addHtmlGump( 280, 222, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_POISON), 0, 0 )

		loreGump.addXmfHtmlGump( 153, 240, 160, 18, 1061650, 0, 0, 16000229 ) # Energy
		loreGump.addHtmlGump( 280, 240, 75, 18, "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_ENERGY), 0, 0 )

		loreGump.addPageButton( 340, 358, 0x15E1, 0x15E5, page + 1 )
		loreGump.addPageButton( 317, 358, 0x15E3, 0x15E7, page - 1 )

	# Skills
	page += 1
	loreGump.startPage( page )
	loreGump.addGump( 100, 100, 2080 )
	loreGump.addGump( 118, 137, 2081 )
	loreGump.addGump( 118, 207, 2081 )
	loreGump.addGump( 118, 277, 2081 )
	loreGump.addGump( 118, 347, 2083 )
	loreGump.addGump( 140, 137, 2091 )
	loreGump.addGump( 140, 334, 2091 )

	loreGump.addHtmlGump( 147, 108, 210, 18, "<div align=center><i>%s</i></center>" % target.char.name, 0, 0 )

	loreGump.addGump( 128,152, 2086 )
	loreGump.addXmfHtmlGump( 147, 150, 160, 18, 0x2DCAC6, 0, 0, 200 ) # Combat Ratings

	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0xFEE87, 0, 0, 16000229 ) # Wrestling
	loreGump.addHtmlGump( 280, 168, 75, 18, "<div align=right>%.1f</div>" %( target.char.skill[ WRESTLING ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 186, 160, 18, 0xFEE77, 0, 0, 16000229 ) # Tactics
	loreGump.addHtmlGump( 280, 186, 75, 18, "<div align=right>%.1f</div>" %( target.char.skill[ TACTICS ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 204, 160, 18, 0xFEE76, 0, 0, 16000229 ) # Magic Resistance
	loreGump.addHtmlGump( 280, 204, 75, 18, "<div align=right>%.1f</div>" %( target.char.skill[ MAGICRESISTANCE ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 222, 160, 18, 0xFEE5D, 0, 0, 16000229 ) # Anatomy
	loreGump.addHtmlGump( 280, 222, 75, 18, "<div align=right>%.1f</div>" %( target.char.skill[ ANATOMY ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 240, 160, 18, 0xFEE7A, 0, 0, 16000229 ) # Poisoning

	if char.poison > 0:
		loreGump.addHtmlGump( 280, 240, 75, 18, "<div align=right>%.1f</div>" %( target.char.skill[ POISONING ] / 10.0 ), 0, 0 )
	else:
		loreGump.addHtmlGump( 280, 240, 75, 18, "<div align=right>--</div>", 0, 0 )

	loreGump.addGump( 128, 260, 2086 )
	loreGump.addXmfHtmlGump( 147, 256, 160, 18, 0x2DCAC8, 0, 0, 200 ) # Lore and Knowledge

	loreGump.addXmfHtmlGump( 153, 276, 160, 18, 0xFEE75, 0, 0, 16000229 ) # Magery
	loreGump.addHtmlGump( 280, 276, 75, 18, "<div align=right>%.1f</div>" % ( target.char.skill[ MAGERY ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 294, 160, 18, 0xFEE6C, 0, 0, 16000229 ) # Evaluating Intelligence
	loreGump.addHtmlGump( 280, 294, 75, 18, "<div align=right>%.1f</div>" % ( target.char.skill[ EVALUATINGINTEL ] / 10.0 ), 0, 0 )

	loreGump.addXmfHtmlGump( 153, 312, 160, 18, 0xFEE8A, 0, 0, 16000229 ) # Meditation
	loreGump.addHtmlGump( 280, 312, 75, 18, "<div align=right>%.1f</div>" % ( target.char.skill[ MEDITATION ] / 10.0 ), 0, 0 )

	loreGump.addPageButton( 340, 358, 0x15E1, 0x15E5, page + 1 )
	loreGump.addPageButton( 317, 358, 0x15E3, 0x15E7, page - 1 )

	# Misc
	page += 1
	loreGump.startPage( page )
	loreGump.addGump( 100, 100, 2080 )
	loreGump.addGump( 118, 137, 2081 )
	loreGump.addGump( 118, 207, 2081 )
	loreGump.addGump( 118, 277, 2081 )
	loreGump.addGump( 118, 347, 2083 )
	loreGump.addGump( 140, 137, 2091 )
	loreGump.addGump( 140, 334, 2091 )

	loreGump.addHtmlGump( 147, 108, 210, 18, "<div align=center><i>%s</i></center>" % target.char.name, 0, 0 )

	loreGump.addGump( 128, 152, 2086 )
	loreGump.addXmfHtmlGump( 147, 150, 160, 18, 0x1003DB, 0, 0, 200 ) # Preferred Foods
	foodtype = target.char.getstrproperty("food", "")
	foodtype = foodtype.split(",")
	if '3' in foodtype:
		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DD, 0, 0, 16000229 ) # Fruits and Vegetables
	elif '5' in foodtype:
		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DE, 0, 0, 16000229 ) # Grains and Hay
	elif '2' in foodtype:
		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003E0, 0, 0, 16000229 ) # Fish
	elif '1' in foodtype:
		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DC, 0, 0, 16000229 ) # Meat
	#elif '4' in foodtype:
	#	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DD, 0, 0, 16000229 ) # Eggs
	#elif target.food == 13:
	#	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DF, 0, 0, 16000229 ) # Metal
	else:
		loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0xF6D6B, 0, 0, 16000229 ) # None

	loreGump.addGump( 128, 188, 2086 )

	loreGump.addXmfHtmlGump( 147, 186, 160, 18, 0x1003E1, 0, 0, 200 ) # Pack Instinct
	packinstinct = target.char.getstrproperty("packinstinct", "").lower()
	packInstinct = 3000340 # None
	if packinstinct == "canine":
		packInstinct = 1049570 # Canine
	elif packinstinct == "ostard":
		packInstinct = 1049571 # Ostard
	elif packinstinct == "feline":
		packInstinct = 1049572 # Feline
	elif packinstinct == "arachnid":
		packInstinct = 1049573 # Arachnid
	elif packinstinct == "daemon":
		packInstinct = 1049574 # Daemon
	elif packinstinct == "bear":
		packInstinct = 1049575 # Bear
	elif packinstinct == "equine":
		packInstinct = 1049576 # Equine
	elif packinstinct == "bull":
		packInstinct = 1049577 # Bull
	loreGump.addXmfHtmlGump( 153, 204, 160, 18, packInstinct, 0, 0, 16000229 )

	loreGump.addGump( 128, 226, 2086 )

	loreGump.addXmfHtmlGump( 153, 222, 160, 18, 1049594, 0, 0, 200 ) # Loyalty Rating

	loyalty = 0
	if target.char.hastag("loyalty"):
		try:
			loyalty = int(target.char.gettag("loyalty"))
		except:
			loyalty = 0

	if not target.char.tamed:
		loreGump.addXmfHtmlGump( 153, 294, 160, 18, 1061643, 0, 0, 16000229 ) # Wild
	else:
		loreGump.addXmfHtmlGump( 153, 240, 160, 18, int(1049594 + loyalty), 0, 0, 16000229 ) # Wonderfully happy

	loreGump.addPageButton( 340, 358, 0x15E1, 0x15E5, 1 )
	loreGump.addPageButton( 317, 358, 0x15E3, 0x15E7, page - 1 )

	loreGump.setArgs( [target] )
	loreGump.setType( 0x10101010 )
	loreGump.send( char )

	char.socket.settag( 'skill_delay', int( wolfpack.time.currenttime() + ANIMALLORE_DELAY ) )
Example #39
0
def sendGump(char, args, target):

    char.socket.closegump(0x10101010)

    pages = 3
    page = 1
    if AGEOFSHADOWS:
        pages = 5

    loreGump = cGump(0, 0, 0, 250, 50)
    #page 1
    loreGump.startPage(page)
    loreGump.addGump(100, 100, 2080)
    loreGump.addGump(118, 137, 2081)
    loreGump.addGump(118, 207, 2081)
    loreGump.addGump(118, 277, 2081)
    loreGump.addGump(118, 347, 2083)
    loreGump.addGump(140, 137, 2091)
    loreGump.addGump(140, 334, 2091)

    loreGump.addHtmlGump(
        147, 108, 210, 18,
        "<div align=center><i>%s</i></div>" % target.char.name, 0, 0)

    loreGump.addGump(128, 152, 2086)
    loreGump.addXmfHtmlGump(147, 150, 160, 18, 0x1003F9, 0, 0,
                            200)  # Attributes

    loreGump.addXmfHtmlGump(153, 168, 160, 18, 0x1003EA, 0, 0,
                            16000229)  # Hits
    loreGump.addHtmlGump(
        280, 168, 75, 18, "<div align=right>%i/%i</div>" %
        (target.char.health, target.char.strength), 0, 0)

    loreGump.addXmfHtmlGump(153, 186, 160, 18, 0x1003EB, 0, 0,
                            16000229)  # Stamina
    loreGump.addHtmlGump(
        280, 186, 75, 18, "<div align=right>%i/%i</div>" %
        (target.char.stamina, target.char.dexterity), 0, 0)

    loreGump.addXmfHtmlGump(153, 204, 160, 18, 0x1003EC, 0, 0,
                            16000229)  # Mana
    loreGump.addHtmlGump(
        280, 204, 75, 18, "<div align=right>%i/%i</div>" %
        (target.char.mana, target.char.intelligence), 0, 0)

    loreGump.addXmfHtmlGump(153, 222, 160, 18, 0xFB0EF, 0, 0,
                            16000229)  # Strength
    loreGump.addHtmlGump(320, 222, 35, 18,
                         "<div align=right>%i</div>" % target.char.strength, 0,
                         0)

    loreGump.addXmfHtmlGump(153, 240, 160, 18, 0x2DC731, 0, 0,
                            16000229)  # Dexterity
    loreGump.addHtmlGump(320, 240, 35, 18,
                         "<div align=right>%i</div>" % target.char.dexterity,
                         0, 0)

    loreGump.addXmfHtmlGump(153, 258, 160, 18, 0x2DC730, 0, 0,
                            16000229)  # Intelligence
    loreGump.addHtmlGump(
        320, 258, 35, 18,
        "<div align=right>%i</div>" % target.char.intelligence, 0, 0)

    loreGump.addGump(128, 278, 2086)

    if AGEOFSHADOWS:
        loreGump.addXmfHtmlGump(147, 276, 160, 18, 1049594, 0, 0,
                                200)  # Loyalty Rating

        loyalty = 0
        if target.char.hastag("loyalty"):
            try:
                loyalty = int(target.char.gettag("loyalty"))
            except:
                loyalty = 0

        if not target.char.tamed:
            loreGump.addXmfHtmlGump(153, 294, 160, 18, 1061643, 0, 0,
                                    16000229)  # Wild
        else:
            loreGump.addXmfHtmlGump(153, 294, 160, 18, int(1049594 + loyalty),
                                    0, 0, 16000229)

    else:
        loreGump.addXmfHtmlGump(147, 276, 160, 18, 0x2DCAB8, 0, 0,
                                200)  # Miscellaneous

        #loreGump.addXmfHtmlGump( 153, 294, 160, 18, 0x1003ED, 0, 0, 16000229 ) # Armor Rating
        #loreGump.addHtmlGump( 320, 294, 35, 18, "<div align=right>%i</div>" % target.char.defense, 0, 0 )

    loreGump.addPageButton(340, 358, 0x15E1, 0x15E5, page + 1)
    loreGump.addPageButton(317, 358, 0x15E3, 0x15E7, pages)

    # Resistances
    if AGEOFSHADOWS:
        page += 1
        loreGump.startPage(page)
        loreGump.addGump(100, 100, 2080)
        loreGump.addGump(118, 137, 2081)
        loreGump.addGump(118, 207, 2081)
        loreGump.addGump(118, 277, 2081)
        loreGump.addGump(118, 347, 2083)
        loreGump.addGump(140, 137, 2091)
        loreGump.addGump(140, 334, 2091)

        loreGump.addHtmlGump(
            147, 108, 210, 18,
            "<div align=center><i>%s</i></center>" % target.char.name, 0, 0)

        loreGump.addGump(128, 152, 2086)
        loreGump.addXmfHtmlGump(147, 150, 160, 18, 1061645, 0, 0,
                                200)  # Resistances

        loreGump.addXmfHtmlGump(153, 168, 160, 18, 1061646, 0, 0,
                                16000229)  # Physical
        loreGump.addHtmlGump(
            280, 168, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, RESISTANCE_PHYSICAL), 0, 0)

        loreGump.addXmfHtmlGump(153, 186, 160, 18, 1061647, 0, 0,
                                16000229)  # Fire
        loreGump.addHtmlGump(
            280, 186, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, RESISTANCE_FIRE), 0, 0)

        loreGump.addXmfHtmlGump(153, 204, 160, 18, 1061648, 0, 0,
                                16000229)  # Cold
        loreGump.addHtmlGump(
            280, 204, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, RESISTANCE_COLD), 0, 0)

        loreGump.addXmfHtmlGump(153, 222, 160, 18, 1061649, 0, 0,
                                16000229)  # Poison
        loreGump.addHtmlGump(
            280, 222, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, RESISTANCE_POISON), 0, 0)

        loreGump.addXmfHtmlGump(153, 240, 160, 18, 1061650, 0, 0,
                                16000229)  # Energy
        loreGump.addHtmlGump(
            280, 240, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, RESISTANCE_ENERGY), 0, 0)

        loreGump.addPageButton(340, 358, 0x15E1, 0x15E5, page + 1)
        loreGump.addPageButton(317, 358, 0x15E3, 0x15E7, page - 1)

    # Damage
    if AGEOFSHADOWS:
        page += 1
        loreGump.startPage(page)
        loreGump.addGump(100, 100, 2080)
        loreGump.addGump(118, 137, 2081)
        loreGump.addGump(118, 207, 2081)
        loreGump.addGump(118, 277, 2081)
        loreGump.addGump(118, 347, 2083)
        loreGump.addGump(140, 137, 2091)
        loreGump.addGump(140, 334, 2091)

        loreGump.addHtmlGump(
            147, 108, 210, 18,
            "<div align=center><i>%s</i></center>" % target.char.name, 0, 0)

        loreGump.addGump(128, 152, 2086)
        loreGump.addXmfHtmlGump(147, 150, 160, 18, 1017319, 0, 0,
                                200)  # Damage

        loreGump.addXmfHtmlGump(153, 168, 160, 18, 1061646, 0, 0,
                                16000229)  # Physical
        loreGump.addHtmlGump(
            280, 168, 75, 18, "<div align=right>%s</div>" %
            fromchar(target.char, DAMAGE_PHYSICAL), 0, 0)

        loreGump.addXmfHtmlGump(153, 186, 160, 18, 1061647, 0, 0,
                                16000229)  # Fire
        loreGump.addHtmlGump(
            280, 186, 75, 18,
            "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_FIRE),
            0, 0)

        loreGump.addXmfHtmlGump(153, 204, 160, 18, 1061648, 0, 0,
                                16000229)  # Cold
        loreGump.addHtmlGump(
            280, 204, 75, 18,
            "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_COLD),
            0, 0)

        loreGump.addXmfHtmlGump(153, 222, 160, 18, 1061649, 0, 0,
                                16000229)  # Poison
        loreGump.addHtmlGump(
            280, 222, 75, 18,
            "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_POISON),
            0, 0)

        loreGump.addXmfHtmlGump(153, 240, 160, 18, 1061650, 0, 0,
                                16000229)  # Energy
        loreGump.addHtmlGump(
            280, 240, 75, 18,
            "<div align=right>%s</div>" % fromchar(target.char, DAMAGE_ENERGY),
            0, 0)

        loreGump.addPageButton(340, 358, 0x15E1, 0x15E5, page + 1)
        loreGump.addPageButton(317, 358, 0x15E3, 0x15E7, page - 1)

    # Skills
    page += 1
    loreGump.startPage(page)
    loreGump.addGump(100, 100, 2080)
    loreGump.addGump(118, 137, 2081)
    loreGump.addGump(118, 207, 2081)
    loreGump.addGump(118, 277, 2081)
    loreGump.addGump(118, 347, 2083)
    loreGump.addGump(140, 137, 2091)
    loreGump.addGump(140, 334, 2091)

    loreGump.addHtmlGump(
        147, 108, 210, 18,
        "<div align=center><i>%s</i></center>" % target.char.name, 0, 0)

    loreGump.addGump(128, 152, 2086)
    loreGump.addXmfHtmlGump(147, 150, 160, 18, 0x2DCAC6, 0, 0,
                            200)  # Combat Ratings

    loreGump.addXmfHtmlGump(153, 168, 160, 18, 0xFEE87, 0, 0,
                            16000229)  # Wrestling
    loreGump.addHtmlGump(
        280, 168, 75, 18,
        "<div align=right>%.1f</div>" % (target.char.skill[WRESTLING] / 10.0),
        0, 0)

    loreGump.addXmfHtmlGump(153, 186, 160, 18, 0xFEE77, 0, 0,
                            16000229)  # Tactics
    loreGump.addHtmlGump(
        280, 186, 75, 18,
        "<div align=right>%.1f</div>" % (target.char.skill[TACTICS] / 10.0), 0,
        0)

    loreGump.addXmfHtmlGump(153, 204, 160, 18, 0xFEE76, 0, 0,
                            16000229)  # Magic Resistance
    loreGump.addHtmlGump(
        280, 204, 75, 18, "<div align=right>%.1f</div>" %
        (target.char.skill[MAGICRESISTANCE] / 10.0), 0, 0)

    loreGump.addXmfHtmlGump(153, 222, 160, 18, 0xFEE5D, 0, 0,
                            16000229)  # Anatomy
    loreGump.addHtmlGump(
        280, 222, 75, 18,
        "<div align=right>%.1f</div>" % (target.char.skill[ANATOMY] / 10.0), 0,
        0)

    loreGump.addXmfHtmlGump(153, 240, 160, 18, 0xFEE7A, 0, 0,
                            16000229)  # Poisoning

    if char.poison > 0:
        loreGump.addHtmlGump(
            280, 240, 75, 18, "<div align=right>%.1f</div>" %
            (target.char.skill[POISONING] / 10.0), 0, 0)
    else:
        loreGump.addHtmlGump(280, 240, 75, 18, "<div align=right>--</div>", 0,
                             0)

    loreGump.addGump(128, 260, 2086)
    loreGump.addXmfHtmlGump(147, 256, 160, 18, 0x2DCAC8, 0, 0,
                            200)  # Lore and Knowledge

    loreGump.addXmfHtmlGump(153, 276, 160, 18, 0xFEE75, 0, 0,
                            16000229)  # Magery
    loreGump.addHtmlGump(
        280, 276, 75, 18,
        "<div align=right>%.1f</div>" % (target.char.skill[MAGERY] / 10.0), 0,
        0)

    loreGump.addXmfHtmlGump(153, 294, 160, 18, 0xFEE6C, 0, 0,
                            16000229)  # Evaluating Intelligence
    loreGump.addHtmlGump(
        280, 294, 75, 18, "<div align=right>%.1f</div>" %
        (target.char.skill[EVALUATINGINTEL] / 10.0), 0, 0)

    loreGump.addXmfHtmlGump(153, 312, 160, 18, 0xFEE8A, 0, 0,
                            16000229)  # Meditation
    loreGump.addHtmlGump(
        280, 312, 75, 18,
        "<div align=right>%.1f</div>" % (target.char.skill[MEDITATION] / 10.0),
        0, 0)

    loreGump.addPageButton(340, 358, 0x15E1, 0x15E5, page + 1)
    loreGump.addPageButton(317, 358, 0x15E3, 0x15E7, page - 1)

    # Misc
    page += 1
    loreGump.startPage(page)
    loreGump.addGump(100, 100, 2080)
    loreGump.addGump(118, 137, 2081)
    loreGump.addGump(118, 207, 2081)
    loreGump.addGump(118, 277, 2081)
    loreGump.addGump(118, 347, 2083)
    loreGump.addGump(140, 137, 2091)
    loreGump.addGump(140, 334, 2091)

    loreGump.addHtmlGump(
        147, 108, 210, 18,
        "<div align=center><i>%s</i></center>" % target.char.name, 0, 0)

    loreGump.addGump(128, 152, 2086)
    loreGump.addXmfHtmlGump(147, 150, 160, 18, 0x1003DB, 0, 0,
                            200)  # Preferred Foods
    foodtype = target.char.getstrproperty("food", "")
    foodtype = foodtype.split(",")
    if '3' in foodtype:
        loreGump.addXmfHtmlGump(153, 168, 160, 18, 0x1003DD, 0, 0,
                                16000229)  # Fruits and Vegetables
    elif '5' in foodtype:
        loreGump.addXmfHtmlGump(153, 168, 160, 18, 0x1003DE, 0, 0,
                                16000229)  # Grains and Hay
    elif '2' in foodtype:
        loreGump.addXmfHtmlGump(153, 168, 160, 18, 0x1003E0, 0, 0,
                                16000229)  # Fish
    elif '1' in foodtype:
        loreGump.addXmfHtmlGump(153, 168, 160, 18, 0x1003DC, 0, 0,
                                16000229)  # Meat
    #elif '4' in foodtype:
    #	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DD, 0, 0, 16000229 ) # Eggs
    #elif target.food == 13:
    #	loreGump.addXmfHtmlGump( 153, 168, 160, 18, 0x1003DF, 0, 0, 16000229 ) # Metal
    else:
        loreGump.addXmfHtmlGump(153, 168, 160, 18, 0xF6D6B, 0, 0,
                                16000229)  # None

    loreGump.addGump(128, 188, 2086)

    loreGump.addXmfHtmlGump(147, 186, 160, 18, 0x1003E1, 0, 0,
                            200)  # Pack Instinct
    packinstinct = target.char.getstrproperty("packinstinct", "").lower()
    packInstinct = 3000340  # None
    if packinstinct == "canine":
        packInstinct = 1049570  # Canine
    elif packinstinct == "ostard":
        packInstinct = 1049571  # Ostard
    elif packinstinct == "feline":
        packInstinct = 1049572  # Feline
    elif packinstinct == "arachnid":
        packInstinct = 1049573  # Arachnid
    elif packinstinct == "daemon":
        packInstinct = 1049574  # Daemon
    elif packinstinct == "bear":
        packInstinct = 1049575  # Bear
    elif packinstinct == "equine":
        packInstinct = 1049576  # Equine
    elif packinstinct == "bull":
        packInstinct = 1049577  # Bull
    loreGump.addXmfHtmlGump(153, 204, 160, 18, packInstinct, 0, 0, 16000229)

    loreGump.addGump(128, 226, 2086)

    loreGump.addXmfHtmlGump(153, 222, 160, 18, 1049594, 0, 0,
                            200)  # Loyalty Rating

    loyalty = 0
    if target.char.hastag("loyalty"):
        try:
            loyalty = int(target.char.gettag("loyalty"))
        except:
            loyalty = 0

    if not target.char.tamed:
        loreGump.addXmfHtmlGump(153, 294, 160, 18, 1061643, 0, 0,
                                16000229)  # Wild
    else:
        loreGump.addXmfHtmlGump(153, 240, 160, 18, int(1049594 + loyalty), 0,
                                0, 16000229)  # Wonderfully happy

    loreGump.addPageButton(340, 358, 0x15E1, 0x15E5, 1)
    loreGump.addPageButton(317, 358, 0x15E3, 0x15E7, page - 1)

    loreGump.setArgs([target])
    loreGump.setType(0x10101010)
    loreGump.send(char)

    char.socket.settag('skill_delay',
                       int(wolfpack.time.currenttime() + ANIMALLORE_DELAY))