Aller au contenu

Photo

create aoe fireball at impact of projectile (solved)


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

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i have code that makes a bolt or something similar fly from one waypoint and then create an impact event at another endpoint. what kind of code would i need to make this bolt explode and do aoe damage to both the player and enemies in the area?

Modifié par gordonbrown82, 06 mars 2010 - 06:43 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Are you looking for something like this?
object[] arTargets = GetObjectsInShape(OBJECT_TYPE_CREATURE, SHAPE_SPHERE, lTarget, 3.0);                            '
int nArraySize = GetArraySize(arTargets);
int n;
for (n = 0; n < nArraySize; n++)
{
    DamageCreature(arTargets[n], arTargets[n], RandomFloat() * 100.0, DAMAGE_TYPE_FIRE);
}

Modifié par Craig Graff, 05 mars 2010 - 02:29 .


#3
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
Where does oTargets come from?

#4
Challseus

Challseus
  • Members
  • 1 032 messages

gordonbrown82 wrote...

Where does oTargets come from?


It's a typo. It should be arTargets, as defined earlier.

#5
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
everything works except damaging the creatures inside the aoe. when the player stands inside the aoe a damage of 0 appears above his head.

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i did another test just putting the damagecreature function in a trigger and running my pc over it and i got the same result even though i had DamageCreature(oPC, oPC, 100.0, DAMAGE_TYPE_FIRE, TRUE);



these are the include files in the script that contains the DamageCreature function:

#include "wrappers_h"

#include "events_h"

#include "ability_h"