Hi guys,
Long time reader, but first time poster.
It could be a hangover speaking, but i can't my head right about this part.....
Im creating a race that will summon dead allies, and change them to a specific race for the duration of the round (or until they die).
The summon and change race is working fine, and i've declared a global string that captures their current race prior to summon, so that on death or round end, they get changed back to their original race again.
The problem i'm facing is that each time a new ally is summoned, ALL players i've summoned have their original race 'reset'.
So i summon an Orcish Horde -> i change his race automatically to X -> he dies and gets auto changed back to Orcish Horde. [ALL GOOD HERE]
BUT
If i summon an Orcish and change his race automatically to X --> then i summon a Human Alliance and change his race to X, then when either / both die, they BOTH get changed back to Human Alliance.
How can i define a variable string so that every 'summoned' player reverts back to their individual race on death or round end?
The coding i'm using is:
SUMMON --> works good
ON DEATH TO REVERT RACE:
And obviously i've declared origrace as a global string.
Can anyone help here please?
Cheers guys
Long time reader, but first time poster.
It could be a hangover speaking, but i can't my head right about this part.....
Im creating a race that will summon dead allies, and change them to a specific race for the duration of the round (or until they die).
The summon and change race is working fine, and i've declared a global string that captures their current race prior to summon, so that on death or round end, they get changed back to their original race again.
The problem i'm facing is that each time a new ally is summoned, ALL players i've summoned have their original race 'reset'.
So i summon an Orcish Horde -> i change his race automatically to X -> he dies and gets auto changed back to Orcish Horde. [ALL GOOD HERE]
BUT
If i summon an Orcish and change his race automatically to X --> then i summon a Human Alliance and change his race to X, then when either / both die, they BOTH get changed back to Human Alliance.
How can i define a variable string so that every 'summoned' player reverts back to their individual race on death or round end?
The coding i'm using is:
SUMMON --> works good
Code: [Select]
origrace = War3_GetRace(target);
new x=War3_GetRaceIDByShortname("xrace");
War3_CooldownMGR(client,SummonCD[skill_summon],thisRaceID,SKILL_SUMMON,_,_);
War3_SpawnPlayer(target);
War3_SetRace(target,x);ON DEATH TO REVERT RACE:
Code: [Select]
public OnWar3EventDeath(victim, attacker)
{
new x=War3_GetRaceIDByShortname("xrace");
if(War3_GetRace(victim)==x)
{
War3_SetRace(victim,origrace);
}
}And obviously i've declared origrace as a global string.
Can anyone help here please?
Cheers guys


Logged


