Bartender Remember Script

Login to reply  Page: « < 1 of 1 > »
17 Feb 2010 - 10:432349
Bartender Remember Script
This is a request for Dare. Basically, the first time you walk into the bar (on a reset) the bartender will give you a free drink and remember you so you don't get one again (until the zone resets). It's 2 triggers.

First Trigger (set as a GREET trigger):
* Sets the serve variable to 1 in case the person is new.
set serve 1
global serve
* Wait for the memory trigger to check and set %serve% to 0 if pc is remembered.
wait 2s
if %actor.is_pc% && %direction% == south
  if %actor.level% < 5
    say You're too young to be in here!
    Wait 1 sec
    say GET LOST!!!
    %force% %actor.name% s
    wait 2 sec
    shout AND STAY OUT!
  else
    if %actor.is_pc% && %serve% == 1
      emote nods at %actor.name%.
      Say Welcome!
      wait 2 s
      switch %random.3%
        case 1
          say Have a free shot on the House.
          %load% obj 55267 %actor% inv
          emote slides a shotglass to you from across the bar.
          %force% %actor% drink shot
          mremember %actor.name%
        break
        case 2
          say Have a free beer on the House.
          %load% obj 55268 %actor% inv
          emote slides a mug to you from across the bar.
          %force% %actor% drink mug
          mremember %actor.name%
        break
        default
          say Have a free ale on the House.
          %load% obj 55269 %actor% inv
          emote slides a tankard to you from across the bar.
          %force% %actor% drink tankard
          mremember %actor.name%
        break
      Done
    end
  end
end

Second trigger (set as MEMORY trigger):
* give the first trigger a second to determine if the player has been seen before.
wait 1
set serve 0
global serve



Last edited by Axanon (17 Feb 2010 - 10:47)
18 Feb 2010 - 02:572356
It works... Kinda... You can enter, get your drink, leave and enter again without getting another free drink. But if you were to leave and enter again, you get another free drink...


18 Feb 2010 - 06:582357
Edited:

This should work and remove the need for the second script:

if %actor.is_pc% && %direction% == south
  if %actor.level% < 5
    say You're too young to be in here!
    wait 1 s
    say GET LOST!!!
    %force% %actor% s
    wait 2 s
    shout AND STAY OUT!
  else
    context %actor.id%
    if %actor.is_pc% && %serve% != 1
      emote nods at %actor.name%.
      say Welcome!
      wait 2 s
      switch %random.3%
        case 1
          say Have a free shot on the House.
          %load% obj 55267 %actor% inv
          emote slides a shotglass to you from across the bar.
          %force% %actor% drink shot
        break
        case 2
          say Have a free beer on the House.
          %load% obj 55268 %actor% inv
          emote slides a mug to you from across the bar.
          %force% %actor% drink mug
        break
        default
          say Have a free ale on the House.
          %load% obj 55269 %actor% inv
          emote slides a tankard to you from across the bar.
          %force% %actor% drink tankard
        break
      done
      set serve 1
      global serve
    end
  end
end

suggested reading: Help context


__________________
Login to reply  Page: « < 1 of 1 > »