• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need Help with kill reward

calum69

New Member
Joined
Aug 12, 2007
Messages
346
Reaction score
3
Location
Great Britain
im currently using this script that works with "lasthit"


LUA:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --ITEM ID!
        count = 1 -- How many?
}
        if(isPlayer(cid) and isPlayer(target)) then
	if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -500000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
                end
end
return TRUE
end

what i want it to do is give the reward to last say 10 people who deal damage to the target.


also currently when a player dies on my war serv they dont seem to loose blessings, can anyone help with removing them on death?
 
Ok thanks. the problem seemed to occur when i set up gesiors acc to
make the accounts when a player died they were set back to level 1 i checked the exp loss set on sample chars, that was fine, checked in vocations.xml and config.lua, anywhere else i could look?
Still have no idea why players dont loose bless can i setup a script ondeath remo e bless?
 
well curently while im building the server im using an account manager to test, i dont loose bless on death and i loose all exp on death also its very strange and annoying
 
Im at work at the moment, so il post it when im home in 10h , im using the simplewarOT V1.51pl its still tfs 0.3.6pl1 based i havent changed the login.lua if you want to take a look in the data section in downloads for simplewar
 
back from work now here is my login.lua
LUA:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
	if getPlayerName(cid) ~= "Account Manager" then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 7)
		doPlayerAddBlessing(cid, 1)
		doPlayerAddBlessing(cid, 2)
		doPlayerAddBlessing(cid, 3)
		doPlayerAddBlessing(cid, 4)
		doPlayerAddBlessing(cid, 5)
		doPlayerAddPremiumDays(cid, 2)
		doPlayerSetPromotionLevel(cid, 1)
	end
end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "FragReward")
	registerCreatureEvent(cid, "advanced")
	registerCreatureEvent(cid, "Promo")
	return true
end

i see thats the reason people dont loose blessings now, but when they die why do they loose all their exp?
 
Code:
local config =  {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	if getCreatureName(cid) ~= "Account Manager" then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
		for i = 1, 5 do
			doPlayerAddBlessing(cid, i)
		end
		doPlayerAddPremiumDays(cid, 2)
		doPlayerSetPromotionLevel(cid, 1)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "FragReward")
	registerCreatureEvent(cid, "advanced")
	registerCreatureEvent(cid, "Promo")
	return true
end
 
LUA:
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)

that would make players loose all their experience when they die?

i dont want them to loose all exp i want them to loose normal rate
10% = free acc
7 % = prem with promo
2% with all blessings :p

thanks for all the help cykotitan
 
LUA:
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)

that would make players loose all their experience when they die?

i dont want them to loose all exp i want them to loose normal rate
10% = free acc
7 % = prem with promo
2% with all blessings :p

thanks for all the help cykotitan
100 is the normal loss (which is 10%). Buying blessings or promotion does not decrease this, it's handled internally.
 
With doplayeraddbless(cid,i) will that add all blessings on login? because i need it so players dont recieve bless onlogin so i can just remove that function yes?

p.s thanks again for all ur help
 
Back
Top