Aller au contenu

Photo

Summon


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
As soon as summoned, the creature unsommons. Help? :)

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));

}

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Are you firing the script from a conversation?

#3
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Yes.

#4
Terrorble

Terrorble
  • Members
  • 194 messages
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.

#5
bdtgazo

bdtgazo
  • Members
  • 53 messages
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.