Ir para conteúdo

Warmode Enforced Kit


Nostradamus

Posts Recomendados

Warmode Enforced KIT

 

Depois de jogar alguns servidores enforced, tive a idéia de criar um, mas, devido a falta de tempo, não pude completar tal objetivo. Mas apesar disso, desenvolvi alguns códigos para aqueles que gostam de um servidor Enforced.

 

OBS: Os códigos a seguir utilizam-se de funções apenas presentes no Forgotten Server.

 

global.lua

include('functions.lua')

 

functions.lua

 

ITEM_DE = 6500
STORAGE_KILLS = 666
ACTIONID_CORPSE = 667

-- function 'isWearing' by Colex
function isWearing(cid, outfit)
 _outfit = getCreatureOutfit(cid)
 table.foreach(otufit,function (a,b) if b ~= _outfit[a] then doSetCreatureOutfit(cid, outfit, 0) end)
end

function doAddDE(cid, count)
doPlayerAddItem(cid, ITEM_DE, count)
return TRUE
end

function doRemoveDE(cid, count)
doPlayerRemoveItem(cid, ITEM_DE, count)
return TRUE
end

function doCountDE(cid)
local count = getPlayerItemCount(cid, ITEM_DE)
if (count > 1) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have ' .. count .. ' Demonic Essences.')
elseif (count == 1) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have ' .. count .. ' Demonic Essence.')
else
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You do not have any DE.')
end
return TRUE
end

function getPlayerKills(cid)
local kills = getPlayerStorageValue(cid, STORAGE_KILLS)
if (kills > 1) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have killed ' .. kills .. ' players.')
elseif (kills == 1) then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have killed ' .. kills .. ' player.')
else
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have not killed anyone.')
end
return TRUE
end

function addPlayerKills(cid)
local kills = getPlayerStorageValue(cid, STORAGE_KILLS)
if (kills < 0) then
	setPlayerStorageValue(cid, STORAGE_KILLS, 0)
else
	setPlayerStorageValue(cid, STORAGE_KILLS, kills + 1)
end
return TRUE
end

function doBroadcastPowergamer(cid)
local kills = getPlayerStorageValue(cid, STORAGE_KILLS)
local levels = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}
if (isInArray(levels, kills) == TRUE) then
	broadcastMessage(getPlayerName(cid) .. ' killed ' .. kills .. ' players!', TALKTYPE_BROADCAST)
	return TRUE
end
end

 

creaturescripts/scripts/playerdeath.lua

function onDeath(cid, corpse, killer)
if ((isPlayer(cid) == TRUE) and (isPlayer(killer) == TRUE)) then
	doSetItemActionId(corpse, ACTIONID_CORPSE)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You got killed by ' .. killer .. '.')
	doSendAnimatedText(getCreaturePosition(cid), 'Owned!', TEXTCOLOR_RED)
	doSendAnimatedText(getCreaturePosition(killer), 'Kill!', TEXTCOLOR_CRYSTAL)
end
end

 

actions/scripts/corpse.lua

 

function onUse(cid, item, frompos, item2, topos)
if (item.actionid == ACTIONID_CORPSE) then
	doCreatureAddHealth(cid, (getCreatureHealth(cid) * 0.5)
	doPlayerAddMana(cid, (getPlayerMana(cid) * 0.4)
	doSendAnimatedText(getCreaturePosition(cid), 'Power!', TEXTCOLOR_GOLD)
	doRemoveItem(item.itemid, 1)
else
	return FALSE
end
return TRUE
end

 

talkactions/scripts/info.lua

function onSay(cid, words, param)
if (words == !kills) then
	getPlayerKills(cid)
elseif (words == !talons) then
	doCountTalons(cid)
end
return TRUE
end

 

Bom proveito.

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

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