Author Topic: Activating Rod Of Wonder with a trigger  (Read 364 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Activating Rod Of Wonder with a trigger
« on: November 13, 2011, 11:36:59 am »


               I would like to set up a trigger so that when a character crosses it, the PC gets the same effect as if Rod of Wonder was used on the PC. It would seem that placing x0_s3_rodwonder OnEnter is not sufficient. What do I need to do to get a trigger to execute a default script like this?
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Activating Rod Of Wonder with a trigger
« Reply #1 on: November 13, 2011, 12:54:52 pm »


               void main()

 object oPC = GetEnteringObject();
 object oCaster = GetNearestObject (OBJECT_TYPE_PLACEABLE);
 // Needed if PC only 
 if (!GetIsPC (oPC)) return;

AssignCommand (oCaster, ActionCastSpellAtObject (499, oPC, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
}


  I didn't have any luck trying to get the trigger to cast it, but it will work with either the nearest placeable being the caster, or the PC themselves.