Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. void main()
  2. {
  3. //Retrieve the thing that activated the object. Let's call it "oPC".
  4. object oPC = GetItemActivator();
  5.  
  6. //Retrieve the thing that the object targeted. Let's call it "oTarget".
  7. object oTarget = GetItemActivatedTarget();
  8.  
  9. //Check whether: the target is player-controlled, the user is NOT the player, or the target
  10. //is NOT valid for some reason. If any of those are true, we stop right here. Bad.
  11. if (GetIsPC(oTarget) || !GetIsPC(oPC) || !GetIsObjectValid(oTarget))
  12. return;
  13.  
  14. //Check if oTarget is a creature... if it is, we continue with a block of code which will ONLY
  15. //run if this was true
  16. if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
  17. { //This { bracket came after the if, so the code inside these brackets will only run if the condition was met
  18.  
  19. //Still here? That means all conditions were met, time to dominate.
  20.  
  21. //Create an effect, call it "eDom". The effect is of type "EffectCutsceneDominated()"
  22. //This effect ignores any mind resistances or immunities, and is guaranteed to work
  23. //(used for cutscenes a long time ago)
  24. effect eDom = EffectCutsceneDominated();
  25.  
  26. //Apply the effect eDom to the object oTarget. Duration is permanent.
  27. ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDom, oTarget);
  28.  
  29. } //This is the end of the block of code just for the "if" statement above
  30.  
  31. else //When there's an "if", there can be an "else"... if the "if" condition did not succeed, then we can run another block of code here
  32. {
  33. return; //This kills the script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement