(e events.Event)
| 132 | } |
| 133 | |
| 134 | func (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 | } |
nothing calls this directly
no test coverage detected