local maps = {
[1] = {mapName = "Ignitos", redTemple = {x = 1153, y = 1069, z = 6}, blueTemple = {x = 1146, y = 1120, z = 6}},
[2] = {mapName = "Dust2", redTemple = {x = 1169, y = 1192, z = 7}, blueTemple = {x = 1107, y = 1176, z = 6}},
[3] = {mapName = "Fridge", redTemple = {x = 1277, y = 1035, z = 3}, blueTemple = {x = 1225, y = 1035, z = 3}},
}
local teams = {
blueName = "Blue Bangbabies",
redName = "Red Rageboys",
blueScore = 101,
redScore = 102,
bluePlayerScore = 1004,
redPlayerScore = 1006,
}
local blueScore = 101
local redScore = 102
local conditionBlue = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})
local conditionRed = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionRed, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})
function onLogin(cid)
setPlayerStorageValue(cid, 1002, 0)
setPlayerStorageValue(cid, 1003, 0)
local map = maps[getGlobalStorageValue(100)]
if map then
if getGlobalStorageValue(1000) > getGlobalStorageValue(1001) then
setPlayerStorageValue(cid, 1003, 1)
doAddCondition(cid, conditionRed)
doTeleportThing(cid, map.redTemple)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
setGlobalStorageValue(1001, getGlobalStorageValue(1001)+1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You were sent to fight for the " .. teams.redName .. "!\nYour team have scored " .. getGlobalStorageValue(redScore) .. " kills.\nCurrent map is " .. map.mapName .. ".")
else
setPlayerStorageValue(cid, 1002, 1)
doAddCondition(cid, conditionBlue)
doTeleportThing(cid, map.blueTemple)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
setGlobalStorageValue(1000, getGlobalStorageValue(1000)+1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You were sent to fight for the " .. teams.blueName .. "!\nYour team have scored " .. getGlobalStorageValue(blueScore) .. " kills.\nCurrent map is " .. map.mapName .. ".")
end
end
if getPlayerStorageValue(cid, 10000) == 1 then
doPlayerAddExperience(cid, -getPlayerExperience(cid) + getExperienceForLevel(130))
elseif getPlayerStorageValue(cid, 10000) ~= 1 then
doPlayerAddExperience(cid, -getPlayerExperience(cid) + getExperienceForLevel(100))
end
if isSorcerer(cid) or isDruid(cid) then
if getPlayerStorageValue(cid, 10000) == 1 then
setCreatureMaxHealth(cid, 795)
setCreatureMaxMana(cid, 3695)
for i = 1, -getPlayerMagLevel(cid)+60 do doPlayerAddMagLevel(cid, 1) end
else
setCreatureMaxHealth(cid, 645)
setCreatureMaxMana(cid, 2795)
for i = 1, -getPlayerMagLevel(cid)+50 do doPlayerAddMagLevel(cid, 1) end
end
elseif isPaladin(cid) then
if getPlayerStorageValue(cid, 10000) == 1 then
setCreatureMaxHealth(cid, 1405)
setCreatureMaxMana(cid, 1865)
for i = 1, -getPlayerMagLevel(cid)+16 do doPlayerAddMagLevel(cid, 1) end
for i = 1, -getPlayerSkillLevel(cid, SKILL_DIST)+80 do addEvent(delayDist, 0.2 * 1000, cid) end
else
setCreatureMaxHealth(cid, 1105)
setCreaureMaxMana(cid, 1415)
for i = 1, -getPlayerMagLevel(cid)+14 do doPlayerAddMagLevel(cid, 1) end
for i = 1, -getPlayerSkillLevel(cid, SKILL_DIST)+70 do addEvent(delayDist, 0.2 * 1000, cid) end
end
elseif isKnight(cid) then
if getPlayerStorageValue(cid, 10000) == 1 then
setCreatureMaxHealth(cid, 2015)
setCreatureMaxMana(cid, 645)
for i = 1, -getPlayerMagLevel(cid)+9 do doPlayerAddMagLevel(cid, 1) end
for i = 1, -getPlayerMeleeSkill(cid)+75 do addEvent(delaySkill, 0.2 * 1000, cid) end
for i = 1, -getPlayerSkillLevel(cid, SKILL_SHIELD)+75 do addEvent(delayShield, 0.2 * 1000, cid) end
else
setCreatureMaxHealth(cid, 1565)
setCreatureMaxMana(cid, 495)
for i = 1, -getPlayerMagLevel(cid)+8 do doPlayerAddMagLevel(cid, 1) end
for i = 1, -getPlayerMeleeSkill(cid)+65 do addEvent(delaySkill, 0.2 * 1000, cid) end
for i = 1, -getPlayerSkillLevel(cid, SKILL_SHIELD)+65 do addEvent(delayShield, 0.2 * 1000, cid) end
end
doCreatureAddHealth(cid, -getCreatureHealth(cid)+getCreatureMaxHealth(cid))
doCreatureAddMana(cid, -getCreatureMana(cid)+getCreatureMaxMana(cid))
end
return true
end
function delaySkill(cid)
doPlayerAddMeleeSkill(cid, 1)
end
function delayShield(cid)
doPlayerAddSkill(cid, SKILL_SHIELD, 1)
end
function delayDist(cid)
doPlayerAddSkill(cid, SKILL_DIST, 1)
end