• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Creatures cast spells simultaneously on different targets?

munch

New Member
Joined
Mar 26, 2010
Messages
143
Reaction score
0
Not a request, just curious.
Is it possible to make a creature use 3 attacks simultaneously on 3 different targets?

Creature attack 1: Melee
Creature attack 2: Spellcast
Creature attack 3: Spellcast

None of the attacks will exhaust each other and can be used simultaneously.
Neither can any of the attacks target the same player.

If so, would it require really advanced coding and scripting?

PS!
Creature as in a monster.
 
It would be really advanced scripting, but I don't think any source code edits would be needed. As for it actually targeting 3 different people at the same time, I do not think that is possible. Executing the spells very quickly depending on a variable of each target should be possible, determining when to stop would probably include a global storage that is increased by 1 each time a spell is executed, stopping after the 3 targets are hit
 
Ah, that's a great solution! It would almost be the same though.
But could it be possible to make each of the spells not target the same player within that execution?
 
Yes its possible, you don't need to actually target 3 players at once, but instead keep 1 target and cast custom spells that find valid players it can attack and randomly cast at them. If you really wanted, you could probably recreate a spell casting system with onThink function for the monster?
 
If it stops executing after one spell, wouldn't the other spells also stop?
Would it be a possible solution to somewhat copy the player's name to make the next spell to not attack that player within that execution?
F.ex. when the first spell is casted, it copies the targeted player's name to be non-targetable for the next spell.
 
Yep, you could store the last attacked cid in a variable (or global storage if this is a single monster), or even create a dummy spell that's casted often, which will determine who gets hit and plan its next targets ahead, then use addEvent's for delays and cast the spell through that. There are a ton of ways you could do this, not attacking the same target twice isn't the hard part here.

If all 3 spells are always casted in a group, why not create a single spell that when executed, does melee damage if its within range of its target, finds 2 players around them and does something like doTargetCombatHealth(cid, target, type, min, max, effect) ? If its all one spell, it wont have any shared exhaust?
 
It does not necessarily need to be in one and same spell, but yes, the idea was to not make the spells exhaust each other, but still have an exhaustion for itself.

That also sounds like a really great solution too! Food for thought, indeed.
 
Back
Top