Ir para conteúdo

Kit De Script's Para Servidores Enforced


Saymon14

Posts Recomendados

kit.png

Olaaá galera, venho trazer um kit de script's para quem quer fazer seu servidor Enforced/War, abaixo todos os script's em spoiler.

 

•First Items

 

 

Crie um arquivo com o nome: firstitems

function onLogin(cid)
   if getPlayerStorageValue(cid, 34051) == -1 then
       if getPlayerVocation(cid) == 1 then
           doPlayerAddItem(cid, 2365, 1)
           doPlayerAddItem(cid, 2323, 1)
           doPlayerAddItem(cid, 8871, 1)
           doPlayerAddItem(cid, 7730, 1)
           doPlayerAddItem(cid, 2195, 1)
           doPlayerAddItem(cid, 8902, 1)
           doPlayerAddItem(cid, 2187, 1)
           doPlayerAddItem(cid, 2268, 100)
           doPlayerAddItem(cid, 2273, 100)
           doPlayerAddItem(cid, 7590, 100)
           doPlayerAddItem(cid, 2293, 100)
           doPlayerAddItem(cid, 2120, 1)
           doPlayerAddItem(cid, 2160, 1)
           doPlayerAddItem(cid, 2789, 5)
           doPlayerAddItem(cid, 7910, 5)
       elseif getPlayerVocation(cid) == 2 then
           doPlayerAddItem(cid, 2365, 1)
           doPlayerAddItem(cid, 2323, 1)
           doPlayerAddItem(cid, 8871, 1)
           doPlayerAddItem(cid, 7730, 1)
           doPlayerAddItem(cid, 2195, 1)
           doPlayerAddItem(cid, 8902, 1)
           doPlayerAddItem(cid, 2183, 1)
           doPlayerAddItem(cid, 2268, 100)
           doPlayerAddItem(cid, 2273, 100)
           doPlayerAddItem(cid, 7590, 100)
           doPlayerAddItem(cid, 2293, 100)
           doPlayerAddItem(cid, 2278, 100)
           doPlayerAddItem(cid, 2120, 1)
           doPlayerAddItem(cid, 2160, 1)
           doPlayerAddItem(cid, 2789, 5)
           doPlayerAddItem(cid, 7910, 5)
       elseif getPlayerVocation(cid) == 3 then
           doPlayerAddItem(cid, 2365, 1)
           doPlayerAddItem(cid, 2493, 1)
           doPlayerAddItem(cid, 8891, 1)
           doPlayerAddItem(cid, 7730, 1)
           doPlayerAddItem(cid, 2195, 1)
           doPlayerAddItem(cid, 2514, 1)
           doPlayerAddItem(cid, 7368, 100)
           doPlayerAddItem(cid, 2268, 100)
           doPlayerAddItem(cid, 8472, 100)
           doPlayerAddItem(cid, 2293, 100)
           doPlayerAddItem(cid, 2120, 1)
           doPlayerAddItem(cid, 2160, 1)
           doPlayerAddItem(cid, 2789, 5)
           doPlayerAddItem(cid, 2175, 1)
           doPlayerAddItem(cid, 7910, 5)
       elseif getPlayerVocation(cid) == 4 then
           doPlayerAddItem(cid, 2365, 1)
           doPlayerAddItem(cid, 2493, 1)
           doPlayerAddItem(cid, 2472, 1)
           doPlayerAddItem(cid, 2470, 1)
           doPlayerAddItem(cid, 2195, 1)
           doPlayerAddItem(cid, 2514, 1)
           doPlayerAddItem(cid, 2400, 1)
           doPlayerAddItem(cid, 2431, 1)
           doPlayerAddItem(cid, 7620, 100)
           doPlayerAddItem(cid, 8473, 100)
           doPlayerAddItem(cid, 2293, 100)
           doPlayerAddItem(cid, 2120, 1)
           doPlayerAddItem(cid, 2160, 1)
           doPlayerAddItem(cid, 2789, 5)
           doPlayerAddItem(cid, 2175, 1)
           doPlayerAddItem(cid, 7910, 5)
end
           setPlayerStorageValue(cid, 34051, 1)
   end
    return TRUE
end 

 

Tag:

	<event type="login" name="firstitems" event="script" value="firstitems.lua"/>

 

 

•First Skill's

 

 

Crie um arquivo com o nome: startskills

function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local reqTries = getPlayerRequiredSkillTries
local skillStor = 56364
local gotSkills = getPlayerStorageValue(cid, 56364)


if playerVoc == 1 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,40)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 2 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,40)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 3 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 58))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 40))
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,5)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 4 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 55))
doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 55))
doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 55))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 55))
doPlayerAddMagLevel(cid, 5)
setPlayerStorageValue(cid, skillStor, 1)

end
return TRUE
end

 

Tag:

	<event type="login" name="StartSkills" event="script" value="startskills.lua"/>

 

 

•First Addons (entrar full addon)

 

 

Crie um arquivo com o nome: addon

function onLogin(cid)
if getPlayerStorageValue(cid, 30003) == -1 then
doPlayerAddAddons(cid, 1)
doPlayerAddAddons(cid, 2)
setPlayerStorageValue(cid, 30003, 1)
end
return TRUE
end 

 

Tag:

	<event type="login" name="addon" script="addon.lua"/>

 

 

•Sistema Reward||Cash + DeathBroadcast

 

 

Crie um arquivo com o nome: deathBroadcast

local config = {
affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?

killStorageValue = 3943,
deathStorageValue = 3944,

-- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
rewardItem = {
	use = true,
	itemid = 2152,
	minLevel = false, -- false if you don't want any level req
	minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
},

killMessage = {
	use = true,
	text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
	messageClass = MESSAGE_STATUS_CONSOLE_BLUE
},

broadcastMessage = {
	use = true,
	minLevel = false, -- false if you don't want any level req
	minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
	text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
	messageClass = MESSAGE_STATUS_WARNING
},

killerAnimation = {
	use = true,
	text = "+ Point", -- Only 9 letters! No "commands" here.
	color = 144
},

targetAnimation = {
	use = false,
	text = "Owned!", -- Only 9 letters! No "commands" here.
	color = 180
}
}

function onDeath(cid, corpse, deathList)
for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
	local killer = deathList[i]
	if(isPlayer(killer) == TRUE) then
		local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
		local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1

		local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
		local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1

		setPlayerStorageValue(killer, config.killStorageValue, targetKills)
		setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)

		local killerLevel = getPlayerLevel(killer)
		local targetLevel = getPlayerLevel(cid)
		local levelDiff = targetLevel - killerLevel

		local values = {
			["KILLERKILLS"]         = killerKills,
			["KILLERDEATHS"]        = killerDeaths,
			["KILLERNAME"]          = getCreatureName(killer),
			["KILLERLEVEL"]         = killerLevel,

			["TARGETKILLS"]         = targetKills,
			["TARGETDEATHS"]        = targetDeaths,
			["TARGETNAME"]          = getCreatureName(cid),
			["TARGETLEVEL"]         = targetLevel
		}

		function formateString(str)
			return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
		end

		if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
			local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 30)
		end
		if(config.killMessage.use) then
			doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
		end
		if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
			broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
		end
		if(config.killerAnimation.use) then
			doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
		end
		if(config.targetAnimation.use) then
			doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
		end
	end
end

return true
end

 

Tag:

        <event type="death" name="DeathBroadcast" event="script" value="deathBroadcast.lua"/>

 

 

•Sistema Reward||Heart of the Enemy

 

 

Crie um arquivo com o nome: reward

function onDeath(cid, corpse, deathList)
if isPlayer(cid) and isPlayer(deathList[1]) then
local v = { 
rewardid = 5943,
killer_name = getCreatureName(deathList[1]),
killer_level = getPlayerLevel(deathList[1]), 
target_name = getCreatureName(cid), 
target_level = getPlayerLevel(cid),
pos = getCreaturePosition(cid),
text = 'TO HELL!'
} 
local reward = doPlayerAddItem(deathList[1], v.rewardid, 1)
doItemSetAttribute(reward, "description", "Killed at level " .. v.target_level .. " by " .. v.killer_name .. " I was at level " .. v.killer_level .. " when. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Not-Justified]" or "[Justified]"))
doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You killed ".. v.target_name .." " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "wrong." or "just."))
doSendAnimatedText(v.pos, v.text, TEXTCOLOR_RED)
end
return true
end

 

Tag:

        <event type="death" name="Reward" event="script" value="reward.lua"/>

 

 

•Sistema de Look com Frags *New*

 

 

Crie um arquivo com o nome: fraglook.lua

--Script By Theax ""
function getPlayerFrags(cid)
   local time = os.time()
   local times = {today = (time - 86400), week = (time - (7 * 86400))}

   local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
   if(result:getID() ~= -1) then
       repeat
           local content = {date = result:getDataInt("date")}
           if(content.date > times.today) then
               table.insert(contents.day, content)
           elseif(content.date > times.week) then
               table.insert(contents.week, content)
           else
               table.insert(contents.month, content)
           end
       until not result:next()
       result:free()
   end

   local size = {
       day = table.maxn(contents.day),
       week = table.maxn(contents.week),
       month = table.maxn(contents.month)
   } 
   return size.day + size.week + size.month
end 

function onLogin(cid)
   registerCreatureEvent(cid, "fraglook")
   return true
end

function onLook(cid, thing, position, lookDistance)
   if isPlayer(thing.uid) and thing.uid ~= cid then
       doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']')
       return true
   elseif thing.uid == cid then
       doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']')
       local string = 'You see yourself.'
       if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
           string = string..' You are '.. getPlayerGroupName(cid) ..'.'
       elseif getPlayerVocation(cid) ~= 0 then
           string = string..' You are '.. getPlayerVocationName(cid) ..'.'
       else
           string = string..' You have no vocation.'
       end
       string = string..getPlayerSpecialDescription(cid)..''

       if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
           string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
       end

       if getPlayerGuildId(cid) > 0 then 
           string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
           string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
       end 

       if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
           string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
           string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
       end

       if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
           string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
       end
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
       return false
   end
   return true
end

 

Tag:

<event type="login" name="fraglook_register" event="script" value="fraglook.lua"/>
   <event type="look" name="fraglook" event="script" value="fraglook.lua"/>  

 

 

>Registrando no login.lua

 

 

vá no login.lua e adicione la em baixo isso:

    registerCreatureEvent(cid, "deathBroadcast")
    registerCreatureEvent(cid, "addon")
    registerCreatureEvent(cid, "Reward")
    registerCreatureEvent(cid, "firstitems")

 

 

#Creditos:

>Saymon

>Vodkart

>Toridox

>Black Ice

>Theax

Editado por Saymon14
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • 2 years later...
×
×
  • Criar Novo...