JohnJohn90
New Member
[29/02/2012 14:50:14] The Forgotten Server, version 0.3.4 (Crying Damson) sry 4 the double post
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
local min = getPlayerStorageValue(cid, 85987) * 10000
local max = getPlayerStorageValue(cid, 85987) * 10000
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
doCreatureAddHealth(cid, 10000)
return doCombat(cid, combat, var)
end
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'prestige')) then
selfSay('Are you ready to prestige and start a new life?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
-------CONFIGS-------
local level = 100
local cost = 300000
------/CONFIGS-------
-----LOCALS-----
local id = getPlayerGUID(cid)
local name = getCreatureName(cid)
local vocation = getPlayerVocation(cid)
local storage = getPlayerStorageValue(cid, 85987)
if storage < 0 then
storage = 0
end
local bonus = getPlayerLevel(cid) / 10 - 1 + storage
----/LOCALS-----
if(getPlayerLevel(cid) >= level) then
if getPlayerVocation(cid) == 5 then
newhealth = (bonus * 5) + 185
newmana = (bonus * 35) + (35 * 7)
newcap = (bonus * 15) + 600 + (7 * 15)
voc = 1
elseif getPlayerVocation(cid) == 6 then
newhealth = (bonus * 5) + 185
newmana = (bonus * 35) + (35 * 7)
newcap = (bonus * 15) + 600 + (7 * 15)
voc = 2
elseif getPlayerVocation(cid) == 7 then
newhealth = (bonus * 10) + 185
newmana = (bonus * 15) + (15 * 7)
newcap = (bonus * 20) + 600 + (7 * 20)
voc = 3
elseif getPlayerVocation(cid) == 8 then
newhealth = (bonus * 15) + 185
newmana = (bonus * 5) + (5 * 7)
newcap = (bonus * 35) + 600 + (7 * 35)
voc = 4
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
if(isInArray({5, 6, 7, 8}, vocation)) then
setPlayerStorageValue(cid, 85987, bonus)--storage == -1 and 1 or storage + 1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = '"..newhealth.."', `manamax` = '"..newmana.."', `cap` = '"..newcap.."', `vocation` = '"..voc.."' WHERE `id` ='"..id.."';")
db.executeQuery("UPDATE `players` SET `name` = '"..name.."' WHERE `id` ='"..id.."';")
else
selfSay('Please talk with Forgotten King and promote first.', cid)
talkState[talkUser] = 0
end
else
selfSay('You don\'t have enough money. You need to pay 300k to be rebirthed.', cid)
talkState[talkUser] = 0
end
else
selfSay('Only characters of level 100 or higher can be rebirthed.', cid)
talkState[talkUser] = 0
end
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
selfSay('Okey. Come back when you feel ready.', cid)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Yo when i start using this like everything works fine but when i get to like prestige "4~5" and when i click "skills" Bam ERROR!
i dno if i have done anything wrong but everything does work great so i dno if its just my rev so "im using 0.4_DEV" "trunk.3884"
plzzz help[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/RebirthDescription.lua:1: '=' expected near 'onLook'
[05/11/2012 14:07:44] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/RebirthDescription.lua)
[05/11/2012 14:07:44] data/creaturescripts/scripts/RebirthDescription.lua:1: '=' expected near 'onLook'
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and thing.uid ~= cid and getCreatureStorage(thing.uid, 99958) ~= -1) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and "\nShe" or "\nHe") .. " is a Warrior of Asland.")
elseif(thing.uid == cid and getCreatureStorage(cid, 99958) ~= -1) then
local message = "You see yourself."
if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
message = message .. " You are a " .. getPlayerGroupName(cid) .. "."
elseif(getPlayerVocation(cid) == 1) then
message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 2) then
message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 3) then
message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 4) then
message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 6) then
message = message .. " You are an " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 8) then
message = message .. " You are an " .. getPlayerVocationName(cid):lower() .. ""
elseif(getPlayerVocation(cid) == 0) then
message = message .. " You have no vocation."
end
if(getPlayerGuildId(cid) > 0) then
message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid)
message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "."
end
if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]."
message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. ", Client: " .. getClientVersion(cid) .. "."
end
if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
end
return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou are a Warrior of Asland ")
end
return true
end
[06/03/2013 19:58:19] [Error - CreatureScript Interface]
[06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:onLook
[06/03/2013 19:58:19] Description:
[06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:25: attempt to call global 'getClientVersion' (a nil value)
[06/03/2013 19:58:19] stack traceback:
[06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:25: in function <data/creaturescripts/scripts/rebirthdescription.lua:1>
Code:[06/03/2013 19:58:19] [Error - CreatureScript Interface] [06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:onLook [06/03/2013 19:58:19] Description: [06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:25: attempt to call global 'getClientVersion' (a nil value) [06/03/2013 19:58:19] stack traceback: [06/03/2013 19:58:19] data/creaturescripts/scripts/rebirthdescription.lua:25: in function <data/creaturescripts/scripts/rebirthdescription.lua:1>
how I fix it?
EDIT: I'm using cryingdamson 0.3.6 (8.60) V5 if it helps
I did all then I summoned the NPC, but then he says 'Are you ready to start a new life?' then I typed 'yes' and he did nothing, can you help??