- Joined
- Dec 2, 2016
- Messages
- 733
I've been getting desync's in my game around 30 mins +
Specifically the flame effect function. I didn't started getting desync's until I added that.
Basically when I type -c rug it adds the flame effect + the other effect to all the hero models and unit models. Basically can be about 10 units in the map. They keep that effect all game long. Also changes the units tint.
Specifically the flame effect function. I didn't started getting desync's until I added that.
Basically when I type -c rug it adds the flame effect + the other effect to all the hero models and unit models. Basically can be about 10 units in the map. They keep that effect all game long. Also changes the units tint.
JASS:
library colorCmd requires libMisc, unitClassification, clanTag {
// Public Api
public struct ColorCmd {
public static method decorateUnit(unit u) {
integer pId = GetPlayerId(GetOwningPlayer(u));
integer i = 0;
integer color;
string dev = GetPlayerName(Player(pId));
if (!ClanTag.checkMember(pId, COLOR_ACCESS_1)&& dev != "[RG]RugarusVF") {
if (players[pId].side == SIDE_MINION) {
return;
}
color = 0;
}
else {
for (COLOR_MAX >= i > 0) {
if (ClanTag.checkMember(pId, color2Access[i]) || dev == "[RG]RugarusVF") {
color = i;
break;
}
}
}
if (players[pId].side == SIDE_HUMAN) {
humanColors[color].recolorUnit(u);
}
else {
vampireColors[color].recolorUnit(u);
}
}
}
function flameEffect() {
integer pId = GetPlayerId(GetOwningPlayer(GetEnumUnit()));
string dev = GetPlayerName(Player(pId));
if (GetUnitTypeId(GetEnumUnit()) == 'E002' || GetUnitTypeId(GetEnumUnit()) == 'E001' || GetUnitTypeId(GetEnumUnit()) == 'U007' || GetUnitTypeId(GetEnumUnit()) == 'U008' || GetUnitTypeId(GetEnumUnit()) == 'AVFV') {
AddSpecialEffectTargetUnitBJ("head", GetEnumUnit(), "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl");
AddSpecialEffectTargetUnitBJ("head", GetEnumUnit(), "Abilities\\Weapons\\GargoyleMissile\\GargoyleMissile.mdl");
}
else if (GetUnitTypeId(GetEnumUnit()) == 'h010') {
UnitRemoveAbilityBJ( 'A02B', GetEnumUnit());
UnitAddAbilityBJ( 'A04B', GetEnumUnit());
}
}
function onColor() -> boolean {
string s = StringCase(GetEventPlayerChatString(), false);
integer pId = GetPlayerId(GetTriggerPlayer());
integer startPos;
integer color;
string dev = GetPlayerName(Player(pId));
if (SubString(s, 0, 8) == "-colour ") {
startPos = 8;
}
else if (SubString(s, 0, 7) == "-color ") {
startPos = 7;
}
else if (SubString(s, 0, 3) == "-c ") {
startPos = 3;
}
else {
return false;
}
s = SubString(s, startPos, StringLength(s));
if (s == "clear" || s == "none" || s == "black") {
color = COLOR_DEFAULT;
}
else if (s == "rug" && dev =="[RG]RugarusVF") {
color = COLOR_RUG;
ForGroupBJ(GetUnitsInRectAll(GetEntireMapRect()),function flameEffect);
}
if (players[pId].side == SIDE_HUMAN) {
humanColors[color].recolorUnit(players[pId].main);
}
else {
vampireColors[color].recolorUnit(players[pId].main);
}
return false;
}
private function onInit() {
trigger trg = CreateListedTrigger();
integer i;
humanColors[COLOR_RUG] = ARGB.create(255,3, 155,155);
vampireColors[COLOR_RUG] = ARGB.create(255,3, 155,155);
color2Access[COLOR_RUG] = COLOR_ACCESS_5;
for (0 <= i <= 11) {
TriggerRegisterPlayerChatEvent(trg, Player(i), "-colour", false);
TriggerRegisterPlayerChatEvent(trg, Player(i), "-color", false);
TriggerRegisterPlayerChatEvent(trg, Player(i), "-c", false);
}
TriggerAddCondition(trg, Condition(function onColor));
}
}