I want to create a Starter Box. (Box ID = 3000)
I used this boxes and box give me a Starter for Pidgey level 5.
Some Items for this inventory pages places (PLAYER_SLOT_EVOLVE) for Fishing Rods (Item ID = 2377.)
And teleporting to Place {x = 3295, y = 564, z = 7}
How can i do ?
I try but not working.
local BOXES = {
[3000] = {level = 5, pokemons = {"Pidgey"}}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local randomBoxPokemon = BOXES[item.itemid].pokemons[math.random(1, #BOXES[item.itemid].pokemons)]
doSendMagicEffect(getCreaturePosition(cid), EFFECT_FIREWORK_YELLOW)
doPlayerAddItem(cid, PLAYER_SLOT_EVOLVE, 2377, 1, true) -- Fishing Rods
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format(__L(cid, "Congratulations! Your %s result in %s."), getItemNameById(item.itemid), getMonsterInfo(randomBoxPokemon).description))
doCreatePokemonBall(cid, "poke", randomBoxPokemon, BOXES[item.itemid].level, nil, nil,
math.floor(BOXES[item.itemid].level / 2), cid, true)
doTeleportThing(cid, {x = 3295, y = 564, z = 7}, false)
return true
end
Please help me.