Author Topic: Summon  (Read 260 times)

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Summon
« on: August 13, 2013, 02:56:47 am »


               As soon as summoned, the creature unsommons. Help? '<img'>

object oPC = GetPCSpeaker();
object oStatue = GetNearestObjectByTag("Statue");
location lLocation = GetLocation(oPC);
string sResRef = GetLocalString(oStatue, "resref");
int nSorcerer = GetLevelByClass(CLASS_TYPE_SORCERER, oPC);
int nWizard = GetLevelByClass(CLASS_TYPE_WIZARD, oPC);
int nDuration = nSorcerer + nWizard * 2;

DestroyObject(oStatue);

effect eSummon = EffectSummonCreature(sResRef, 135, 0.0, 0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSummon, oPC, TurnsToSeconds(nDuration));

AssignCommand(oPC,ActionCastFakeSpellAtObject(SPELL_IMPROVED_INVISIBILITY, oPC));

}
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Summon
« Reply #1 on: August 13, 2013, 03:07:41 am »


               Are you firing the script from a conversation?
               
               

               
            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Summon
« Reply #2 on: August 13, 2013, 04:47:29 am »


               Yes.
               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Summon
« Reply #3 on: August 14, 2013, 03:19:05 pm »


               Does you PC have sorceror or wizard levels?  If you add:

SendMessageToPC(oPC,"Duration: "+IntToString(nDuration));

is it giving a correct result for the duration?

You don't accidentally have the script firing from more than one spot at the same time do you?  e.g. I had a script on both the TextAppearsWhen tab and ActionsTaken tab and it caused some problems.
               
               

               
            

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Summon
« Reply #4 on: August 20, 2013, 11:44:16 pm »


               One thing I noticed is your nDuration.  Your wizard levels are counting as x2, and then adding in sorc levels.  You need (nSorc+ nWiz) * 2 I believe.  Of course, I'm just coming back after a long hiatus due to computer death x2, so I could be mistaken.

I have tried and failed several times to get a good summons script going from onactivate.  Never tried from a conversation.

What about just setting variables on the speaker, editing the actual spell to check for the variables, and then force casting the spell from the conversation's script?

So the spell would fire, checking the variables on the PC, and if found, the summons you want summoned is spawned in.  That's how I would do it.