Problem: When a new character is created, it does not get any items at all. I have tried different scripts and what not to get the first items to work and I just can't get it.
I am working a real map server (9.80-9.86). I am using http://otland.net/f18/9-80-9-86-forgotten-server-v0-2-15-mystic-spirit-188228/
Here's my creaturescripts.xml
My firstitems.lua
And just in case, my login.lua
And finally, my onLogin.lua
I am working a real map server (9.80-9.86). I am using http://otland.net/f18/9-80-9-86-forgotten-server-v0-2-15-mystic-spirit-188228/
Here's my creaturescripts.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="onLogin" script="onLogin.lua"/>
<!-- Bigfoot Burden Quest -->
<event type="kill" name="bigfootBurdenQuestVesperoth" script="bigfoot burden quest/bigfootBurdenQuestVesperoth.lua"/>
<event type="kill" name="bigfootBurdenQuestWarzone" script="bigfoot burden quest/bigfootBurdenQuestWarzone.lua"/>
<event type="kill" name="bigfootBurdenQuestWeeper" script="bigfoot burden quest/bigfootBurdenQuestWeeper.lua"/>
<event type="kill" name="bigfootBurdenQuestWiggler" script="bigfoot burden quest/bigfootBurdenQuestWiggler.lua"/>
<!-- Boss Summoning -->
<event type="kill" name="bossSummoning" script="boss summoning/bossSummoning.lua"/>
<!-- In Service Of Yalahar Quest -->
<event type="kill" name="inServiceOfYalaharQuestsDiseased" script="in service of yalahar quest/inServiceOfYalaharQuestsDiseased.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsMorik" script="in service of yalahar quest/inServiceOfYalaharQuestsMorik.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsQuara" script="in service of yalahar quest/inServiceOfYalaharQuestsQuara.lua"/>
<!-- Inquisition Quest -->
<event type="kill" name="inquisitionQuestBosses" script="inquisition quest/inquisitionQuestBosses.lua"/>
<event type="kill" name="inquisitionQuestUngreez" script="inquisition quest/inquisitionQuestUngreez.lua"/>
<!-- Killing In The Name Of Quest -->
<event type="kill" name="killingInTheNameOfQuestAchievements" script="killing in the name of quest/killingInTheNameOfQuestAchievements.lua"/>
<!-- The Masters Voice Quest -->
<event type="kill" name="masterVoiceQuest" script="their master's voice quest/masterVoiceQuest.lua"/>
<!-- Level Money -->
<event type="advance" name="levelMoney" script="levelMoney/levelMoney.lua"/>
<event type="login" name="firstitems" event="script" value="firstitems.lua"/>
</creaturescripts>
My firstitems.lua
Code:
local firstItems = {2050, 2382}
function onLogin(cid)
if getPlayerLastLoginSaved(cid) == 0 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems[i], 1)
end
doPlayerAddItem(cid, getPlayerSex(cid) == 0 and 2651 or 2650, 1)
local bag = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(bag, 2674, 1)
if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
if isSorcerer(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 5)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)
setPlayerStorageValue(cid, 50000, 1)
elseif isDruid(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 5)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)
setPlayerStorageValue(cid, 50000, 1)
elseif isPaladin(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 5)
doPlayerAddItem(cid, 2389, 3)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2463, 1)
setPlayerStorageValue(cid, 50000, 1)
elseif isKnight(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 5)
doAddContainerItem(bag, 8601, 1)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)
setPlayerStorageValue(cid, 50000, 1)
end
end
return TRUE
end
And just in case, my login.lua
Code:
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
And finally, my onLogin.lua
Code:
function onLogin(cid)
registerCreatureEvent(cid, "bigfootBurdenQuestVesperoth")
registerCreatureEvent(cid, "bigfootBurdenQuestWarzone")
registerCreatureEvent(cid, "bigfootBurdenQuestWeeper")
registerCreatureEvent(cid, "bigfootBurdenQuestWiggler")
registerCreatureEvent(cid, "bossSummoning")
registerCreatureEvent(cid, "inServiceOfYalaharQuestsDiseased")
registerCreatureEvent(cid, "inServiceOfYalaharQuestsMorik")
registerCreatureEvent(cid, "inServiceOfYalaharQuestsQuara")
registerCreatureEvent(cid, "inquisitionQuestBosses")
registerCreatureEvent(cid, "inquisitionQuestUngreez")
registerCreatureEvent(cid, "killingInTheNameOfQuestAchievements")
registerCreatureEvent(cid, "masterVoiceQuest")
registerCreatureEvent(cid, "levelMoney")
registerCreatureEvent(cid, "Firstitems")
return true
end