Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- //Retrieve the thing that activated the object. Let's call it "oPC".
- object oPC = GetItemActivator();
- //Retrieve the thing that the object targeted. Let's call it "oTarget".
- object oTarget = GetItemActivatedTarget();
- //Check whether: the target is player-controlled, the user is NOT the player, or the target
- //is NOT valid for some reason. If any of those are true, we stop right here. Bad.
- if (GetIsPC(oTarget) || !GetIsPC(oPC) || !GetIsObjectValid(oTarget))
- return;
- //Check if oTarget is a creature... if it is, we continue with a block of code which will ONLY
- //run if this was true
- if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
- { //This { bracket came after the if, so the code inside these brackets will only run if the condition was met
- //Still here? That means all conditions were met, time to dominate.
- //Create an effect, call it "eDom". The effect is of type "EffectCutsceneDominated()"
- //This effect ignores any mind resistances or immunities, and is guaranteed to work
- //(used for cutscenes a long time ago)
- effect eDom = EffectCutsceneDominated();
- //Apply the effect eDom to the object oTarget. Duration is permanent.
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDom, oTarget);
- } //This is the end of the block of code just for the "if" statement above
- 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
- {
- return; //This kills the script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement