npc_live_dialogues.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //===== rAthena Script =======================================
  2. //= Sample: Live Dialogue
  3. //===== By: ==================================================
  4. //= Lupus
  5. //===== Last Updated: ========================================
  6. //= 20140208
  7. //===== Description: =========================================
  8. //= An example of an NPC with live dialogue.
  9. //= Note: This relies on Global_Functions.txt to run.
  10. //============================================================
  11. prontera,167,177,5 script Luppy 1107,{
  12. mes "[Luppy]";
  13. // Say a random greeting from Global_Functions.txt
  14. mes callfunc("F_Hi");
  15. // Say a compliment according to player's gender
  16. // 1st string is for FEMALE, 2nd for MALE
  17. mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!");
  18. // Add some random greeting and goodbye into the menu
  19. if (select(callfunc("F_Hi"), callfunc("F_Bye")) != 1) {
  20. mes "[Luppy]";
  21. // Add some random goodbye from Global_Functions.txt
  22. mes callfunc("F_Bye");
  23. close;
  24. }
  25. mes "[Luppy]";
  26. // Give a random prize from set list of items
  27. if (@gotstuff){
  28. // Again, say stuff according to player's gender
  29. mes "I like "+callfunc("F_Sex","smiling ladies!","bloody pirates!");
  30. // Show one of 3 emotion from the list (we added ,1 to show emotion over PLAYER's head)
  31. emotion callfunc("F_Rand",e_scissors,e_kis,e_pat),1;
  32. close;
  33. }
  34. // We set a temp var to give present just once. Player can get more by relogging.
  35. @gotstuff = 1;
  36. // Get item ID from the list of presents: Apple, Mastela Fruit, Yggdrasil Seed or Orange Juice
  37. .@itemIDfromList = callfunc("F_Rand",512,522,608,620);
  38. // Again, say stuff according to player's gender
  39. mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(.@itemIDfromList)+" for you!";
  40. // Get the item from the list
  41. getitem .@itemIDfromList,1;
  42. close;
  43. }