And there is my experiment. I tried to add blink spell, the one that Stalkers in SC2 have.
1)Added ensnare button to dragoon's button set.
2)Put useweapon 117 instead of castspell opcode in dragoon's icript inside the DragoonCastSpell section.
3)Set unused weapon's no 117 targeting to terrain in weapons.dat.
4)Added this abomination into weapon_fire.cpp
Quote
//Blink
if (unit->id == UnitId::dragoon)
{
//if (unit->unusedTimer = 0)
//{
//if (weapons_dat::Weapon[weaponId] == 117);
{
CUnit *target = unit->orderTarget.unit;
unit->unusedTimer = 40;
u32 TeleportX = unit->orderTarget.pt.x - 20;
u32 TeleportY = unit->orderTarget.pt.y;
unit->position.x = TeleportX;
unit->position.y = TeleportY;
}
if (unit->id == UnitId::dragoon)
{
//if (unit->unusedTimer = 0)
//{
//if (weapons_dat::Weapon[weaponId] == 117);
{
CUnit *target = unit->orderTarget.unit;
unit->unusedTimer = 40;
u32 TeleportX = unit->orderTarget.pt.x - 20;
u32 TeleportY = unit->orderTarget.pt.y;
unit->position.x = TeleportX;
unit->position.y = TeleportY;
}
https://www.youtube.com/watch?v=9XoRKs1T1Oc&feature=youtu.be
If anyone could help me with making dragoons blink I'd be grateful. The perfect way for me would be blink using 0 energy but having a few seconds delay (probably using unusedTimer would make this possible).
Attachments:
None.