MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / checkGuide

Method checkGuide

modules/newbieguide/newbieguide.go:134–158  ·  view source on GitHub ↗
(e events.Event)

Source from the content-addressed store, hash-verified

132}
133
134func (m *newbieGuideModule) checkGuide(e events.Event) events.ListenerReturn {
135
136 evt := e.(events.LevelUp)
137
138 user := users.GetByUserId(evt.UserId)
139 if user == nil {
140 return events.Continue
141 }
142
143 guideMobId := m.guideMobId()
144
145 if user.Character.Level >= m.maximumPlayerLevel() {
146 for _, mobInstanceId := range user.Character.CharmedMobs {
147 if mob := mobs.GetInstance(mobInstanceId); mob != nil {
148 if mob.MobId == mobs.MobId(guideMobId) {
149 mob.Command(`say I see you have grown much stronger and more experienced. My assistance is now needed elsewhere. I wish you good luck!`)
150 mob.Command(`emote clicks their heels together and disappears in a cloud of smoke.`, 10)
151 mob.Command(`suicide vanish`, 10)
152 }
153 }
154 }
155 }
156
157 return events.Continue
158}

Callers

nothing calls this directly

Calls 6

guideMobIdMethod · 0.95
maximumPlayerLevelMethod · 0.95
GetByUserIdFunction · 0.92
GetInstanceFunction · 0.92
MobIdTypeAlias · 0.92
CommandMethod · 0.45

Tested by

no test coverage detected