objects

package
v0.0.0-...-5996917 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StyleNone = iota
	StyleStat
)

Variables

View Source
var (
	TeleportTable = []int{117, 2567,
		2538,
		2530,
		2761,
		2740,
		2508,
		2698,
		1963,
		369,
		2483,
		2913,
		2130,
		2253,
		2699,

		2696,
		848,
		1750,
		1831,
		1864,
		1858,
		2104,
		2182,
		2216,
		2375,
		513,
		2015,
		1991,
		2868,
	}
	RecallRoom = "77"
)
View Source
var (
	Rooms = map[int]*Room{}
	Mobs  = map[int]*Mob{}
	Items = map[int]*Item{}

	CurrentDay   = 0
	YearPlus     = 0
	CurrentMonth = 0
	DayOfMonth   = 0
	CurrentHour  = 0

	WorldTicker       *time.Ticker
	WorldTickerUnload = make(chan bool)

	DayTime = false
)

Rooms contains all the world rooms tagged with their room_id This makes it very simple to move people by room_id and retain their connecting exit

View Source
var (
	Script             func(o *Character, input string) string
	RoomsPendingUpdate []int
)

Create a bind variable

View Source
var (
	ActivateRoom func(roomId int)
)
View Source
var ActiveCharacters = &characterStats{}
View Source
var AmbiguousTargets = []string{
	"attraction",
}
View Source
var (
	DiscordSession *discordgo.Session
)

Variables used for command line parameters

View Source
var Effects = map[string]func(caller interface{}, target interface{}, magnitude int) string{
	"poison":           poison,
	"disease":          disease,
	"blind":            blind,
	"berserk":          berserk,
	"haste":            haste,
	"pray":             pray,
	"heal-stam":        healstam,
	"heal-vit":         healvit,
	"restore":          restore,
	"heal":             heal,
	"heal-all":         healall,
	"fire-damage":      firedamage,
	"earth-damage":     earthdamage,
	"air-damage":       airdamage,
	"water-damage":     waterdamage,
	"light":            light,
	"curepoison":       curepoison,
	"bless":            bless,
	"protection":       protection,
	"invisibility":     invisibility,
	"detect-invisible": detectInvisible,
	"teleport":         teleport,
	"stun":             stun,
	"recall":           recall,
	"summon":           summon,
	"wizard-walk":      wizardwalk,
	"levitate":         levitate,
	"resist-fire":      resistfire,
	"resist-magic":     resistmagic,

	"resist-air":       resistair,
	"resist-water":     resistwater,
	"resist-earth":     resistearth,
	"remove-disease":   removedisease,
	"remove-blindness": cureblindness,

	"attraction":       attraction,
	"inertial-barrier": inertialbarrier,
	"surge":            surge,
	"resist-poison":    resistpoison,
	"resilient-aura":   resilientaura,
	"resist-disease":   resistdisease,
	"disrupt-magic":    disruptmagic,
	"reflection":       reflection,
	"dodge":            dodge,
	"resist-acid":      resistacid,
}
View Source
var HealingSpells = []string{
	"vigor",
	"mend",
	"heal",
	"restore",
	"detraumatize",
	"renewal",
}
View Source
var IpMap = make(map[string]string)
View Source
var LastActivity = map[string]time.Time{}
View Source
var MiscSpells = []string{
	"teleport",
	"stun",
	"word of recall",
	"summon",
	"wizard-walk",
	"levitate",
	"attraction",
}
View Source
var MobSupportSpells = []string{
	"protection",
	"resist-fire",
	"resist-magic",
	"resist-air",
	"resist-water",
	"resist-earth",
	"inertial-barrier",
	"reflection",
}
View Source
var OffensiveSpells = []string{
	"hurt",
	"rumble",
	"burn",
	"blister",
	"dustgust",
	"stonecrush",
	"fireball",
	"waterbolt",
	"shockbolt",
	"shatterstone",
	"burstflame",
	"steamblast",
	"lightning",
	"engulf",
	"immolate",
	"bloodboil",
	"thunderbolt",
	"earthquake",
	"flamefill",
	"iceblade",
	"inferno",
	"acidify",
	"thunderstorm",
	"frostspikes",
	"venom",
	"hellfire",
	"disintegrate",
	"ionize",
	"frostbite",
	"putrify",
	"disrupt-magic",
}
View Source
var RemoteSpells = []string{
	"summon",
	"wizard-walk",
}
View Source
var SongEffects = map[string]song{
	"draens-tale":       {"players", DraensTale},
	"run-away":          {"mobs", RunAway},
	"sweet-comfort":     {"mobs", SweetComfort},
	"curious-canticle":  {"mobs", CuriousCanticle},
	"celebration-night": {"players", CelebrationNight},
	"champions-anthem":  {"players", ChampionsAnthem},
	"banshees-lament":   {"mobs", BansheesLament},
}
View Source
var Songs = map[string]map[string]string{
	"celebration-night": {
		"desc":   "Hastens stamina and vitality regeneration on players in the area.",
		"verse":  " let your spirits soar on the wings of eagles, let music wash the sleep from your eyes.",
		"effect": "celebration-night",
	},
	"curious-canticle": {
		"desc":   "prevents creatures from following anyone in the area.",
		"verse":  " now curious, get it in your head, if you follow me, then you'll be dead.",
		"effect": "curious-canticle",
	},
	"sweet-comfort": {
		"desc":   "comforts creatures, lulling them so they will not flee.",
		"verse":  " relax, my child, sleep and dream, for things aren't as bad as they seem.",
		"effect": "sweet-comfort",
	},
	"run-run-away": {
		"desc":   "lulls creatures so that they will not block escape.",
		"verse":  "see chameleon, lying there in the sun, all things to everyone, run, run away.",
		"effect": "run-away",
	},
	"draens-tale": {
		"desc":   "increases the the mana regeneration of everyone present in the area.",
		"verse":  "draen, throw your spells anew, know the weave will answer you.",
		"effect": "draens-tale",
	},

	"champions-anthem": {
		"desc":   "increases the melee damage output of all players in the area.",
		"verse":  "feel thy strength swell, with every swing, feel the power of my hymn",
		"effect": "champions-anthem",
	},
	"banshees-lament": {
		"desc":   "causes damage periodically to all creatures in the area.",
		"verse":  "hear my song, hear my sorrow, feel my will tear you apart",
		"effect": "banshees-lament",
	},
}
View Source
var Spells = map[string]Spell{
	"vigor": {
		Name:        "vigor",
		Description: "the vigor spell refreshes its target. when casting the spell, the caster pretends to be throwing a splash of water on the target while speaking the spell Chant. the target then feels his exhaustion wash away, and is able to fight with renewed energy. as healing is the province of the gods, like all life magic, clerics and paladins excel at casting this spell. bards, who dabble in everything, are also quite able vigor casters.",
		Cost:        2,
		Chant:       "Thy energies return!",
		Magnitude:   1,
		Effect:      "heal-stam",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "paladin": 1, "ranger": 1, "bard": 1, "thief": 1, "monk": 1},
	},
	"mend": {
		Name:        "mend",
		Description: "the mend spell causes the wounds of the target to mend, by magically accelerating the body's natural healing process. when casting the spell, the caster pretends to be bandaging a wound on himself while pointing at the target and speaking the spell Chant. the target's wounds will begin to knit and close, allowing the target to fight on as the damage becomes a dim memory. as healing is the province of the gods, like all life magic, clerics and paladins excel at casting this spell. bards, who dabble in everything, are quite able casters of this spell as well.",
		Cost:        4,
		Chant:       "Ease thy pain, knit thy flesh.",
		Magnitude:   1,
		Effect:      "heal-vit",
		Classes:     map[string]int{"cleric": 3, "mage": 4, "paladin": 3, "ranger": 4, "bard": 3, "thief": 4, "monk": 5},
	},
	"heal": {
		Name:        "heal",
		Description: "the heal spell is the single most powerful application of healing magic a mortal is capable of. while the cost is great, so are the benefits. the heal spell causes it's recipient's body to be completely restored of health and stamina, stopping only in the cure of afflictions. for this reason, people capable of casting the spell as well as devices charged with it are in great demand. to cast, the caster must clear their mind completely, and focus only on the energies they are gathering as they speak the spell Chant. the caster will begin to glow from the healing energies, until they touch their target, passing the glow to them. at that point, the target's wounds and fatigue wash away as the energy passes over them. this spell is limited in nature, because it is so demanding of the caster. as such, each caster may only use this spell a few times each day, else risk death, as they attempt to gather energies that their mortal forms cannot handle. ",
		Cost:        30,
		Chant:       "Thy wounds be mended, thy pain be gone.",
		Magnitude:   1,
		Effect:      "heal-all",
		Classes:     map[string]int{"cleric": 8, "paladin": 12},
	},
	"restore": {
		Name:        "restore",
		Description: "A specialized use of power from the weave of life by clerics and bards.  The spell causes energy to build around the target and absorb into them restoring their mana.  The confluence of energies required to restore mana to the target prevents the caster from using this spell on themselves.",
		Cost:        30,
		Chant:       "Mystical energy build and return!",
		Magnitude:   1,
		Effect:      "restore",
		Classes:     map[string]int{"bard": 14, "cleric": 13},
	},
	"detraumatize": {
		Name:        "detraumatize",
		Description: "the spell calls directly upon the caster's (who must be cleric, paladin or bard) faith to power the spell, drawing into the caster a small portion of the power of their deity. the caster yells their deity's name, and concentrates inwardly upon the power of the their faith. as they do, a visible aura surrounds them, as the strong healing energies fill their being. the caster then need only point their hands at the target, who can be up to three zones away. the target's pain and tiredness are washed away as the spell instantly knits bone and tissue, attempting to render the target whole. as can be seen by the spell's name, this spell was created by the cleric lordewok, who wanted nothing more than to hone his already superior healing skills in his battle to protect the realms. ",
		Cost:        12,
		Chant:       "Deities aid my stricken friend!",
		Magnitude:   1,
		Effect:      "heal",
		Classes:     map[string]int{"cleric": 7, "paladin": 9, "bard": 11},
	},
	"renewal": {
		Name:        "renewal",
		Description: "kenlokerai's renewal (herein referred to as renewal), is the most powerful unlimited healing spell that can exist within the magical weave and still be castable by mortals. this spell calls directly upon the caster's deity, and their link to the faith. as such, this spell must be cast by cleric, paladin, or bard. the amount of power of this spell is stronger amongst the devout followers of the gods, and even stronger amongst their chosen. the caster yells their deity's name, and concentrates inwardly upon the power of the their god. as they do, a visible aura surrounds them, as the strong healing energies fill their being. the caster then need only concentrate on bringing the power of the god into their recipient. the target's pain and injury are obliterated as flesh knits, even regrowing lost members if needed, attempting to completely renew the target's body. ",
		Cost:        20,
		Chant:       "Thy wounds wash away as my faith flows.",
		Magnitude:   2,
		Effect:      "heal",
		Classes:     map[string]int{"cleric": 11, "paladin": 13, "bard": 16},
	},
	"hurt": {
		Name:        "hurt",
		Description: "the lowest level spell of the air realm, hurt can be cast by a first level mage. in casting the spell, the mage focusses his negative thoughts at the target, then waves his hand as if fanning himslf while speaking the spell  Chant. the air itself then pushes upon the target, causing flesh to bruise, or even bones to break on a more fragile target. ",
		Cost:        6,
		Chant:       "Breeze, be gentle no more.",
		Magnitude:   1,
		Effect:      "air-damage",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "bard": 2},
	},
	"rumble": {
		Name:        "rumble",
		Description: "the rumble spell causes the earth to shake beneath the target, causing the creature damage due to the vibrations of the earth echoing through their system. this spell is the lowest level attack spell of the earth realm. to cast this spell, the mage kicks the ground, hard, while speaking the spell Chant. the caster must then close their eyes, and visualize the target shaking. when the caster open their eyes, to completel the spell, their vision will be true. like most attack spells, however, the energies generated from the casting of this spell must be directed at a target, else they will ground through the caster, harming them instead.",
		Cost:        6,
		Chant:       "Shaken, not stirred.",
		Magnitude:   1,
		Effect:      "earth-damage",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "bard": 2},
	},
	"burn": {
		Name:        "burn",
		Description: "the lowest level attack spell of the fire realm, burn causes a small flame to appear on the target, burning their flesh, and igniting combustable materials. to cast this spell, the caster makes a fist with one hand, thumb inside the fist, then quickly pulls the thumb in an out several times while speaking the spell Chant. when the  Chant is completed, the caster pulls their thumb from their fist a final time, extending the thumb out completely, and then causing the thumb to dance as if it were a small flame. the caster then quickly points the dancing digit at the target, and a flame appears. guildmaster fariol is known to use this spell to light his pipe, though he does not recommend this practice amongst less skilled mages. if the caster does not direct the flame in time, it will appear on the caster's thumb, burning them instead. ",
		Cost:        6,
		Chant:       "Fire, flicker, ignite!",
		Magnitude:   1,
		Effect:      "fire-damage",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "bard": 2},
	},
	"blister": {
		Name:        "blister",
		Description: "the spell, blister, is the lowest-ranking offensive spell of the water realm. it causes a sudden movement of the water within the target, drawing it to the surface, inflicting pain and damage. usually, this spell will cause a painful blister of water to appear on the target's flesh, hence the spell's appropriate name. to cast the spell, the mage speaks the spell Chant, while pinching themselves, as if pulling something from within them. the caster then makes a similar pinching gesture in the target's direction to complete the spell. however, the magical energies of this spell, once gathered, must be released. should the spell not be directed at a target, then it will take it's full effect upon the caster. ",
		Cost:        6,
		Chant:       "Thy water rises and causes thee pain.",
		Magnitude:   1,
		Effect:      "water-damage",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "bard": 2},
	},
	"dustgust": {
		Name:        "dustgust",
		Description: "this spell creates a small whirlwind of stinging sand and dust to surround and strike the target. this spell is the second-tier offensive spell of the air realm. to cast this spell, the caster motions his hands in vertical circles while speaking the spell Chant. a small whirlwind will appear around the caster, who must then blow the whirlwind to the victim. if the caster does not do so in time, the whirlwind will engulf him instead of the target... a bad thing to happen in combat. ",
		Cost:        14,
		Chant:       "Arise stinging mists, strike my foe.",
		Magnitude:   2,
		Effect:      "air-damage",
		Classes:     map[string]int{"cleric": 6, "mage": 5, "bard": 7},
	},
	"stonecrush": {
		Name:        "stonecrush",
		Description: "the spell, crush, short for stonecrush, is the second tier offensive spell of the earth realm. the stonecrush spell causes the surrounding stones and earth to fly at the target, impacting and crushing the target. to cast this spell, the caster holds their hands in front of themselves, staring at them, while speaking the spell Chant. as he nears the end of the spell Chant, the caster then pulls their hands apart and then grinds them together. stones in the area will begin to swirl about, waiting only for the caster to direct them to their target. should the target not direct the stones to the target in time, they will home in on the caster, striking them will the full force of the spell. ",
		Cost:        14,
		Chant:       "The stones of earth, smite thee!",
		Magnitude:   2,
		Effect:      "earth-damage",
		Classes:     map[string]int{"cleric": 6, "mage": 5, "bard": 7},
	},
	"fireball": {
		Name:        "fireball",
		Description: "the second-level offensive spell of the fire realm, fireball causes the caster to reach into the fire realm and throw a handful of fiery matter at the target. when casting the spell, the caster's hand begins to glow bright red as they whisper the spell Chant. the caster then pulls back their hand as if preparing to throw a stone, at which point the fireball appears in the caster's hand. the caster must then throw the fireball at the target before the red, protective glow fades from their hand, else the destructive energies will strike them instead. ",
		Cost:        14,
		Chant:       "Fiery missile strike thy target!",
		Magnitude:   2,
		Effect:      "fire-damage",
		Classes:     map[string]int{"cleric": 6, "mage": 5, "bard": 7},
	},
	"waterbolt": {
		Name:        "waterbolt",
		Description: "waterbolt is the second-tier offensive spell of the water realm. this spell fires a wave of cold force, which condenses the moisture in the air into a bludgeoning bolt of water. the target is then pounded by the sheer force of the water, which contains several small ice crystals to compound the damage. in order to cast this spell, the caster puts their hands together, palms outward, with their arms fully extended toward the target. the caster then pulls their arms as far back as they will reach while speaking the spell Chant. the cold force begins to gather around the caster, who must then push their arms (and the cold) out toward the target. as with many offensive spells, the timing of directing the force is critical, as the cold will eventually strike the caster should it not be directed outward in time. ",
		Cost:        14,
		Chant:       "The force of waves, crash into thee!",
		Magnitude:   2,
		Effect:      "water-damage",
		Classes:     map[string]int{"cleric": 6, "mage": 5, "bard": 7},
	},
	"shockbolt": {
		Name:        "shockbolt",
		Description: "this spell, the third tier attack spell in the air realm, causes a bolt of shocking static electricity to be fired at the target. to cast this spell, the caster rubs the sleeve of their robe on their hair while speaking the spell Chant. the static built from this rubbing is absorbed into the caster's hand, and can then be fired by pointing at the target. a blue arcing bolt fires, striking the target for moderate damage. it is imporrtant to direct this energy quickly however, as the spell's protection from the magically enhanced static does not last long... many a young mage has died from the static discharge of not releasing the spell in time. ",
		Cost:        24,
		Chant:       "Static bolt, shock my foe!",
		Magnitude:   3,
		Effect:      "air-damage",
		Classes:     map[string]int{"cleric": 11, "mage": 9, "bard": 12},
	},
	"shatterstone": {
		Name:        "shatterstone",
		Description: "shatterstone is the third tier offensive spell of the earth realm. this spell causes the stone around the target to explode, hurling sharp shards of rock at the target, inflicting strong damage upon them. to cast this spell, the caster places their right hand in a fist and opens it most forcefully while speaking the spell Chant. the caster then directs the explosive force with their other hand. should the caster delay too much before directing the force, the spell will ground through the caster, causing the stone around the caster to explode, harming them. ",
		Cost:        24,
		Chant:       "Stones explode and shrapnel strike!",
		Magnitude:   3,
		Effect:      "earth-damage",
		Classes:     map[string]int{"cleric": 11, "mage": 9, "bard": 12},
	},
	"burstflame": {
		Name:        "burstflame",
		Description: "burstflame is the third tier attack spell of the fire realm. this spell causes a fiery explosion to engulf the target briefly, causing the target great harm. to cast this spell, the caster speaks the spell Chant, while keeping their right hand turned up, fingers dancing like licking flames while pointing the other hand at the target. flames will burst from the ground below the target, and engulf the target. the caster is warned to ensure a proper target for the spell, else the spell's effects will ground out at the caster's location, greatly harming the caster instead. ",
		Cost:        24,
		Chant:       "Flameburst, strike, burn!",
		Magnitude:   3,
		Effect:      "fire-damage",
		Classes:     map[string]int{"cleric": 11, "mage": 9, "bard": 12},
	},
	"steamblast": {
		Name:        "steamblast",
		Description: "the steamblast spell is the third tier offensive spell of the water realm. steamblast causes a hot jet of water and steam to fire from the the caster to the target, scalding them. steamblast follows a similar magical principle as waterbolt, however, the magic that condenss the water then heats it to boiling as it fires at the target. to cast the spell, the caster forces their left hand forward, palm facing the target, while speaking the spell Chant, and making a wave motion with the right hand. as the spell Chant is completed, the caster's right hand should reach the right, palm open toward the target. as with all attack spells, there is a good chance that this spell will ground out through the caster, should it be miscast. ",
		Cost:        24,
		Chant:       "Scalding vapors parbroil thee!",
		Magnitude:   3,
		Effect:      "water-damage",
		Classes:     map[string]int{"cleric": 11, "mage": 9, "bard": 12},
	},
	"lightning": {
		Name:        "lightning",
		Description: "the fourth level spell of the air realm, lightning is a powerful offensive spell. to cast this spell, the caster rubs the sleeves of their robes together while speaking the spell Chant. as the  Chant is spoken, arcs of electrical energy will crackle up and down the caster's arms, and a small cloud will appear within the space around the caster's arms. the caster then speaks the last word of the  Chant and throws both hands towards the target. lightning will fire from the cloud into the mage's arms, and then be directed toward the target. if the caster is slow in selecting a target, the electrical energies will ground through the caster, inflicting the full damage of the lightning strike upon the caster. ",
		Cost:        32,
		Chant:       "Ions, energy, storm...discharge!",
		Magnitude:   4,
		Effect:      "air-damage",
		Classes:     map[string]int{"cleric": 15, "mage": 12, "bard": 16},
	},
	"engulf": {
		Name:        "engulf",
		Description: "the fourth tier spell of the earth realm, engulf is a powerful offensive spell. casting the spell causes the earth itself to reach up, and engulf the target, causing damage from crushing and suffocation. to cast the spell, the caster mutters the spell Chant, while placing the palms of their hands together. as the caster completes the  Chant, they must then pull their hands apart, palms touching still, and bend all their fingers, and close their hands together. the earth itself will beging to shake, and the caster must then point their closed hands at the target, and open them to direct the spell. as is common with attack spells, if the target of the spell is not quickly identified, the energies will discharge at the caster, causing them a severe penalty in combat.",
		Cost:        32,
		Chant:       "Be held in Mother Earth's embrace",
		Magnitude:   4,
		Effect:      "earth-damage",
		Classes:     map[string]int{"cleric": 15, "mage": 12, "bard": 16},
	},
	"immolate": {
		Name:        "immolate",
		Description: "the immolate spell is the fourth tier offensive spell of the fire realm. immolate causes the target to suddenly begin to blaze, being completely immolated by fire. mercifully for the target, the spell duration is not long, however, having every part of ones body ignite, even briefly, causes severe damage to the target. the caster speaks the spell Chant while bringing their hands together, as fists. as the spell Chant ends, the caster opens their hands, keeping the heels together, while motioning their fingers like dancing flames. the caster will then be surrounded by a nimbus of fire, which they must then direct, by pointing anc concentration, out to the target. the flaming sheath flies through the air from caster to target, and adjusts itself for the target's size in flight. should the caser lose concentration in directing the flight of the sheath, it will return and strike the caster for full effect.",
		Cost:        32,
		Chant:       "Fiery aura consume thee in a warm embrace.",
		Magnitude:   4,
		Effect:      "fire-damage",
		Classes:     map[string]int{"cleric": 15, "mage": 12, "bard": 16},
	},
	"bloodboil": {
		Name:        "bloodboil",
		Description: "the bloodboil spell is the fourth-tier attack spell of the water realm. this spell is quite appropriately named, for it causes the ambient moisture and water within the target to begin to heat, and boil, causing immense damage to the target. to cast this spell, the caster begins to shudder, as if having a fit, while stammering out the spell Chant. an aura of waterheat begins to surround the caster as the  Chant progresses. when the  Chant is completed, the caster points with both hands at the target, who then begins to act in a similar fashion as their internal liquids boil. the caster must direct the waterheat force quickly after summoning it, else the force will penetrate the caster, boiling their blood instead. more than one mage has lost life this way. ",
		Cost:        32,
		Chant:       "Lifeblood scald, blister and boil!",
		Magnitude:   4,
		Effect:      "water-damage",
		Classes:     map[string]int{"cleric": 15, "mage": 12, "bard": 16},
	},
	"thunderbolt": {
		Name:        "thunderbolt",
		Description: "thunderbolt is the fifth tier offensive spell in the air realm, and the most powerful known spell of that realm. to cast this spell, the caster speaks the spell Chant, while forming and shaping a stormcloud with their hands. as the cloud is completed, and the  Chant spoken, the caster then drives both hands through the cloud to point at the victim. a massive thunderbolt will arc from the cloud, as directed by the caster's hands, to strike the target. the impact from this spell alone is enough to kill smaller targets, and knock giants from their feet. when combined with the hellish power of the electrical discharge, thunderbolt is a terribly powerful offensive force. skilled casters of this spell have been known to use it to blast down stone fortresses that are not magically protected in as few as 3 strokes. casters of thunderbolt are warned to be quick in directing the energies of the spell, as the cloud will discharge soon after its formation, sending the thunderbolt to the nearest target, which is nearly always the caster. ",
		Cost:        40,
		Chant:       "Thunderbolt, lightning-strike, destruction!",
		Magnitude:   5,
		Effect:      "air-damage",
		Classes:     map[string]int{"mage": 16},
	},
	"earthquake": {
		Name:        "earthquake",
		Description: "earthquake is the fifth-tier offensive spell of the earth realm, and is the most powerful known spell in that realm. earthquake causes the earth to open up and attempt to swallow the spell's target. while the spell is rarely completely successful, the opening and closing of the magical fault is quick enough to trap a portion of the target, effectively amputating the sections sealed in the earth, often leaving only the target's head behind. to cast this spell, the caster places their hands open and together, quickly opening and closing them as the spell Chant is spoken. the earth will then begin to shake, and the caster must then throw their open hands out to direct th earth to the target. should the caster be slow in directing the energy, the earth will open up beneath them, as if they were the intended target. fortunately for such mages, clerical magic allows the regeneration of lost members. this spell is often used in seiges, allowing the instant destruction of a fortresses walls in a few quick castings. ",
		Cost:        40,
		Chant:       "Mother Earth swallow thee into an instant grave...",
		Magnitude:   5,
		Effect:      "earth-damage",
		Classes:     map[string]int{"mage": 16},
	},
	"flamefill": {
		Name:        "flamefill",
		Description: "flamefill is the fifth-tier offensive spell of the fire realm, and is the most powerful known spell of that realm. it is also considered one of the most cruel spells known. simply put, flamefill completely fills the inside of the target with flames, burning and charring their internal organs. this spell will instantly slay most targets, consuming them in fire as would a funeral pyre, leaving only the most rugged or magically shielded targets alive. to cast flamefill, the mage speaks the spell Chant, while wiping their forehead as if very warm. as the spell energies are forming, the caster becomes uncomfortably warm, and just as the spell is about to burn them, they must direct the hellish heat from themselves to the target. the struck target's internal system is instantly filled with flames. casters of this spell are warned not to wait too long before directing the effects of this spell to the target, as it is often a fatal mistake. ",
		Cost:        40,
		Chant:       "Be thou consumed by inner fire!",
		Magnitude:   5,
		Effect:      "fire-damage",
		Classes:     map[string]int{"mage": 16},
	},
	"iceblade": {
		Name:        "iceblade",
		Description: "iceblade is the most powerful spell of the water realm. this spell causes the ambient moisture in the victim itself to condense and solidify into the form of a large blade within the vitals of the target. as water expands when it freezes, the iceblade will cause the target massive internal damage, from a pierced lung up to completely impaling the victim. to cast this spell, the caster shivers, as if extremely cold, then points at the victim's chest cavity while speaking the spell Chant. frost forms on the caster's fingertips as an invisible bolt of numbing cold strikes the victim. the iceblade quickly becomes visible, usually covered in blood and gore. ",
		Cost:        40,
		Chant:       "I impale thee on thy frozen blood!",
		Magnitude:   5,
		Effect:      "water-damage",
		Classes:     map[string]int{"mage": 16},
	},
	"inferno": {
		Name:        "inferno",
		Description: "inferno is a sixth-tier offensive spell, existing in the fire realm of magic, and is a word used to scare the mages of the ivory tower. why? because for all their study of the spell, which seems draconic in origin, they cannot reverse engineer it's formula from the pattern. this spell is the hallmark of red dragons, passed to each red by the ancients when they reach a millenia of age. this spell is obviously based upon flamefill, with similar effects, save the fire that is generated is equal in power to the breath of an ancient red wyrm. few targets have ever survived a casting of inferno, and those that have were magically shielded. in most cases, all the remains after the inferno spell is cast is a charred husk that was once a corpse. as is the case with all draconic magic, the verbal and somatic material components for this spell are unknown. ",
		Cost:        75,
		Chant:       "Dragonsfire consume thee from within.",
		Magnitude:   6,
		Effect:      "fire-damage",
		Classes:     map[string]int{"mage": 21},
	},
	"acidify": {
		Name:        "acidify",
		Description: "acidify is a sixth-tier offensive spell, existing in the earth realm of magic. it, too, is draconic in origin, existing within the dark secrets kept by the black dragons. many a mage has died in experimentation, trying to unlock this spells secrets. acidify seems to be somewhat a status symbol amongst the blacks, and is given only to those blacks who have reached 1,000 winters of age. the acidify spell turns the victims blood to acid, causing their bodies to be destroyed from the inside out. few targets have ever survived a casting of acidify, and those that have were magically shielded. in most cases, all the remains after the acidify spell is wretched mass of melted flesh.... as is the case with all draconic magic, the verbal and somatic material components for this spell are unknown. ",
		Cost:        75,
		Chant:       "",
		Magnitude:   6,
		Effect:      "earth-damage",
		Classes:     map[string]int{"mage": 21},
	},
	"thunderstorm": {
		Name:        "thunderstorm",
		Description: "thunderstorm is a sixth-tier offensive spell, existing in the air realm of magic. this spell is an obvious extension of thunderbolt, creating a larger stormcloud that strikes with multiple, concurrent discharges to the same target. this spell is centuries old, and in the possession of the blue dragons, who teach it to those in their number who live 1,000 years. a spell formula for this spell was once duplicated, however, the mage who did so went mad, destroying himself, his research and the entire ivory tower of roviss. since then, all magi who attempted to research this spell have died by an electrical discharge. it is believed that the blue dragons has warded this spell within the weave, however, it is unknown how they may have done so. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown. ",
		Cost:        75,
		Chant:       "Bolts of Lighthing, Lash as One!",
		Magnitude:   6,
		Effect:      "air-damage",
		Classes:     map[string]int{"mage": 21},
	},
	"frostspikes": {
		Name:        "frostspikes",
		Description: "frostspikes is a sixth-tier offensive spell, existing in the air realm of magic. this fact alone has sparked some debate, as white dragon's natural affinity seemed to be water spells, however, it became somewhat clear that air was easier to cool than water, and, as such, the more powerful frost-spells are in the air realm. this spell is similar in nature to iceblade, though more cruel. rather than foucssing on a single body location, this spell causes many frostspikes to be formed within the target's body, cutting thm to ribbons as they tear their way out from the inside. this spell is taught to white dragons in their 1000th winter, and has never been successfully duplicated by a humanoid mage. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown.",
		Cost:        75,
		Chant:       "",
		Magnitude:   6,
		Effect:      "air-damage",
		Classes:     map[string]int{"mage": 21},
	},
	"venom": {
		Name:        "venom",
		Description: "venom is a sixth-tier offensive spell, existing in the water realm of magic. known only to the green dragons, and this spell replaces the target's blood with a stinging, horrible venom, killing the body. (note: this fact makes all know poison resistances ineffetive, as most of them work in the blood.) fortunately, the spell is isntantaneous, so that if the initial atatck doesn't kill the target, the target's blood returns to normal. this spell seems to be controlled amongst dragonkind, known only to the old greens, who have seen more than a millenia. all humanoid researchers of this spell have died, horribly, however, that has not stopped more from trying. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown. ",
		Cost:        75,
		Chant:       "",
		Magnitude:   6,
		Effect:      "water-damage",
		Classes:     map[string]int{"mage": 21},
	},
	"hellfire": {
		Name:        "hellfire",
		Description: "hellfire is a devastating use of mana. it falls into the seventh tier of spells, which is a classification magi fear, since such a tier is inacessible to most mortal magi. the spell is obviously within the fire realm of magic. this spell, again, draconic in origin, is known only by the ancient red wyrm. the hellfire spell reaches beyond the plane of fire, into kyorl's hells, and focuses these flames into every living cell in the target. destroying them. to date, only the great dreaos has been known to have survived the casting of this spell... targets are so consumed by the hellfire that they are reduced to ash by the spell's instantaneous effect. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown. ",
		Cost:        100,
		Chant:       "Be consumed by the flame that tortures souls.",
		Magnitude:   7,
		Effect:      "fire-damage",
		Classes:     map[string]int{"mage": 25},
	},
	"disintegrate": {
		Name:        "disintegrate",
		Description: "disintegrate is a devastating use of mana. it falls into the seventh tier of spells, which is a classification magi fear, since such a tier is inacessible to most mortal magi. the spell is obviously within the earth realm of magic. this spell, again, draconic in origin, is known only by the ancient black wyrm. the disintegrate spell uses raw mana to pull a target apart, piece by piece, reducing them to a pile of ash. historically, only the storm giants have ever survived a casting of this spell, and most of them were left with missing limbs and severe injuries. in a few rare cases, the spell's effect destroyed flesh from all around the target, without killing or maiming them. as is the case with all draconic magic, the verbal and somatic material components for this spell are unknown. ",
		Cost:        100,
		Chant:       "",
		Magnitude:   7,
		Effect:      "earth-damage",
		Classes:     map[string]int{"mage": 25},
	},
	"ionize": {
		Name:        "ionize",
		Description: "ionize is a devastating use of mana. it falls into the seventh tier of spells, which is a classification magi fear, since such a tier is inacessible to most mortal magi. the spell is obviously within the air realm of magic. this spell, again, draconic in origin, is known only by the ancient blue wyrm. the ionize spell creates a devastating bolt of lightning and thunder so powerful that most things it strikes are completely ionized (that is to say, torn apart electrically, leaving nothing behind.) the only known survivor of this spell (unscathed, though horribly injured) was an ancient silver wyrm in the war of the races. other recipients who have survived have had large parts of their bodies blown away. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown. ",
		Cost:        100,
		Chant:       "",
		Magnitude:   7,
		Effect:      "air-damage",
		Classes:     map[string]int{"mage": 25},
	},
	"frostbite": {
		Name:        "frostbite",
		Description: "frostbite is a devastating use of mana. it falls into the seventh tier of spells, which is a classification magi fear, since such a tier is inacessible to most mortal magi. the spell pattern is so complex, that there is debate wether it is in the air or water realm of magic. this spell, draconic in origin, is known only by the ancient white wyrm. the frostbite spell fills the target with cold energies, attempting to freeze them solid. not surprisingly, this kills most creatures, only those who are strong enough to resist the magic survive. survivors of this spell often have a limb shattered soon aferwards, made brittle by the intense cold. as is the case with all draconic magic, the verbal and somatic material componens for this spell are unknown. ",
		Cost:        100,
		Chant:       "",
		Magnitude:   7,
		Effect:      "air-damage",
		Classes:     map[string]int{"mage": 25},
	},
	"putrify": {
		Name:        "putrify",
		Description: "putrify is a devastating use of mana. it falls into the seventh tier of spells, which is a classification magi fear, since such a tier is inacessible to most mortal magi. the spell appears to be of the water realm, due to its ability to destroy the body. this spell, draconic in origin, is known only by the ancient green wyrm. the putrify spell attempts to destroy and rot the targets body, turning them from a living, breathing organism into a putrid and rotted corpse. not surprisingly, this kills most creatures, only those who are strong enough to resist the magic survive. survivors of this spell often have end up dying afterwards from blood infections due to dead limbs that remain attatched. as is the case with all draconic magic, the verbal and somatic material componenst for this spell are unknown.",
		Cost:        100,
		Chant:       "Thy flesh rots, thy body decays.",
		Magnitude:   7,
		Effect:      "water-damage",
		Classes:     map[string]int{"mage": 25},
	},
	"light": {
		Name:        "light",
		Description: "the light spell causes the target to begin to glow, radiating a soft light. to cast this spell, the caster concentrates upon the natural aura of the target. the caster then traces the outline of the target while speaking the spell Chant, and a small part of that aura is released, illuminating the room. for this reason, most advenurers fear rooms lit with an eerie red light. the duration of this spell is based upon the level of magical skill of the caster.",
		Cost:        5,
		Chant:       "Thy soul illuminates.",
		Magnitude:   1,
		Effect:      "light",
		Classes:     map[string]int{"cleric": 3, "mage": 3, "paladin": 4, "ranger": 4, "bard": 4, "thief": 7, "monk": 5},
	},
	"curepoison": {
		Name:        "curepoison",
		Description: "the curepoison spell was designed as a direct result of the sheer numbers of fatalities caused by poison in the nexus. this spell magically purges any active venoms within the target, preventing the victim's slow and painful death from the toxin. it is important to note that this spell does not confer any sort of immunity to future injections of the same poison. the caster of this spell concentrates upon the target's life force, and points at the target, while speaking the spell's  Chant. some of the caster's lifeforce flows into the target, and the venom is purged. ",
		Cost:        6,
		Chant:       "Venom be purged from thy body.",
		Magnitude:   1,
		Effect:      "curepoison",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "paladin": 1, "ranger": 1, "bard": 1, "thief": 1, "monk": 1},
	},
	"bless": {
		Name:        "bless",
		Description: "the bless spell calls upon divine aid to assist its target in combat. to cast this spell, the caster clears their mind of all extra thoughts and concentrates upon the power of their god, attuning themselves to it. the caster then smiles at the target, and raises their holy symbol towards them. the caster's god then blesses the target, granting them bonuses to hit and to their natural healing rate. ",
		Cost:        10,
		Chant:       "Thy gods aid thee.",
		Magnitude:   1,
		Effect:      "bless",
		Classes:     map[string]int{"cleric": 5, "paladin": 8},
	},
	"protection": {
		Name:        "protection",
		Description: "the protection spell causes a portion of the target's natural aura to physically manifest around them, acting as a sort of armour. while under the effects of this spell, the target is more difficult to hit, as the aura slows and stops incoming attacks. casting this spell, the caster gestures as if placing a helm upon the target while speaking the spell Chant. ",
		Cost:        10,
		Chant:       "Thy soul guard thee.",
		Magnitude:   1,
		Effect:      "protection",
		Classes:     map[string]int{"cleric": 5, "mage": 1, "bard": 5},
	},
	"invisibility": {
		Name:        "invisibility",
		Description: "the invisibility spell is a high-power illusion spell, which causes it's target to fade from sight. to cast the spell, the mage must clear their mind completely, and focus on the surrounding area. the mage must then prick their finger on a small mirror, to have the minute amount of blood required to power the spell. the caster then points the bleeding finger at the target, while closing their eyes with their other hand and speaking the spell Chant. the target's form will shimmer, and then fade to invisibility, while the magic will drain the blood from the wound, essentially healing it. it is important to note that many creatures have sharp senses, and are unfooled by invisibility. ",
		Cost:        15,
		Chant:       "Magical cloak obscure thee from sight!",
		Magnitude:   1,
		Effect:      "invisibility",
		Classes:     map[string]int{"mage": 10, "bard": 15},
	},
	"detect-invisible": {
		Name:        "detect-invisible",
		Description: "casting this spell allows the target to see the unseen. the target of this spell is granted with a magical sixth sense which can detect invisible targets. to cast this spell, the caster covers their eyes with one hand, then uncovers them while speaking the spell Chant. if the spell is to be directed at a target other than the caster, then the caster must point at the target through the whole process with their other hand. ",
		Cost:        10,
		Chant:       "Magical veil defied, my vision clarified.",
		Magnitude:   1,
		Effect:      "detect-invisible",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "paladin": 1, "ranger": 1, "bard": 1, "thief": 2, "monk": 2},
	},
	"teleport": {
		Name:        "teleport",
		Description: "the teleport spell allows quick, undirected movement for the target. when the spell is cast, the target's body and spirit are converted into pure magical energy, which is then carried a distance along the magical winds, and then restored to is normal form and function. to cast this spell, the caster points at the target, while speaking the spell Chant. visible raw magical energy will arc from the caster and surround the target, seemingly destroying them, as their form is converted to magic. it is important to note that travel using this spell is basically allowing yourself to be taken wherever the magical winds blow, and can very literally remove you from the burning flame, only to place you into the dragons' fire. ",
		Cost:        30,
		Chant:       "Go where the winds carry thee.",
		Magnitude:   1,
		Effect:      "teleport",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "paladin": 2, "ranger": 2, "bard": 2, "thief": 4, "monk": 3},
	},
	"stun": {
		Name:        "stun",
		Description: "the stun spell creates a physical and mental shockwave which strikes the target, in the attempt to immobilize the target for a short time. to cast this spell, the caster shouts out the spell Chant, while gesturing as though shoving the target. the target is struck by a physical wave which stuns the body, and a mental blast which clutters the mind. while under the effects of this spell, the creature is incapable of movement or action, and can be blasted into dirt by other spells, or chopped into pieces by the caster's companions. there is no visible indication of when the creature has recovered however, until it actually takes action, so remember to be cautious.",
		Cost:        10,
		Chant:       "Confusion of mind, and blast of body.",
		Magnitude:   1,
		Effect:      "stun",
		Classes:     map[string]int{"cleric": 1, "mage": 1, "paladin": 2, "ranger": 2, "bard": 2, "thief": 4, "monk": 3},
	},
	"word-of-recall": {
		Description: "this spell, strictly in the realm of clerical magic, instantly transports the target to safety. to cast this spell, the cleric grips their holy symbol in one hand, while speaking the spell Chant. the cleric then need only point at the target, and they will be returned to the safest place in the nexus... the chamber of the order of the healing hand. while similar in effet to the spell, teleport, this spell functions entirely differently. when word-of-recall is cast, a manifestation of the cleric's deity (a ray of light for aalynor, an aura of black fire for tilnar, etc.) surrounds the target and safely transport the target, along with all carried equipment to the destination",
		Cost:        25,
		Chant:       "The gods rescue thee!",
		Magnitude:   1,
		Effect:      "recall",
		Classes:     map[string]int{"cleric": 10, "paladin": 16},
	},
	"summon": {
		Name:        "summon",
		Description: "the summon spell causes the mage to reach out with their magic and grab a target, transporting them to the caster's location. similar in origin and function to teleport, when casting this spell, the mage focuses intently upon the target, visualizing them as they send out a magical tendril to reach the the target. the target is then converted to pure magical energy, as in a teleport, but rather than being sent out across the magical winds, they are directed along the magical tendril to appear at the caster' side. this spell will only work upon people who would allow themselves to be summoned and keep their minds open to this spell. anyone who has a closed mind is unaffected. as the effects of this spell can be very lethal to the target, most people keep their minds closed against it's effects. ",
		Cost:        50,
		Chant:       "My magic draws thee to me...",
		Magnitude:   1,
		Effect:      "summon",
		Classes:     map[string]int{"cleric": 15, "mage": 15, "paladin": 18, "ranger": 18, "bard": 18},
	},
	"wizard-walk": {
		Name:        "wizard-walk",
		Description: "not much is known about this spell. it was co-researched by fariol (before his untimely death) and lucis. it requires a faith magic component to ensure that the caster does not lose themselves upon the wizard's way, and it has no apparent somatic component. neither the wizard's tower nor the order of light are saying much about the inner workings of this spell.",
		Cost:        100,
		Chant:       "Magical winds lead me to thee...",
		Magnitude:   1,
		Effect:      "wizard-walk",
		Classes:     map[string]int{"cleric": 25, "mage": 25, "ranger": 25},
	},
	"levitate": {
		Name:        "levitate",
		Description: "the levitate spell allows it's target to float in the air, as if it were solid ground. this spell does not, however, convey any horizontal movement, only vertical. therefore, most levitating characters actually walk along the ground in order to move about. while under the effects of this spell, the recipient need never worry about difficult climbs, as they can simply levitate up. additionally, pits and other traps are often avoided, as the target will not fall into harm, or will simply glide over the tripwires or pressure plates. to cast this spell, the caster jumps into the air while speaking the spell Chant. before the caster lands, he must touch the target, who will then rise slightly off the ground. ",
		Cost:        10,
		Chant:       "Be lifted by thy spirits!",
		Magnitude:   1,
		Effect:      "levitate",
		Classes:     map[string]int{"cleric": 4, "mage": 4, "paladin": 7, "ranger": 7, "bard": 6, "thief": 10, "monk": 8},
	},
	"resist-fire": {
		Name:        "resist-fire",
		Description: "he resist-fire spell causes the victim to take less damage from flame-based attacks. this spell causes a small magical shell to appear around the target, which redirects incoming fire and flame back into the realm of fire, where it can dissipate harmlessly. to cast this spell, the caster rubs thier hands together, creating friction until they are warm, and then touches their warm hands to the target while speaking the spell Chant. ",
		Cost:        20,
		Chant:       "Flames bend and return to thy source!",
		Magnitude:   1,
		Effect:      "resist-fire",
		Classes:     map[string]int{"cleric": 7, "mage": 7, "paladin": 11, "ranger": 11, "bard": 9, "monk": 13},
	},
	"resist-magic": {
		Name:        "resist-magic",
		Description: "the resist-magic spell creates a partial one-way spell barrier around the target. this barier essentially attempts to break down any spells that strike it from the outside, and dissipate the raw mana into harmless energy. to cast this spell, the mage must speak the spell Chant, while deliberately miscasting another spell. the fizzled spell's energy will form the power of the barrier, and as such, the higher the level of the miscast spell, the stronger the barrier. this spell is somewhat similar in function to the ability of sorcerers, however, it is more controlled. ",
		Cost:        25,
		Chant:       "Thy spells repelled, thy mana burned.",
		Magnitude:   1,
		Effect:      "resist-magic",
		Classes:     map[string]int{"cleric": 9, "mage": 8, "paladin": 14, "ranger": 14, "bard": 12},
	},

	"resist-air": {
		Name:        "resist-air",
		Description: "the resist-air spell causes its recipient to take less damage from air-based attacks and environments. this spell causes a small magical shell to appear around the recipient, which redirects incoming air energies into the realm of frost, where it can dissipate harmlessly. to cast this spell, the caster speaks the spell Chant through chattering teeth, while rubbing their arms. when the spell Chant is complete, the caster need only touch the recipient of the spell to complete the casting. ",
		Cost:        20,
		Chant:       "Shield of warmth, I know no frost.",
		Magnitude:   1,
		Effect:      "resist-air",
		Classes:     map[string]int{"cleric": 7, "mage": 7, "paladin": 11, "ranger": 11, "bard": 9, "monk": 13},
	},
	"resist-water": {
		Name:        "resist-water",
		Description: "the spell resist water enables its recipient to resist water based attacks and at the same time allowing them to survive hostile water environments.",
		Cost:        20,
		Chant:       "Protect thee from liquid elements!",
		Magnitude:   1,
		Effect:      "resist-water",
		Classes:     map[string]int{"cleric": 7, "mage": 7, "paladin": 11, "ranger": 11, "bard": 9, "monk": 13},
	},
	"resist-earth": {
		Name:        "resist-earth",
		Description: "the resist-earth spell protects the recipient from harsh environments and earth-based attacks. this spell causes a small magical barrier to appear around the recipient, which absorbs the harmful energies and redirects them to the realm of earth where they can dissipate harmlessly. to cast the spell, the caster pinches their flesh while speaking the spell Chant. when the spell Chant is complete, the caster need only touch the recipient to complete the casting of the spell. ",
		Cost:        20,
		Chant:       "Earth, protect me from thyself!",
		Magnitude:   1,
		Effect:      "resist-earth",
		Classes:     map[string]int{"cleric": 7, "mage": 7, "paladin": 11, "ranger": 11, "bard": 9, "monk": 13},
	},
	"remove-disease": {
		Name:        "remove-disease",
		Description: "the remove disease spell purges nearly any disease from the system of its recipient. this spell is actually a customized low power spell combined from the fire and water realms, in which the water portion guides the magics through the recipient's body, to find the infection while the fire purges it from the body. this spell is very painful to the recipient, especially in the case of advanced infection, however it is far preferable to death. it is important to note as well that this spell is incapable of curing extremely virulant diseases, such as plagues. to cast the spell, the caster points at the recipient, and focuses inward, to direct the spell, while speaking the spell Chant. ",
		Cost:        12,
		Chant:       "By fire and ice, thy pestilence purged.",
		Magnitude:   1,
		Effect:      "remove-disease",
		Classes:     map[string]int{"cleric": 5, "mage": 6, "paladin": 6, "ranger": 7, "bard": 7, "thief": 9, "monk": 10},
	},
	"remove-blindness": {
		Name:        "remove-blindness",
		Description: "the spell remove-blindness is a combination of a magical dispelling effect and a specialized healing effect. the spell neutralizes automatically all known spell effects which cause blindness in the recipient, as well as attempting to heal the victim's eyes. thus, this spell works against both magical blindness and more mundane blindness (caused by venom-spitting creatures like dark kisses). it is, however, beyond the effects of this spell to regenerate eyes, or to restore eyes that have been severely damaged. to cast this spell, the caster need only speak the spell Chant, and touch their own eyes with their fingertips. should the spell be directed at another recipient, the spellcaster will need to point at the target before the magic is wasted upon themselves. ",
		Cost:        12,
		Chant:       "Thy eyes are mended, see the light!",
		Magnitude:   1,
		Effect:      "remove-blindness",
		Classes:     map[string]int{"cleric": 5, "mage": 6, "paladin": 6, "ranger": 7, "bard": 7},
	},

	"attraction": {
		Name:        "attraction",
		Description: "autumnfire's attraction, or attraction, was developed by the wizardress autumnfire in an attempt to gain more experience. the spell causes a tiny, magical, annoying sprite to appear, and to wander about the area, taunting, until it flushes out a creature. the direct benefit of this is that, under normal circumstances, casting the attraction spell causes one native monster to appear.",
		Cost:        15,
		Chant:       "Sprite arrive, and bring excitement.",
		Magnitude:   1,
		Effect:      "attraction",
		Classes:     map[string]int{"mage": 7},
	},
	"inertial-barrier": {
		Name:        "inertial-barrier",
		Description: "the wizard kalishar developed the inertial barrier spell in an attempt to offest the only true weakness of the mage: their vulnerability to physical attack. the spell causes a specialized, magical, one-way barrier which reduces the inertia of objects passing through it. this has the affect of slowing down incoming attacks, reducing their capacity to cause damage. the barrier has the benefit of difusing incoming breath attacks as well, as the barrier slows down the substance of the attack. this spell has no effect on purely magical damage, however. to cast the spell, the caster pushes against the air aound them, as if against a surface, and as they speak the spell Chant, press against it at different points. a blue barrier will appear, and shrink down to fit approximately 3 inches from the caster. as the last word is spoken, the barrier fades into invisibilty. ",
		Cost:        35,
		Chant:       "Magical shell, shield me from harm.",
		Magnitude:   1,
		Effect:      "inertial-barrier",
		Classes:     map[string]int{"mage": 9},
	},
	"surge": {
		Name:        "surge",
		Description: "The wizard cephas created the surge spell in an attempt to tap into the powers of faith and the gods to enhance combat abilities of the spells's recipient. this spell, which must be cast by one of faith, causes the power of light or darkness to surge into the soul of the recipient, increasing their abilities to cause damage. this strong surge has several side effects on its recipients: the surge of pure power is too much for a mortal body to withstand, as such, the power of light or darkness slowly burns the body of the spell recipient. this wracking effect also leaves the recipient in a state of increased vulnerability to physical attacks, though this vulnerability is less than the increase given. last, because the mage channels the light or darkness directly into the recipient, the recipient's alignment is modified from the expierience. to cast the spell, the mage focuses on their faith, until a shimmering beam of light or darkness surrounds them, which they then direct at the recipient.",
		Cost:        15,
		Chant:       "Light and Shadow flow into thee, their powers yours.",
		Magnitude:   1,
		Effect:      "surge",
		Classes:     map[string]int{"cleric": 9, "mage": 11, "paladin": 13, "ranger": 15, "bard": 14},
	},
	"resist-poison": {
		Name:        "resist-poison",
		Description: "the cleric, gifford, created the resist-poison spell as a proactive measure against the multitude of venomous creatures in the realms. this spell works on a simple principle, and, is fact, a lesser version of the spell bloodboil. the spell warms the recipients blood for a time, allowing it to burn away any toxins that are placed into the bloodstream. as such, while under the effects of the resist-poison spell, no venom will remain in the bloodstream long enough to harm the recipient of the spell. against gaseous poisons, such as those of the green dragon, or dreaded green glowing mouse, the spell fortifies the victim, reducing damage greatly against the incidious attack, the exact amount of protection is based upon the constitution of the recipient. to cast the spell, the caster needs to cut their finger slightly, so that a drop of blood will well up, which begins to blister and sizzle as the spell Chant is spoken. the caster then need only touch the blood to the recipient. it is important to note that this spell will not protect against existing poisons in the bloodstream at the time of casting, due to its simplicity. that very simplicity, and the amazing popularity (and wide-spread release) of the spell led to it being duplicated by several mages and clerics nearly a year after it's origin.",
		Cost:        15,
		Chant:       "Thy burning blood purge new venoms.",
		Magnitude:   1,
		Effect:      "resist-poison",
		Classes:     map[string]int{"cleric": 5, "mage": 6, "paladin": 7, "ranger": 7, "bard": 7, "thief": 8, "monk": 7},
	},
	"resilient-aura": {
		Name:        "resilient-aura",
		Description: "Resilient aura provides a shield to neutralize acids that would otherwise damage weapons, armor and items. ",
		Cost:        18,
		Chant:       "Shell of mana protect thy gear.",
		Magnitude:   1,
		Effect:      "resilient-aura",
		Classes:     map[string]int{"cleric": 7, "mage": 8, "paladin": 9, "ranger": 9, "bard": 9, "thief": 11},
	},
	"resist-disease": {
		Name:        "resist-disease",
		Description: "the cleric, gifford, created the resist-disease spell on the heels of the success of his previous spell, resist-poison. resist-disease, like resist-poison, is a proactive measure against the multitude of disease-carrying, infectious creatures in the realms. with his past experiences in studying blood, gifford's new spell magically thickens the blood, filling the blood with magical antibodies that scan the victims system, and then proceeds to fight off any living foreign agent injected into the bloodstrem. as such, while under the effects of this spell, no infection will live long enough in the bloodstream to harm the recipient of the spell. against the dreaded attack of pestilence, the spell fortifies the victim, reducing damage greatly against the attack, the exact amount of protection is based upon the constitution of the recipient. to cast the spell, the caster needs to cut their finger slightly, so that a drop of blood will well up, which begins to coagulate as the spell Chant is spoken. the caster then need only touch the blood to the recipient. it is important to note that the magical antibodies will not react to existing infections within the system, and as such, offers no protections against a disease already in the recipient at the time of casting.",
		Cost:        18,
		Chant:       "Thy blood thickens, be free from infection.",
		Magnitude:   1,
		Effect:      "resist-disease",
		Classes:     map[string]int{"cleric": 6, "mage": 7, "paladin": 8, "ranger": 8, "bard": 8, "thief": 9, "monk": 8},
	},
	"disrupt-magic": {
		Name:        "disrupt-magic",
		Description: "the disrupt-magic spell was researched by tra'nis the goblin archwizardress, along with a council of the most powerful ancient wyrm of chromatic scale in the realms. disrupt-magic was a natural expansion of the spell she reasearched to weaken and disrupt the barrier around nexus, and is more sinister. like the anti-barrier spell, disrupt-magic fires essentially a bolt of unfocussed mana, which strikes the target, causing a disruption in the magical enchantments bound to the target. ",
		Cost:        40,
		Chant:       "Magical tethers, twist, disrupt, nullify!",
		Magnitude:   1,
		Effect:      "disrupt-magic",
		Classes:     map[string]int{"mage": 18},
	},
	"reflection": {
		Name:        "reflection",
		Description: "the reflection spell, researched by darkness, is an amazingly powerful spell. the spell reflects back to it's source a percentage of an incoming attack, doing so even before other resistance spells reduce the remaining damage. powerful spellcasters can easily reflect back over half the damage recieved, making this a most potent spell. once cast upon a recipient, the spell draws it's power from the recipient, meaning that those classes better suited for magic will hold a stronger shield than those who are not. ",
		Cost:        75,
		Chant:       "Mana form a mirrored shell!",
		Magnitude:   1,
		Effect:      "reflection",
		Classes:     map[string]int{"cleric": 25, "mage": 17, "bard": 25},
	},
	"dodge": {
		Name:        "dodge",
		Description: "the archwizardress thelia created this spell to repay a debt to the thief garpenlov. this spell calls upon the natural dexterity and limberness of the recipient, causing them to gain an extra sense, so that they can 'see' and dodge spells as they attempt to target them. because the magic of offensive spells is so powerful, it is a rare occurance that a spell is completely dodged, however it is possible. under most cases, the dodging causes the spell to not connect solidly to it's target, reducing the damage taken. thieves superior quickness makes this an excellent defensive tool for them, while monks and rangers also enjoy this spells benefits more than other classes.",
		Cost:        25,
		Chant:       "Manasense guide my quickened reflexes.",
		Magnitude:   1,
		Effect:      "dodge",
		Classes:     map[string]int{"mage": 19, "ranger": 18, "bard": 22, "thief": 15, "monk": 18},
	},
	"resist-acid": {
		Name:        "resist-acid",
		Description: "the spell, resist-acid, was created by the cleric gifford in an attempt to neutralize one of the most feared attack forms in the realms. this spell creates a magical membrane of a neutralizing mucous, which, while disgusting, protects the recipient from most standard acids. powerful acids, such as those spat by black dragons, are not completely neutralized, but the protection given is certainly deemed worth living with the mucas. to cast the spell, the caster must gather up some mud, or other clinging substance, and rub it in their hands as the speak the  Chant. the mud becomes mucas, which must then be thrown at the target, or touched to the caster. the mucas quickly spreads, covering all parts of the target's flesh. ",
		Cost:        25,
		Chant:       "Thy flesh become basic and neutralize.",
		Magnitude:   1,
		Effect:      "resist-acid",
		Classes:     map[string]int{"cleric": 9, "mage": 10, "paladin": 13, "ranger": 13, "bard": 13, "thief": 15, "monk": 11},
	},
}
View Source
var SupportSpells = []string{
	"curepoison",
	"bless",
	"protection",
	"invisibility",
	"detect-invisible",
	"resist-fire",
	"resist-magic",
	"resist-air",
	"resist-water",
	"resist-earth",
	"remove-disease",
	"remove-blindness",
	"inertial-barrier",
	"surge",
	"resist-poison",
	"resilient-aura",
	"resist-disease",
	"reflection",
	"dodge",
	"resist-acid",
}

Functions

func AddRoomUpdate

func AddRoomUpdate(roomId int)

func BansheesLament

func BansheesLament(target interface{}, singer *Character)

func Cast

func Cast(caller interface{}, target interface{}, spell string, magnitude int) string

func CelebrationNight

func CelebrationNight(target interface{}, singer *Character)

func ChampionsAnthem

func ChampionsAnthem(target interface{}, singer *Character)

func CuriousCanticle

func CuriousCanticle(target interface{}, singer *Character)

func DeserializeCommands

func DeserializeCommands(jsonVals string) map[string]prompt.MenuItem

func DraensTale

func DraensTale(target interface{}, singer *Character)

func FlushRoomUpdates

func FlushRoomUpdates()

func GetLastActivity

func GetLastActivity(name string) time.Time

func Load

func Load()

Load fills the world with love.

func RestartJarvoral

func RestartJarvoral()

func ReturnItemInstanceProps

func ReturnItemInstanceProps(item *Item) map[string]interface{}

ReturnItemInstanceProps Function to return only the modifiable properties

func ReturnMobInstanceProps

func ReturnMobInstanceProps(mob *Mob) map[string]interface{}

ReturnMobInstanceProps Function to return only the modifiable properties

func RunAway

func RunAway(target interface{}, singer *Character)

func StartJarvoral

func StartJarvoral()

func StopJarvoral

func StopJarvoral()

func SweetComfort

func SweetComfort(target interface{}, singer *Character)

Types

type Accumulator

type Accumulator struct {
	Value int
}

func (*Accumulator) Add

func (a *Accumulator) Add(val int)

func (*Accumulator) CanSubtract

func (a *Accumulator) CanSubtract(val int) (cansub bool)

func (*Accumulator) SubIfCan

func (a *Accumulator) SubIfCan(val int) (ok bool)

func (*Accumulator) SubMax

func (a *Accumulator) SubMax(val int, finalVal int)

func (*Accumulator) Subtract

func (a *Accumulator) Subtract(val int)

type CharInventory

type CharInventory struct {
	ParentId int
	Contents []*Character
	Flags    map[string]bool
}

func NewCharInventory

func NewCharInventory(roomID int, o ...*Character) *CharInventory

func (*CharInventory) Add

func (i *CharInventory) Add(o *Character)

Add adds the specified object to the contents.

func (*CharInventory) List

func (i *CharInventory) List(observer *Character) []string

List the items in this CharInventory

func (*CharInventory) ListAll

func (i *CharInventory) ListAll() []*Character

ListChars the items in this CharInventory

func (*CharInventory) ListAllNoGM

func (i *CharInventory) ListAllNoGM() []*Character

ListChars the items in this CharInventory

func (*CharInventory) ListAttackers

func (i *CharInventory) ListAttackers(observer *Character) string

ListAttackers List Chars attacking in the room

func (*CharInventory) ListChars

func (i *CharInventory) ListChars(observer *Character) []*Character

ListChars the items in this CharInventory

func (*CharInventory) ListHiddenChars

func (i *CharInventory) ListHiddenChars(observer *Character) []*Character

ListHiddenChars ListChars the items in this CharInventory

func (*CharInventory) ListPeoChars

func (i *CharInventory) ListPeoChars(observer *Character) []*Character

ListPeoChars ListChars the items in this CharInventory

func (*CharInventory) ListPoses

func (i *CharInventory) ListPoses(observer *Character) (poseLines []string)

ListPoses the items in this CharInventory with poses activated

func (*CharInventory) MobList

func (i *CharInventory) MobList(observer *Mob) []string

MobList lists characters for a mobs point of view

func (*CharInventory) MobListAt

func (i *CharInventory) MobListAt(observer *Mob, placement int) []string

MobListAt lists characters for a mobs point of view

func (*CharInventory) MobSearch

func (i *CharInventory) MobSearch(alias string, observer *Mob) *Character

MobSearch Search the CharInventory to return a specific instance of something

func (*CharInventory) Remove

func (i *CharInventory) Remove(o *Character)

func (*CharInventory) Search

func (i *CharInventory) Search(alias string, observer *Character) *Character

Search the CharInventory to return a specific instance of something

func (*CharInventory) SearchAll

func (i *CharInventory) SearchAll(alias string) *Character

SearchAll the CharInventory to return a specific instance of something

type Character

type Character struct {
	Object
	io.Writer
	PromptStyle
	CharId     int
	Equipment  *Equipment
	Inventory  *ItemInventory
	Permission permissions.Permissions

	// Invisible, Hidden, Resists, OOC, AFK
	Flags         map[string]bool
	FlagProviders map[string][]string
	Effects       map[string]*Effect
	Modifiers     map[string]int

	// ParentId is the room id for the room
	ParentId int

	// Titles for all to see
	ClassTitle string
	Title      string

	// Gold
	BankGold Accumulator
	Gold     Accumulator

	// Exp
	Experience  Accumulator
	BonusPoints Accumulator
	Passages    Accumulator
	Broadcasts  int
	Evals       int
	//Char Stats
	Stam Meter
	Vit  Meter
	Mana Meter

	// Attributes
	Str Meter
	Dex Meter
	Con Meter
	Int Meter
	Pie Meter

	Tier       int
	Class      int
	Race       int
	Gender     string
	Birthday   int
	Birthdate  int
	Birthmonth int

	// Cool Downs
	Timers map[string]time.Time

	// Extra
	MinutesPlayed int

	ClassProps map[string]int

	Spells            []string
	Skills            map[int]*Accumulator
	ElementalAffinity map[string]*Accumulator

	CharTicker       *time.Ticker
	CharTickerUnload chan bool
	MsgBuffer        chan []byte
	SongTicker       *time.Ticker
	SongTickerUnload chan bool
	Hooks            map[string]map[string]*Hook
	LastRefresh      time.Time
	LoginTime        time.Time
	//Party Stuff
	PartyFollow     string
	PartyFollowers  []string
	Victim          interface{}
	Resist          bool
	OOCSwap         int
	LastSave        time.Time
	Unloader        func()
	LastMessenger   string
	DeathInProgress bool
	Rerolls         int
	Disconnect      func()
	Pose            string
}

func LoadCharacter

func LoadCharacter(charName string, writer io.Writer, disconnect func()) (*Character, bool)

func (*Character) AdvanceDivinity

func (c *Character) AdvanceDivinity(amount int, class int)

func (*Character) AdvanceElementalExp

func (c *Character) AdvanceElementalExp(amount int, element string, class int)

func (*Character) AdvanceSkillExp

func (c *Character) AdvanceSkillExp(amount int)

func (*Character) AdvanceStealthExp

func (c *Character) AdvanceStealthExp(amount int)

func (*Character) ApplyEffect

func (c *Character) ApplyEffect(effectName string, length string, interval int, magnitude int, effect func(triggers int), effectOff func())

func (*Character) ApplyHook

func (c *Character) ApplyHook(hook string, hookName string, executions int, length string, interval int, effect func(), effectOff func())

func (*Character) CalcHealPenalty

func (c *Character) CalcHealPenalty(damage int) int

func (*Character) CanEquip

func (c *Character) CanEquip(item *Item) (bool, string)

func (*Character) CheckFlag

func (c *Character) CheckFlag(flagName string) bool

func (*Character) DeathCheck

func (c *Character) DeathCheck(how string)

func (*Character) DeathCheckBool

func (c *Character) DeathCheckBool(how string) bool

func (*Character) EnableWrites

func (c *Character) EnableWrites()

func (*Character) FindFlagProviders

func (c *Character) FindFlagProviders(flagName string) []string

func (*Character) FlagOff

func (c *Character) FlagOff(flagName string, provider string)

func (*Character) FlagOffAndMsg

func (c *Character) FlagOffAndMsg(flagName string, provider string, msg string)

func (*Character) FlagOn

func (c *Character) FlagOn(flagName string, provider string)

func (*Character) FlagOnAndMsg

func (c *Character) FlagOnAndMsg(flagName string, provider string, msg string)

func (*Character) GainExperience

func (c *Character) GainExperience(value int)

func (*Character) GetCurrentWeight

func (c *Character) GetCurrentWeight() int

GetCurrentWeight returns the current carrying weight of the character.

func (*Character) GetModifier

func (c *Character) GetModifier(modifier string) int

func (*Character) GetSpellMultiplier

func (c *Character) GetSpellMultiplier() int

func (*Character) GetStat

func (c *Character) GetStat(stat string) int

func (*Character) HasEffect

func (c *Character) HasEffect(effectName string) bool

func (*Character) Heal

func (c *Character) Heal(damage int) (int, int)

func (*Character) HealStam

func (c *Character) HealStam(damage int) int

func (*Character) HealVital

func (c *Character) HealVital(damage int) int

func (*Character) InflictDamage

func (c *Character) InflictDamage() (damage int)

func (*Character) Look

func (c *Character) Look() (buildText string)

Look Drop out the description of this character

func (*Character) LookVictim

func (c *Character) LookVictim() *Mob

func (*Character) LoseParty

func (c *Character) LoseParty()

func (*Character) MaxWeight

func (c *Character) MaxWeight() int

func (*Character) MessageParty

func (c *Character) MessageParty(msg string, exclude *Character)

func (*Character) PartyFollowersNoGM

func (c *Character) PartyFollowersNoGM() (followers []string)

func (*Character) PrepareUnload

func (c *Character) PrepareUnload()

func (*Character) PurgeEffects

func (c *Character) PurgeEffects()

func (*Character) ReceiveDamage

func (c *Character) ReceiveDamage(damage int) (int, int, int)

ReceiveDamage Return stam and vital damage

func (*Character) ReceiveDamageNoArmor

func (c *Character) ReceiveDamageNoArmor(damage int) (int, int)

func (*Character) ReceiveEnvironmentalDamage

func (c *Character) ReceiveEnvironmentalDamage(damage int, element string) (int, int, int)

func (*Character) ReceiveMagicDamage

func (c *Character) ReceiveMagicDamage(damage int, element string) (int, int, int)

func (*Character) ReceiveVitalDamage

func (c *Character) ReceiveVitalDamage(damage int) (int, int)

func (*Character) ReceiveVitalDamageNoArmor

func (c *Character) ReceiveVitalDamageNoArmor(damage int) int

func (*Character) Refresh

func (c *Character) Refresh()

func (*Character) RemoveEffect

func (c *Character) RemoveEffect(effectName string)

func (*Character) RemoveHook

func (c *Character) RemoveHook(hook string, hookName string)

func (*Character) RestoreMana

func (c *Character) RestoreMana(damage int)

func (*Character) ReturnState

func (c *Character) ReturnState() string

func (*Character) ReturnToInventory

func (c *Character) ReturnToInventory(item *Item)

func (*Character) ReturnVictim

func (c *Character) ReturnVictim() string

func (*Character) RunHook

func (c *Character) RunHook(hook string)

func (*Character) Save

func (c *Character) Save()

func (*Character) SerialRestoreEffects

func (c *Character) SerialRestoreEffects(effectsBlob string)

func (*Character) SerialRestoreTimers

func (c *Character) SerialRestoreTimers(timerBlob string)

func (*Character) SerialSaveEffects

func (c *Character) SerialSaveEffects() string

SerialSaveEffects serializes all current user effects, removes them, and saves them to the database

func (*Character) SerialSaveTimers

func (c *Character) SerialSaveTimers() string

SerialSaveTimers serializes all current user timers

func (*Character) SetModifier

func (c *Character) SetModifier(modifier string, value int)

func (*Character) SetPromptStyle

func (c *Character) SetPromptStyle(new PromptStyle) (old PromptStyle)

func (*Character) SetTimer

func (c *Character) SetTimer(timer string, seconds int)

func (*Character) SingSong

func (c *Character) SingSong(song string, tickRate int)

SingSong Bards get their own special ticker TODO(?): Maybe eventually this is a generalized aura?

func (*Character) SuppressWrites

func (c *Character) SuppressWrites()

SuppressWrites Used when erroring a character out, or when we don't want to put anything on the write buffer

func (*Character) Tick

func (c *Character) Tick()

func (*Character) TickSaveWrapper

func (c *Character) TickSaveWrapper()

func (*Character) TimerReady

func (c *Character) TimerReady(timer string) (bool, string)

func (*Character) ToggleFlag

func (c *Character) ToggleFlag(flagName string, provider string)

func (*Character) ToggleFlagAndMsg

func (c *Character) ToggleFlagAndMsg(flagName string, provider string, msg string)

func (*Character) Unfollow

func (c *Character) Unfollow()

func (*Character) Unload

func (c *Character) Unload()

func (*Character) Write

func (c *Character) Write(b []byte) (n int, err error)

WriteBuffer writes the specified byte slice to the associated client.

func (*Character) WriteMovement

func (c *Character) WriteMovement(previous int, new int, subject string)

type Effect

type Effect struct {
	// contains filtered or unexported fields
}

func NewEffect

func NewEffect(length string, interval int, magnitude int, effect func(triggers int), effectOff func()) *Effect

func (*Effect) AlterTime

func (e *Effect) AlterTime(duration float64)

func (*Effect) ExtendDuration

func (e *Effect) ExtendDuration(duration float64)

func (*Effect) LastTriggerInterval

func (e *Effect) LastTriggerInterval() int

func (*Effect) Reset

func (e *Effect) Reset(t string)

func (*Effect) ReturnEffectProps

func (e *Effect) ReturnEffectProps() map[string]interface{}

ReturnEffectProps Function to return only the modifiable properties

func (*Effect) RunEffect

func (e *Effect) RunEffect()

func (*Effect) TimeRemaining

func (e *Effect) TimeRemaining() float64

type Equipment

type Equipment struct {
	// Status
	Armor int

	Head  *Item
	Chest *Item
	Neck  *Item
	Legs  *Item
	Feet  *Item
	Arms  *Item
	Hands *Item
	Ring1 *Item
	Ring2 *Item

	Ammo *Item

	// Hands, can hold shield or weapon
	Main *Item
	Off  *Item

	FlagOn            func(flagName string, provider string)
	FlagOff           func(flagName string, provider string)
	CanEquip          func(item *Item) (bool, string)
	ReturnToInventory func(item *Item)
}

func RestoreEquipment

func RestoreEquipment(jsonString string) *Equipment

func (*Equipment) CheckEquipment

func (e *Equipment) CheckEquipment()

func (*Equipment) DamageRandomArmor

func (e *Equipment) DamageRandomArmor() (retString string)

func (*Equipment) DamageWeapon

func (e *Equipment) DamageWeapon(whichHand string, damage int) string

func (*Equipment) Equip

func (e *Equipment) Equip(item *Item) (ok bool)

func (*Equipment) FindLocation

func (e *Equipment) FindLocation(alias string) (slot string)

FindLocation Attempt to find an item by name, return location

func (*Equipment) GetText

func (e *Equipment) GetText(ref string) string

func (*Equipment) GetWeight

func (e *Equipment) GetWeight() (total int)

func (*Equipment) Jsonify

func (e *Equipment) Jsonify() string

func (*Equipment) List

func (e *Equipment) List() []*Item

func (*Equipment) PostEquipmentLight

func (e *Equipment) PostEquipmentLight()

func (*Equipment) Search

func (e *Equipment) Search(alias string, nameNum int) *Item

Search the ItemInventory to return a specific instance of something

func (*Equipment) Unequip

func (e *Equipment) Unequip(alias string) (ok bool, item *Item)

Unequip Attempt to unequip by name, or type

func (*Equipment) UnequipAll

func (e *Equipment) UnequipAll() (items []*Item)

UnequipAll Remove all equipment

func (*Equipment) UnequipSpecific

func (e *Equipment) UnequipSpecific(alias string) (ok bool)

UnequipSpecific removes a specific slot rather than searching for a name

type Exit

type Exit struct {
	Object
	ParentId int
	ToId     int
	Flags    map[string]bool
	KeyId    int
}

func NewExit

func NewExit(roomId int, exitData map[string]interface{}) *Exit

func (*Exit) Close

func (e *Exit) Close() bool

func (*Exit) Look

func (e *Exit) Look() string

func (*Exit) Open

func (e *Exit) Open() bool

func (*Exit) Save

func (e *Exit) Save()

func (*Exit) ToggleFlag

func (e *Exit) ToggleFlag(flagName string) bool

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

func NewHook

func NewHook(executions int, length string, interval int, effect func(), effectOff func()) *Hook

NewHook Use -1 for unlimited executions, create a new hook.

func (*Hook) LastTriggerInterval

func (s *Hook) LastTriggerInterval() float64

func (*Hook) Reset

func (s *Hook) Reset(t time.Duration)

func (*Hook) RunHook

func (s *Hook) RunHook()

func (*Hook) TimeRemaining

func (s *Hook) TimeRemaining() float64

type Item

type Item struct {
	Object
	ParentItemId int
	ItemId       int
	ItemType     int
	Flags        map[string]bool
	Creator      string
	NumDice      int
	PlusDice     int
	SidesDice    int
	Armor        int
	ArmorClass   int
	MaxUses      int
	Value        int
	Spell        string
	StorePrice   int
	Adjustment   int

	Storage *ItemInventory
	Weight  int
}

func LoadItem

func LoadItem(itemData map[string]interface{}) (*Item, bool)

func (*Item) DisplayName

func (i *Item) DisplayName() string

DisplayName Return a display name with numerics

func (*Item) Eval

func (i *Item) Eval() string

func (*Item) GetWeight

func (i *Item) GetWeight() int

func (*Item) Look

func (i *Item) Look() string

func (*Item) ReturnState

func (i *Item) ReturnState() string

func (*Item) Save

func (i *Item) Save()

func (*Item) ToggleFlag

func (i *Item) ToggleFlag(flagName string) bool

type ItemInventory

type ItemInventory struct {
	Contents []*Item
	Flags    map[string]bool
}

func NewItemInventory

func NewItemInventory(o ...*Item) *ItemInventory

NewItemInventory New ItemInventory returns a new basic ItemInventory structure

func RestoreInventory

func RestoreInventory(jsonString string) *ItemInventory

func (*ItemInventory) Add

func (i *ItemInventory) Add(o *Item)

Add adds the specified object to the Contents.

func (*ItemInventory) GetTotalWeight

func (i *ItemInventory) GetTotalWeight() (total int)

func (*ItemInventory) Jsonify

func (i *ItemInventory) Jsonify() string

func (*ItemInventory) List

func (i *ItemInventory) List() []string

List the items in this ItemInventory

func (*ItemInventory) ListHiddenItems

func (i *ItemInventory) ListHiddenItems() []*Item

ListHiddenItems the items in this CharInventory

func (*ItemInventory) ListItems

func (i *ItemInventory) ListItems() []*Item

ListItems List the items in this ItemInventory

func (*ItemInventory) PermanentReducedList

func (i *ItemInventory) PermanentReducedList() string

PermanentReducedList the items in this inventory

func (*ItemInventory) ReducedList

func (i *ItemInventory) ReducedList() string

ReducedList the items in this inventory

func (*ItemInventory) Remove

func (i *ItemInventory) Remove(o *Item) (err error)

Remove Pass item as a pointer to be removed

func (*ItemInventory) RemoveNonPerms

func (i *ItemInventory) RemoveNonPerms()

RemoveNonPerms Clear all non-permanent

func (*ItemInventory) RoomReducedList

func (i *ItemInventory) RoomReducedList() string

RoomReducedList the items in this inventory

func (*ItemInventory) Search

func (i *ItemInventory) Search(alias string, num int) *Item

Search the ItemInventory to return a specific instance of something

type Meter

type Meter struct {
	Max     int
	Current int
}

func (*Meter) Add

func (m *Meter) Add(val int)

func (*Meter) Subtract

func (m *Meter) Subtract(val int)

type Mob

type Mob struct {
	Object
	MobId         int
	Inventory     *ItemInventory
	ItemList      map[int]int
	Flags         map[string]bool
	FlagProviders map[string][]string
	Effects       map[string]*Effect
	Hooks         map[string]map[string]*Hook

	MobType    int // construct/celestial/daemonic/undead/humanoid/beast/draconic/elemental
	MobSubType int // Melee, Ranged, Caster, Support

	// ParentId is the room id for the room
	ParentId   int
	Gold       int
	Experience int
	Level      int

	Stam Meter
	Mana Meter

	// Attributes
	Str   Meter
	Dex   Meter
	Con   Meter
	Int   Meter
	Pie   Meter
	Armor int

	// Dice
	NumDice   int
	SidesDice int
	PlusDice  int

	// Magic
	ChanceCast      int
	Spells          []string
	WaterResistance int
	AirResistance   int
	FireResistance  int
	EarthResistance int
	BreathWeapon    string

	//Threat table attacker -> damage
	TotalThreatDamage int
	ThreatTable       map[string]int
	CurrentTarget     string

	NumWander  int
	TicksAlive int
	WimpyValue int

	MobTickerUnload chan bool
	MobCommands     chan string
	MobTicker       *time.Ticker
	// An int to hold a stun time.
	MobStunned int
	IsActive   bool
	IsThinking bool
}

Mob implements a control object for mobs interacting with players and each other

func LoadMob

func LoadMob(mobData map[string]interface{}) (*Mob, bool)

func (*Mob) AddThreatDamage

func (m *Mob) AddThreatDamage(damage int, attacker *Character)

func (*Mob) ApplyEffect

func (m *Mob) ApplyEffect(effectName string, length string, interval int, magnitude int, effect func(triggers int), effectOff func())

func (*Mob) ApplyHook

func (m *Mob) ApplyHook(hook string, hookName string, executions int, length string, interval int, effect func(), effectOff func())

func (*Mob) CalculateInventory

func (m *Mob) CalculateInventory()

CalculateInventory On copy to a room calculate the inventory

func (*Mob) CastSpell

func (m *Mob) CastSpell(spell string) bool

func (*Mob) CheckFlag

func (m *Mob) CheckFlag(flagName string) bool

func (*Mob) CheckForExtraAttack

func (m *Mob) CheckForExtraAttack(target *Character)

func (*Mob) CheckThreatTable

func (m *Mob) CheckThreatTable(charName string) bool

func (*Mob) DeathCheck

func (m *Mob) DeathCheck(target *Character) bool

func (*Mob) DropInventory

func (m *Mob) DropInventory() string

func (*Mob) EditToggleFlag

func (m *Mob) EditToggleFlag(flagName string) bool

func (*Mob) Eval

func (m *Mob) Eval() string

func (*Mob) FlagOff

func (m *Mob) FlagOff(flagName string, provider string)

func (*Mob) FlagOn

func (m *Mob) FlagOn(flagName string, provider string)

func (*Mob) Flee

func (m *Mob) Flee(params []string)

func (*Mob) Follow

func (m *Mob) Follow(params []string)

func (*Mob) GetInt

func (m *Mob) GetInt() int

func (*Mob) GetSpellMultiplier

func (m *Mob) GetSpellMultiplier() float32

func (*Mob) Heal

func (m *Mob) Heal(damage int) (int, int)

func (*Mob) HealStam

func (m *Mob) HealStam(damage int)

func (*Mob) HealVital

func (m *Mob) HealVital(damage int)

func (*Mob) InflictDamage

func (m *Mob) InflictDamage() int

func (*Mob) Look

func (m *Mob) Look() string

func (*Mob) MobScript

func (m *Mob) MobScript(inputStr string)

func (*Mob) PickTarget

func (m *Mob) PickTarget()

func (*Mob) ProcessCommand

func (m *Mob) ProcessCommand(cmdStr string, params []string)

func (*Mob) ReceiveDamage

func (m *Mob) ReceiveDamage(damage int) (int, int, int)

func (*Mob) ReceiveDamageNoArmor

func (m *Mob) ReceiveDamageNoArmor(damage int) (int, int)

func (*Mob) ReceiveMagicDamage

func (m *Mob) ReceiveMagicDamage(damage int, element string) (int, int, int)

func (*Mob) ReceiveVitalDamage

func (m *Mob) ReceiveVitalDamage(damage int) (int, int)

func (*Mob) RemoveEffect

func (m *Mob) RemoveEffect(effectName string)

func (*Mob) RemoveHook

func (m *Mob) RemoveHook(hook string, hookName string)

func (*Mob) RestoreMana

func (m *Mob) RestoreMana(damage int)

func (*Mob) ReturnState

func (m *Mob) ReturnState() string

func (*Mob) RunHook

func (m *Mob) RunHook(hook string)

func (*Mob) Save

func (m *Mob) Save()

func (*Mob) StartTicking

func (m *Mob) StartTicking()

func (*Mob) Stun

func (m *Mob) Stun(amt int)

func (*Mob) Teleport

func (m *Mob) Teleport(target string)

Teleport Special handler for handling a mobs cast of a teleport spell

func (*Mob) Tick

func (m *Mob) Tick()

Tick The mob brain is this ticker

func (*Mob) ToggleFlag

func (m *Mob) ToggleFlag(flagName string, provider string)

func (*Mob) ToggleFlagAndMsg

func (m *Mob) ToggleFlagAndMsg(flagName string, provider string, msg string)

type MobInventory

type MobInventory struct {
	ParentId      int
	Contents      []*Mob
	Flags         map[string]bool
	ContinueEmpty func() bool
	JsonRepr      string
}

func RestoreMobs

func RestoreMobs(ParentID int, jsonString string) *MobInventory

func (*MobInventory) Add

func (i *MobInventory) Add(o *Mob, silent bool)

Add adds the specified Mob to the Contents.

func (*MobInventory) AddWithMessage

func (i *MobInventory) AddWithMessage(o *Mob, message string, silent bool)

AddWithMessage Add adds the specified Mob to the Contents.

func (*MobInventory) GetNumber

func (i *MobInventory) GetNumber(o *Mob) int

GetNumber Search the MobInventory to return a specific instance of something

func (*MobInventory) Jsonify

func (i *MobInventory) Jsonify()

func (*MobInventory) List

func (i *MobInventory) List(observer *Character) []string

List the items in this MobInventory

func (*MobInventory) ListAttackers

func (i *MobInventory) ListAttackers(observer *Character) string

ListAttackers List the items in this MobInventory

func (*MobInventory) ListHiddenMobs

func (i *MobInventory) ListHiddenMobs(observer *Character) []*Mob

ListHiddenMobs ListChars the items in this CharInventory

func (*MobInventory) ListHostile

func (i *MobInventory) ListHostile() []string

ListHostile List the items in this MobInventory

func (*MobInventory) ListMobs

func (i *MobInventory) ListMobs(observer *Character) []*Mob

ListMobs List the items in this MobInventory

func (*MobInventory) ReducedList

func (i *MobInventory) ReducedList(observer *Character) string

ReducedList List the items in this MobInventory

func (*MobInventory) Remove

func (i *MobInventory) Remove(o *Mob)

Remove Pass mob as a pointer, compare and remove

func (*MobInventory) RemoveNonPerms

func (i *MobInventory) RemoveNonPerms()

RemoveNonPerms Clear all non-permanent

func (*MobInventory) RestartPerms

func (i *MobInventory) RestartPerms()

func (*MobInventory) Search

func (i *MobInventory) Search(alias string, num int, observer *Character) *Mob

Search the MobInventory to return a specific instance of something

type Object

type Object struct {
	Name        string
	Description string
	Placement   int
	Commands    map[string]prompt.MenuItem
}

Object is a base level instantiation of any world item.

func (*Object) AddCommands

func (o *Object) AddCommands(cmdItem string, cmdCmd string)

func (*Object) ChangePlacement

func (o *Object) ChangePlacement(place int) bool

func (*Object) EmptyCommands

func (o *Object) EmptyCommands()

func (*Object) RemoveCommand

func (o *Object) RemoveCommand(cmdItem string)

func (*Object) SerializeCommands

func (o *Object) SerializeCommands() string

func (*Object) String

func (o *Object) String() string

type PromptStyle

type PromptStyle int

type Room

type Room struct {
	Object
	sync.Mutex

	RoomId  int //room_id from database
	Creator string
	Exits   map[string]*Exit
	Mobs    *MobInventory
	Chars   *CharInventory
	Items   *ItemInventory
	Flags   map[string]bool
	// This is a whole number percentage out of 100
	EncounterRate int
	// MobID mapped to an encounter percentage
	EncounterTable    map[int]int
	EvacuateTime      time.Time
	LastEffectTime    time.Time
	LastEncounterTime time.Time
	EncounterSpeed    int
	EncounterJigger   int
	StoreOwner        string
	StoreInventory    *ItemInventory
	Songs             map[string]string
	LockPriority      string
}

Room contains the map of fields for a room in nexus

func LoadRoom

func LoadRoom(roomData map[string]interface{}) (*Room, bool)

func (*Room) AddStoreItem

func (r *Room) AddStoreItem(item *Item, price int, infinite bool)

func (*Room) CleanExits

func (r *Room) CleanExits()

func (*Room) CleanRoom

func (r *Room) CleanRoom()

func (*Room) ClearMob

func (r *Room) ClearMob(o *Mob)

func (*Room) ContinueEmpty

func (r *Room) ContinueEmpty() bool

func (*Room) Crowded

func (r *Room) Crowded() (crowded bool)

Crowded Evaluate if there are too many players in this rooms inventory

func (*Room) ElementalDamage

func (r *Room) ElementalDamage()

func (*Room) Encounter

func (r *Room) Encounter()

func (*Room) FindExit

func (r *Room) FindExit(exitName string, observer *Character) *Exit

func (*Room) FirstPerson

func (r *Room) FirstPerson()

FirstPerson Actions to be taken on the first person entering a room

func (*Room) FleeMob

func (r *Room) FleeMob(o *Mob)

func (*Room) LastPerson

func (r *Room) LastPerson()

func (*Room) LockRoom

func (r *Room) LockRoom(lockRequester string, suppress bool)

func (*Room) Look

func (r *Room) Look(looker *Character) (buildText string)

Look Drop out the description of this room

func (*Room) MessageAll

func (r *Room) MessageAll(Message string)

func (*Room) MessageMovement

func (r *Room) MessageMovement(previous int, new int, subject string)

func (*Room) MessageVisible

func (r *Room) MessageVisible(Message string)

func (*Room) Save

func (r *Room) Save()

func (*Room) SongPlaying

func (r *Room) SongPlaying(songName string) bool

func (*Room) ToggleFlag

func (r *Room) ToggleFlag(flagName string) bool

func (*Room) UnlockRoom

func (r *Room) UnlockRoom(lockRequester string, suppress bool)

func (*Room) WanderMob

func (r *Room) WanderMob(o *Mob)

type Spell

type Spell struct {
	Name        string
	Description string
	Chant       string
	Cost        int
	Magnitude   int
	Effect      string
	Classes     map[string]int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL