Advertisement
Mudbill

Mementos + Key unlock (Amnesia)

Mar 29th, 2013
1,308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. void OnStart()
  2. {
  3. AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
  4.  
  5. AddEntityCollideCallback("Player", "AreaMemento", "EventQuest", true, 1);
  6. }
  7.  
  8. void UseKeyOnDoor(string &in asItem, string &in asEntity)
  9. {
  10. SetSwingDoorLocked(asEntity, false, true);
  11. PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
  12. RemoveItem(asItem);
  13.  
  14. SetLocalVarInt("Switch", 1);
  15. CompleteQuest("door", "touchdoor");
  16. }
  17.  
  18. void PickUpLantern(string &in asEntity, string &in type)
  19. {
  20. AddQuest("lantern", "pickuplantern");
  21. }
  22.  
  23. void EventQuest(string &in asParent, string &in asChild, int alState)
  24. {
  25. AddQuest("area", "enterarea");
  26. }
  27.  
  28. void TouchDoor(string &in asEntity)
  29. {
  30. if(GetLocalVarInt("Switch") == 0)
  31. {
  32. AddQuest("door", "touchdoor");
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement