spells

package
v0.9.2-migration.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaitRoundsDefault = 3

	Neutral    SpellType = "neutral"    // Neutral, no expected actor target, use on
	HarmSingle SpellType = "harmsingle" // Harmful, defaults to current aggro - magic missile etc
	HarmMulti  SpellType = "harmmulti"  // Harmful, defaults to all aggro mobs - chain lightning etc
	HelpSingle SpellType = "helpsingle" // Helpful, defaults on self - heal etc
	HelpMulti  SpellType = "helpmulti"  // Helpful, defaults on party - mass heal etc
	HarmArea   SpellType = "harmarea"   // Hits everyone in the room, even if hidden or friendly
	HelpArea   SpellType = "helparea"   // Hits everyone in the room, even if hidden

	SchoolRestoration SpellSchool = "restoration" // Healing, curing conditions, etc.
	SchoolIllusion    SpellSchool = "illusion"    // Light, darkness, invisibility, blink, etc.
	SchoolConjuration SpellSchool = "conjuration" // Summoning, teleportation, etc.
)

Variables

This section is empty.

Functions

func CreateNewSpellFile

func CreateNewSpellFile(newSpellInfo SpellData) (string, error)

func FindSpell

func FindSpell(spellName string) string

Finds a match for a spell by name or id

func GetAllSpells

func GetAllSpells() map[string]*SpellData

func LoadSpellFiles

func LoadSpellFiles()

func Summon

func Summon(sourceUserId int, sourceMobId int, details any) (bool, error)

Types

type SpellData

type SpellData struct {
	SpellId     string      `yaml:"spellid,omitempty"`
	Name        string      `yaml:"name,omitempty"`
	Description string      `yaml:"description,omitempty"`
	Type        SpellType   `yaml:"type,omitempty"`
	School      SpellSchool `yaml:"school,omitempty"`
	Cost        int         `yaml:"cost,omitempty"`
	WaitRounds  int         `yaml:"waitrounds,omitempty"`
	Difficulty  int         `yaml:"difficulty,omitempty"` // Augments final success chance by this %
}

func FindSpellByName

func FindSpellByName(spellName string) *SpellData

func GetSpell

func GetSpell(spellId string) *SpellData

func (*SpellData) Filepath

func (s *SpellData) Filepath() string

SpellData implements the Filepath method from the Loadable interface.

func (*SpellData) GetDifficulty

func (s *SpellData) GetDifficulty() int

func (*SpellData) GetScript

func (s *SpellData) GetScript() string

func (*SpellData) GetScriptPath

func (s *SpellData) GetScriptPath() string

func (*SpellData) Id

func (s *SpellData) Id() string

func (*SpellData) Validate

func (s *SpellData) Validate() error

type SpellSchool

type SpellSchool string

type SpellType

type SpellType string

func (SpellType) HelpOrHarmString

func (s SpellType) HelpOrHarmString() string

func (SpellType) TargetTypeString

func (s SpellType) TargetTypeString(short ...bool) string

Jump to

Keyboard shortcuts

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