Darkness2144
New Member
- Joined
- Dec 27, 2010
- Messages
- 6
- Reaction score
- 0
Hello, OtLand 
I'm having trouble finding a solution for [9.60/9.61] The Forgotten Server v0.2.14 (Mystic Spirit).
Link: http://otland.net/f18/9-60-9-61-forgotten-server-v0-2-14-mystic-spirit-166619/
What I need is giving Premium members additional experience (50%)
Here was my shot:
The problem: I couldn't find a proper function to replace getPlayerRates(cid)
Since the version I use (above) does not have it. I'm thinking if I could add a function somehow but need some guidance, Will REP!
LUA FUNCTIONS:
EDIT: to clarify it's a creaturescript and I also added console output:
I'm having trouble finding a solution for [9.60/9.61] The Forgotten Server v0.2.14 (Mystic Spirit).
Link: http://otland.net/f18/9-60-9-61-forgotten-server-v0-2-14-mystic-spirit-166619/
What I need is giving Premium members additional experience (50%)
Here was my shot:
XML:
<event type="login" name="PremiumXP" script="premium.lua" />
LUA:
function onLogin(cid)
local config = { rate = 1.5 } -- 50% extra experience
local rates = getPlayerRates(cid)
if getPlayerPremiumDays(cid) >= 1 then
doPlayerSetRate(cid, rates[SKILL__LEVEL]*config.rate)
end
return TRUE
end
The problem: I couldn't find a proper function to replace getPlayerRates(cid)
Since the version I use (above) does not have it. I'm thinking if I could add a function somehow but need some guidance, Will REP!
LUA FUNCTIONS:
Code:
//*GET
getPlayerMasterPos(cid)
getPlayerLossPercent(cid)
getItemIdByName(name)
getTownName(townId)
getTownTemplePosition(townId)
getPlayersByAccountNumber(accountNumber)
getAccountNumberByPlayerName(name)
getIPByPlayerName(name)
getPlayersByIPAddress(ip[, mask = 0xFFFFFFFF])
getFluidSourceType(type)
getItemDescriptions(itemid)
getItemWeightByUID(uid)
getContainerCapById(itemid)
getDepotId(uid)
getHouseTilesSize(houseid)
getHighscoreString(skillId)
getPartyMembers(leaderId)
getCreatureMaster(cid) - Returns: returns the creature's master or itself if the creature isn't a summon
getMonsterTargetList(cid)
getMonsterFriendList(cid)
getPlayerByName(name)
getPlayerGUIDByName(name)
getPlayerLearnedInstantSpell(cid, name)
getPlayerInstantSpellCount(cid)
getPlayerInstantSpellInfo(cid, index)
getPlayerMount(cid, mountid)
getWorldType()
getWorldTime()
getWorldLight()
getWorldCreatures(type) - Types: 0 players, 1 monsters, 2 npcs, 3 all Returns: Amount
getWorldUpTime()
getGuildId(guild_name)
getPlayerSex(cid)
getContainerSize(uid)
getContainerCap(uid)
getContainerItem(uid, slot)
getInstantSpellInfoByName(cid, name)
getInstantSpellWords(name)
getGlobalStorageValue(valueid)
getHouseOwner(houseid)
getHouseName(houseid)
getHouseEntry(houseid)
getHouseRent(houseid)
getHouseTown(houseid)
getHouseAccessList(houseid, listid)
getHouseByPlayerGUID(playerGUID)
getCreatureOutfit(cid)
getCreaturePosition(cid)
getCreatureName(cid)
getCreatureSpeed(cid)
getCreatureBaseSpeed(cid)
getCreatureTarget(cid)
getTilePzInfo(pos) - Returns: 1 is pz. 0 no pz.
getTileHouseInfo(pos) - Returns: 0 no house. != 0 house id
getItemRWInfo(uid)
getThingfromPos(pos)
getThing(uid)
getCreatureCondition(cid, condition)
getItemName(itemid)
getItemWeight(itemid, count)
getPlayerPremiumDays(cid)
getPlayerSkullType(cid)
getPromotedVocation(vocation)
getPlayerBlessing(cid, blessing)
getTileThingByTopOrder(pos, topOrder)
getTileItemByType(pos, type)
getTopCreature(pos)
getTileThingByPos(pos)
getTileItemById(pos, itemId, <optional> subType)
getOnlinePlayers()
getTileInfo(pos)
getThingPos(uid)
getSpectators(centerPos, rangex, rangey, multifloor)
getPlayerStorageValue(uid, valueid)
getPlayerItemById(cid, deepSearch, itemId, <optional> subType)
getPlayerIp(cid)
getPlayerGuildLevel(cid)
getCreatureSummons(cid) - Returns: returns a table with all the summons of the creature
//*DO
doPlayerAddBlessing(cid, blessing)
doPlayerPopupFYI(cid, message)
doCombat(cid, combat, param)
doPlayerRemovePremiumDays(cid, days)
doPlayerAddPremiumDays(cid, days)
doPlayerSetSex(cid, newSex)
doSetCreatureOutfit(cid, outfit, time)
doSetItemOutfit(cid, item, time)
doSetMonsterOutfit(cid, name, time)
doChangeSpeed(cid, delta)
doAddContainerItem(uid, itemid, <optional> count/subtype)
doChallengeCreature(cid, target)
doTargetCombatDispel(cid, target, type, effect)
doAreaCombatDispel(cid, pos, area, type, effect)
doTargetCombatCondition(cid, target, condition, effect)
doAreaCombatCondition(cid, pos, area, condition, effect)
doTargetCombatMana(cid, target, min, max, effect)
doAreaCombatMana(cid, pos, area, min, max, effect)
doTargetCombatHealth(cid, target, type, min, max, effect)
doAreaCombatHealth(cid, type, pos, area, min, max, effect)
doSetCreatureDropLoot(cid, doDrop)
doSetCreatureLight(cid, lightLevel, lightColor, time)
doPlayerRemoveMount(cid, mountid)
doPlayerAddMount(cid, mountid)
doPlayerRemOutfit(cid,looktype,addons)
doPlayerAddOutfit(cid,looktype,addons)
doPlayerSetGuildNick(cid, nick)
doPlayerSetGuildRank(cid, rank)
doPlayerSetGuildId(cid, id)
doPlayerAddExp(cid,exp)
doPlayerRemoveItem(cid,itemid,count)
doPlayerSetVocation(cid,voc)
doPlayerSetTown(cid, townid)
doMoveCreature(cid, direction)
doRemoveCreature(cid)
doConvinceCreature(cid, target)
doSummonCreature(name, pos)
doCreateTeleport(itemid, topos, createpos)
doTileAddItemEx(pos, uid)
doCreateItemEx(itemid, <optional> count/subtype) - Returns: Returns uid of the created item, only works on tiles.
doCreateItem(itemid, type/count, pos) - Returns: Returns uid of the created item, only works on tiles.
doDecayItem(uid)
doShowTextDialog(cid, itemid, text)
doPlayerRemoveMoney(cid, money)
doPlayerSendTextMessage(cid, MessageClasses, message)
doPlayerAddItemEx(cid, uid, <optional: default: 0> useCidPosOnFail)
doPlayerAddItem(uid, itemid, <optional> count/subtype) - Returns: Returns uid of the created item
doPlayerAddSoul(cid, soul)
doPlayerAddManaSpent(cid, mana)
doPlayerAddMana(cid, mana)
doCreatureAddHealth(cid, health)
doPlayerAddSkillTry(cid, skillid, n)
doSendAnimatedText(pos, text, color)
doSetItemSpecialDescription(uid, desc)
doSetItemText(uid, text)
doSetItemActionId(uid, actionid)
doChangeTypeItem(uid, newtype)
doSendDistanceShoot(frompos, topos, type)
doSendMagicEffect(pos, type)
doCreatureSay(cid, text, type)
doTransformItem(uid, toitemid, <optional> count/subtype)
doTeleportThing(cid, newpos, <optional> pushmove)
doPlayerSendDefaultCancel(cid, ReturnValue)
doRemoveCondition(cid, type)
doAddCondition(cid, condition)
doMonsterChangeTarget(cid)
doSetMonsterTarget(cid, target)
doCreatureChangeOutfit(cid, outfit)
doCreateNpc(name, pos)
doRelocate(pos, posTo) - Returns: Moves all moveable objects from pos to posTo
doAddContainerItemEx(uid, virtuid)
doSendTutorial(cid, tutorialid)
doCreatureSetLookDir(cid, direction)
doPlayerFeed(cid, food)
doRemoveItem(uid, <optional> n)
doAddMapMark(cid, pos, type, <optional> description)
doPlayerAddMoney(cid, money)
doPlayerChangeName(cid, newName)
doSetCreatureDirection(cid, direction)
//*SET
setHouseAccessList(houseid, listid, listtext)
setHouseOwner(houseid, ownerGUID)
setCombatArea(combat, area)
setCombatCondition(combat, condition)
setCombatParam(combat, key, value)
setConditionParam(condition, key, value)
setCombatCallBack(combat, key, function_name)
setCombatFormula(combat, type, mina, minb, maxa, maxb)
setConditionFormula(combat, mina, minb, maxa, maxb)
setGlobalStorageValue(valueid, newvalue)
setPlayerGroupId(cid, newGroupId)
setPlayerStorageValue(uid, valueid, newvalue)
//*IS
isPlayer(cid)
isCreature(cid)
isContainer(uid)
isMoveable(uid)
isSightClear(fromPos, toPos, floorCheck)
isValidUID(uid)
isPlayerGhost(cid)
isPlayerPzLocked(cid)
isDepot(uid)
isCorpse(uid)
isMovable(uid)
isItemMovable(itemid)
isItemMoveable(itemid)
isItemStackable(itemid)
isItemRune(itemid)
isItemDoor(itemid)
isItemContainer(itemid)
isItemFluidContainer(itemid)
isInArray(array, value)
//*MISC
broadcastMessage(message, type)
createCombatArea( {area}, <optional> {extArea} )
canPlayerWearOutfit(cid, looktype, addons)
hasProperty(uid, prop)
refreshMap()
cleanMap()
createConditionObject(type)
addDamageCondition(condition, rounds, time, value)
addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet)
createCombatObject()
numberToVariant(number)
stringToVariant(string)
positionToVariant(pos)
targetPositionToVariant(pos)
variantToNumber(var)
variantToString(var)
variantToPosition(var)
debugPrint(text)
addEvent(callback, delay, parameter)
stopEvent(eventid)
mayNotLogout(cid, value)
mayNotMove(cid, value)
saveData()
saveServer(), does the same thing as saveData()
escapeString(str)
registerCreatureEvent(uid, eventName)
queryTileAddThing(uid, pos, <optional> flags)
playerLearnInstantSpell(cid, name)
canPlayerLearnInstantSpell(cid, name)
]
EDIT: to clarify it's a creaturescript and I also added console output:
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/premium.lua:onLogin
data/creaturescripts/scripts/premium.lua:4: attempt to call global 'getPlayerRates' <a nil value>
stack traceback: [C]: in function 'getPlayerRates'
data/creaturescripts/scripts/premium.lua:4: in function <data/creaturescripts/scripts/premium.lua:1>
Last edited: