diff options
| author | historia <[not public]> | 2026-06-25 20:33:47 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 20:33:47 -0400 |
| commit | 84d74ca4351a97148ad8339676f9df7946bc21fb (patch) | |
| tree | a9f50ac56e8bbcdf2b307ef6f7143b67bce46c61 /internal/game/act_talk.go | |
| parent | c55d0e4150b23f2c5c9f96bbc3d4dc2fc6dbaa36 (diff) | |
| download | thehouseoficarus-84d74ca4351a97148ad8339676f9df7946bc21fb.tar.gz | |
feat: trigger system for scripted events added.
Diffstat (limited to 'internal/game/act_talk.go')
| -rw-r--r-- | internal/game/act_talk.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/game/act_talk.go b/internal/game/act_talk.go index f54290a..14361f8 100644 --- a/internal/game/act_talk.go +++ b/internal/game/act_talk.go @@ -14,6 +14,10 @@ import ( ) func (g *Game) startMobTalk(sess *net.Session, p *player.Player, mob *world.MobInstance) { + if mob.OwnerOnly && mob.Owner != "" && mob.Owner != p.Name { + sess.WriteLine("They ignore you.") + return + } cfg := mob.TalkConfig if cfg == nil { sess.WriteLine("This person has nothing to say.") @@ -267,7 +271,7 @@ func (g *Game) applyNodeAction(sess *net.Session, na *behavior.NodeAction) { sess.WriteLine(fmt.Sprintf("You don't have enough Reputation. (Need %d, have %d)", na.ReputationCost, rep)) return } - setPlayerFlag(p, "assassin_reputation", rep-na.ReputationCost) + g.setPlayerFlag(p, "assassin_reputation", rep-na.ReputationCost) g.AccountStore.SaveCharacter(p) } @@ -275,8 +279,7 @@ func (g *Game) applyNodeAction(sess *net.Session, na *behavior.NodeAction) { g.Flags.Set(k, v) } for k, v := range na.SetPlayerFlags { - p.EnsureFlags() - p.Flags[k] = v + g.setPlayerFlag(p, k, v) } if na.TakeItem != "" { if p.HasItem(na.TakeItem) { @@ -323,6 +326,6 @@ func (g *Game) applyNodeAction(sess *net.Session, na *behavior.NodeAction) { g.processSawmill(sess, p) } if na.ApsNode { - setPlayerFlag(p, "aps_node_"+strconv.Itoa(p.RoomID), true) + g.setPlayerFlag(p, "aps_node_"+strconv.Itoa(p.RoomID), true) } } |
