Skip to content

Placeables to cast spells

ForgeForge Member Posts: 32
Is it possible to make a placeable, like a pedestal to cast a spell into a waypoint?

Tried using the UserDefinedEvent for this, and SignalEvent but couldn't get it to work.

It worked using a creature, but not with a normal placeable.

Code below:



void main()

{


object oSelf = OBJECT_SELF;

object oLoc = GetNearestObjectByTag("Spawn_loc");
location lLoc = GetLocation(oLoc);
int nSpell = SPELL_RAY_OF_FROST;

int nEvent = GetUserDefinedEventNumber();

switch(nEvent)
{
case(14):
{

ActionCastSpellAtLocation(nSpell, lLoc, TRUE, TRUE);

break;

}


}


}




Put this into the OnUserDefined script for the pedestal.

SignalEvent command for case 14 is on a conversation with an altar.

Code below:



SignalEvent(GetNearestObjectByTag("Pedestal"),EventUserDefined(14));



Is there a way to make this work?

I tried also tweaking with the AssignCommand but it didn't produce results either.

Thank you in advance.

Comments

  • raz651raz651 Member Posts: 175
    did you make the placeable useable instead of static?
  • ForgeForge Member Posts: 32
    Yes, I did that. They're useable.
  • ProlericProleric Member Posts: 1,316
    The third parameter should be METAMAGIC_ANY rather than TRUE. AssignCommand is the simplest method.
  • ForgeForge Member Posts: 32
    edited May 2018
    I could make the pedestal speak a string, etc with AssingCommand. But cant make it cast a spell on either an object or a location which is a waypoint in this case.

    Am I missing something here, or cant placeables cast spells?
  • ForgeForge Member Posts: 32
    edited May 2018
    Case solved.
    I can simulate a beam, etc by EffectVisualEffect and ApplyEffectToObject or location.

    Created an user defined event for the visuals. No spells involved.



    Thank you everybody for your answers and help. :)
Sign In or Register to comment.