- Joined
- Nov 15, 2015
- Messages
- 281
- Reaction score
- 53
- First Language
- English
- Primarily Uses
@moldy can you show how the graves at revive work in your game? how about AoE revive skills?
I actually didn't test out the group revive script call, since I don't plan to use it. I tried it just now but it didn't work. This common event is what I use for single target revive (it revives 1 ally in order of event id on the map, as soon as it revives someone, it exits the code. You can probably remove "break" if you wanna revive more than one ally at a time). Last two lines of code are optional, my revive skill targets a cell adjacent to the reviver and teleports the revived unit next to them since they only get a few HP back and they can last more than a turn after being brought back.
Code:
for (var i = 1; i <= $gameMap.events().length; i++) {
var battleunit = $gameSystem.EventToUnit([i]);
var eventunit = $gameMap.event([i]);
if (battleunit && eventunit && (battleunit[0] === 'actor') && (battleunit[1].actorId() != 98) && (battleunit[1].isDead())) {
this.unitRaise(i);
battleunit[1].gainHp(Math.floor(battleunit[1].mhp*0.3));battleunit[1].startDamagePopup();
battleunit[1].gainMp(Math.floor(battleunit[1].mmp*0.3));battleunit[1].startDamagePopup();
break;
}
};
$gameMap.event(i).setPosition($gamePlayer.posX(),$gamePlayer.posY());
$gameMap.event(i).requestAnimation(267);
I added "battleunit[1].actorId() != 98" because that's the actor ID of a summoned entity and I don't want units being able to just revive summons instead of needing to resummon them.