• 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!

War OT

thecycles

Member
Joined
Apr 7, 2010
Messages
620
Reaction score
5
Hello!
I have a War OT, but for ex. If I kill someone I want to receive 300gp.
Someone know the script?

And I want a EXP Egg who gives 1k EXP. And a NPC could sell it.

Those problems are emergency!
 
Lua:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
        loot = 2148 
	    item = doPlayerAddItem(cid, loot, 300)
	elseif getPlayerName(cid) == getPlayerName(target) then
	    doPlayerAddItem(cid, loot, 1)
        end
    return TRUE
end
Lua:
local exp = 1000

function onUse(cid, item, frompos, item2, topos)
    if getPlayerGroupId(cid) == 1 then
    doPlayerAddExp(cid, exp)
    doSendMagicEffect(getPlayerPosition(cid), 20)
  end
return TRUE
end
 
First script: Creaturescripts
login.lua:
Lua:
	registerCreatureEvent(cid, "KillReward")
XML tag:

XML:
	<event type="kill" name="KillReward" event="script" value="KillReward.lua"/>

Second script: Actions
XML tag:
XML:
	<action itemid="xxxx" event="script" value="expegg.lua"/>
 
First script: Creaturescripts
login.lua:
Lua:
	registerCreatureEvent(cid, "KillReward")
XML tag:

XML:
	<event type="kill" name="KillReward" event="script" value="KillReward.lua"/>

Second script: Actions
XML tag:
XML:
	<action itemid="xxxx" event="script" value="expegg.lua"/>

whats up with the third script?
I got this error:

[21/05/2011 20:18:46] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/KillReward.lua: No such file or directory
[21/05/2011 20:18:46] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/KillReward.lua)
[21/05/2011 20:18:46] cannot open data/creaturescripts/scripts/KillReward.lua: No such file or directory
[21/05/2011 20:18:46] >> Loading chat channels
 
whats up with the third script?
I got this error:

[21/05/2011 20:18:46] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/KillReward.lua: No such file or directory
[21/05/2011 20:18:46] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/KillReward.lua)
[21/05/2011 20:18:46] cannot open data/creaturescripts/scripts/KillReward.lua: No such file or directory
[21/05/2011 20:18:46] >> Loading chat channels

Instead of data/creaturescripts/scripts/Killreward.lua use data/creaturescripts/scripts/Yourfilename.lua
Same with the login.lua, use this:

Lua:
	registerCreatureEvent(cid, "Yourfilename")
 
Because if you use a name that you don't have your console won't find it.

Tell me what's the name your using in your script.
 
OMG, Now I got this error:
[22/05/2011 11:03:11] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/Yourfilename: No such file or directory
[22/05/2011 11:03:11] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/Yourfilename)
[22/05/2011 11:03:11] cannot open data/creaturescripts/scripts/Yourfilename: No such file or directory
 
I'll explain it to you from 0:
First go to data/creaturescripts/scripts & create a new Notepad file there, paste this inside & save it as Killreward.lua:
Lua:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
        loot = 2148 
	    item = doPlayerAddItem(cid, loot, 300)
	elseif getPlayerName(cid) == getPlayerName(target) then
	    doPlayerAddItem(cid, loot, 1)
        end
    return TRUE
end

Now go to data/creatuscripts/scripts/login.lua & paste this inside:
Lua:
	registerCreatureEvent(cid, "Killreward")

Then go to data/creatuscripts/creaturescripts.xml & paste this:
XML:
 <event type="kill" name="KillReward" event="script" value="KillReward.lua"/>
 
I'll explain it to you from 0:
First go to data/creaturescripts/scripts & create a new Notepad file there, paste this inside & save it as Killreward.lua:
Lua:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
        loot = 2148 
	    item = doPlayerAddItem(cid, loot, 300)
	elseif getPlayerName(cid) == getPlayerName(target) then
	    doPlayerAddItem(cid, loot, 1)
        end
    return TRUE
end

Now go to data/creatuscripts/scripts/login.lua & paste this inside:
Lua:
	registerCreatureEvent(cid, "Killreward")

Then go to data/creatuscripts/creaturescripts.xml & paste this:
XML:
 <event type="kill" name="KillReward" event="script" value="KillReward.lua"/>

I've done exactly what you have said, but then this error showed up:

[22/05/2011 11:39:05] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/KillReward: No such file or directory
[22/05/2011 11:39:05] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/KillReward)
[22/05/2011 11:39:05] cannot open data/creaturescripts/scripts/KillReward: No such file or directory
 
data/creatuscripts/scripts/login.lua
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
		doPlayerAddBlessing(cid, 1)
		doPlayerAddBlessing(cid, 2)
		doPlayerAddBlessing(cid, 3)
		doPlayerAddBlessing(cid, 4)
		doPlayerAddBlessing(cid, 5)
		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, "Killreward")

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

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end

data/creatuscripts/creaturescripts.xml
Code:
 <?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
	<event type="login" name="StartSkills" event="script" value="startskills.lua"/>
	<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>
	<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>
                  <event type="kill" name="KillReward" event="script" value="KillReward"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>

And between, when I create the file Killreward.lua nothing happends, its says that it is a textdocument -.-
 
data/creatuscripts/scripts/login.lua
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
		doPlayerAddBlessing(cid, 1)
		doPlayerAddBlessing(cid, 2)
		doPlayerAddBlessing(cid, 3)
		doPlayerAddBlessing(cid, 4)
		doPlayerAddBlessing(cid, 5)
		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, "Killreward")

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

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end

data/creatuscripts/creaturescripts.xml
Code:
 <?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
	<event type="login" name="StartSkills" event="script" value="startskills.lua"/>
	<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>
	<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>
                  <event type="kill" name="KillReward" event="script" value="KillReward"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>

And between, when I create the file Killreward.lua nothing happends, its says that it is a textdocument -.-

<event type="kill" name="KillReward" event="script" value="KillReward.lua"/>
 
Back
Top