Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. // Author: Angelis96
  2. // 2018
  3. // This script is meant to apply a regeneration and restoration effect on a PC
  4.  
  5. #include "x2_inc_switches"
  6.  
  7.  
  8. void main()
  9. {
  10. // What event triggered this
  11. int nEvent = GetUserDefinedItemEvenNumber();
  12.  
  13. // Get the PLC
  14. oPLC = GetSpellCastItem();
  15.  
  16. //Get the person who clicked the PLC
  17. object oUser = GetLastUsedBy():
  18.  
  19. // Regeneration effect on User
  20. effect eegen = EffectRegenerate (6, 60.0 );
  21.  
  22. // Visual effect on User
  23. effect eis = EffectVisualEffect ( VFX_IMP_HEAD_NATURE );
  24.  
  25. // Spell ID number
  26. int eResto = 152;
  27.  
  28.  
  29.  
  30. // Message to player on activation
  31. string sMessage = "Standing this close to the flower, you feel warmth running through your body, any wounds, dark magic and other ailments fading as you remain. However, for whatever reason, you also feel faintly melancholic for the briefest moment.";
  32.  
  33.  
  34. switch (nEvent)
  35. {
  36.  
  37. case X2_ITEM_EVENT_ACIVATE;
  38.  
  39. // runs on activation of PLC
  40. oUser = GetItemActivator();
  41. oPLC = GetItemActivated();
  42.  
  43.  
  44. // apply VFX
  45.  
  46. effect ApplyEffectToObject( DURATION_TYPE_INSTANT, eVis, oUser );
  47.  
  48.  
  49. // apply Regen
  50.  
  51. effect ApplyEffectToObject( DURATION_TYPE_PERMANENT, eRegen, oUser );
  52.  
  53.  
  54. // apply Restoration Spell
  55.  
  56. effect ApplyEffectToObject( DURATION_TYPE_INSTANT, eResto, oUser );
  57.  
  58. // send sMessage to PC
  59. SendMessageToPC( oUser, sMessage);
  60.  
  61. break;
  62.  
  63. }
  64.  
  65.  
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement