Page 1 of 1
superior collection pot for + 8 level harvest
Posted: Thu Sep 26, 2013 8:40 pm
by Supergala
guys I have a little problem, I'm doing the collection points and the materials I would need to know how to make that the character drink the collection that are "superior pot potions" that have the task to collect the materials of 8 levels above the normal level, this applies to both plants for the wood and the mining.anyone can help me? addition to this I would like to know if the id of the materials level were 75.81 upgrade.ty
Re: superior collection pot for + 8 level harvest
Posted: Thu Sep 26, 2013 8:54 pm
by Supergala
if i don't remember wrong this is a section for change potion id must be change but i don't find any of 3 pot id:
Code: Select all
<onHarvest>
local function hasBuff(_id)
player:updateBuffs()
-- for each buff the pawn has
for i, buff in pairs(player.Buffs) do
if buff.Id == _id then
return true
end
end
return false
end
local harvestType = database.nodes[arg1.Id].Type;
local harvestLevel = database.nodes[arg1.Id].Level
local craftLevel, craftBuff, buffPot
if harvestType == NTYPE_ORE then
craftLevel = player:getCraftLevel(CRAFT_MINING)
craftBuff = hasBuff(501310)
buffPot = inventory:findItem(200418)
elseif harvestType == NTYPE_WOOD then
craftLevel = player:getCraftLevel(CRAFT_WOODCUTTING)
craftBuff = hasBuff(501311)
buffPot = inventory:findItem(200420)
elseif harvestType == NTYPE_HERB then
craftLevel = player:getCraftLevel(CRAFT_HERBALISM)
craftBuff = hasBuff(501312)
buffPot = inventory:findItem(200422)
end
if harvestLevel > craftLevel and craftLevel + 5 >= harvestLevel and craftBuff == false and buffPot then
buffPot:use() yrest(1000)
end
return true
</onHarvest>
i'd like to know also the id of the new material high lev ty
Re: superior collection pot for + 8 level harvest
Posted: Thu Sep 26, 2013 10:24 pm
by rock5
Please put your code in
Code: Select all
tags in the future. I did it for you this time. Just use the Code button at the top of the edit box.
To get Ids you can use my TooltipIds addon.
http://www.solarstrike.net/phpBB3/viewtopic.php?p=50700#p50700
Re: superior collection pot for + 8 level harvest
Posted: Fri Sep 27, 2013 3:24 am
by lisa
Code: Select all
{Name = "Superior Collection Potion I",ID = 200196}, -- mining
{Name = "Superior Collection Potion II",ID = 200197}, -- wood
{Name = "Superior Collection Potion III",ID = 200198}, -- herb
{Name = "Collection Potion I",ID = 200418},
{Name = "Collection Potion II",ID = 200420},
{Name = "Collection Potion III",ID = 200422},
But yeah get Rock's addon, it is awesome

Re: superior collection pot for + 8 level harvest
Posted: Fri Sep 27, 2013 3:45 am
by rock5
I didn't give the Ids like that because when I looked them up I saw 3 sets of 3 Superior potions so I didn't know which was current.
Re: superior collection pot for + 8 level harvest
Posted: Fri Sep 27, 2013 5:03 am
by lisa
My database is probably out dated then =(
Re: superior collection pot for + 8 level harvest
Posted: Thu Oct 03, 2013 6:03 pm
by lisa
try this and see if it works, untested.
Code: Select all
<onHarvest>
local craftLevel, craftBuff, buffPot
if arg1.Type == NTYPE_ORE then
craftLevel = player:getCraftLevel(CRAFT_MINING)
craftBuff = player:hasBuff(501328)
buffPot = inventory:findItem(200196)
elseif arg1.Type == NTYPE_WOOD then
craftLevel = player:getCraftLevel(CRAFT_WOODCUTTING)
craftBuff = player:hasBuff(501329)
buffPot = inventory:findItem(200197)
elseif arg1.Type == NTYPE_HERB then
craftLevel = player:getCraftLevel(CRAFT_HERBALISM)
craftBuff = player:hasBuff(501330)
buffPot = inventory:findItem(200198)
end
if arg1.Level > craftLevel and craftLevel + 8 >= arg1.Level and craftBuff == false and buffPot then
buffPot:use() yrest(1000)
end
return true
</onHarvest>
Re: superior collection pot for + 8 level harvest
Posted: Fri Oct 04, 2013 8:29 pm
by Supergala
lida i add i node database the id of the mineral and bot see this and try to harvest without success...i add your answer in onharvest but player don't drink the superior collection potion:
craftLevel = player:getCraftLevel(CRAFT_MINING)
craftBuff = hasBuff(200196)
buffPot = inventory:findItem(200196)
i install rocks toolid for see the id but i don't understand what i wrong
200196 is the id of the pot and the mineral i find 2 number id:242246 and under 560089
can you help me pls?ty
Re: superior collection pot for + 8 level harvest
Posted: Fri Oct 04, 2013 8:39 pm
by BlubBlab
The buff and pot aren't the same they can't be the same ID, so take a look on the potion and the buff.
and to finally use it :
Re: superior collection pot for + 8 level harvest
Posted: Fri Oct 04, 2013 8:54 pm
by Supergala
Code: Select all
<onHarvest>
local function hasBuff(_id)
player:updateBuffs()
-- for each buff the pawn has
for i, buff in pairs(player.Buffs) do
if buff.Id == _id then
return true
end
end
return false
end
local harvestType = database.nodes[arg1.Id].Type;
local harvestLevel = database.nodes[arg1.Id].Level
local craftLevel, craftBuff, buffPot
if harvestType == NTYPE_ORE then
craftLevel = player:getCraftLevel(CRAFT_MINING)
craftBuff = hasBuff(501328)
buffPot = inventory:findItem(200196)
elseif harvestType == NTYPE_WOOD then
craftLevel = player:getCraftLevel(CRAFT_WOODCUTTING)
craftBuff = hasBuff(200197)
buffPot = inventory:findItem(200197)
elseif harvestType == NTYPE_HERB then
craftLevel = player:getCraftLevel(CRAFT_HERBALISM)
craftBuff = hasBuff(200198)
buffPot = inventory:findItem(200198)
end
if harvestLevel > craftLevel and craftLevel + 8 >= harvestLevel and craftBuff == false and buffPot then
buffPot:use() yrest(1000)
end
return true
</onHarvest>
i use correct buff and pot id in mineral section and i add in database mineral id....bot not drink pot...any suggestion?
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 12:07 am
by BlubBlab
I say it more simple their are no 2 thinks in the game which have the same ID
Buffs and potions are 2 different thinks
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 12:24 am
by rock5
'hasBuff' actually compares the name obtained from the id so as long as the buff name is the same as the item name it should work. Wait, he is using his own custom hasbuff function. Then, yes, the buff ids have to be correct.
I might help you Supergala but first you have to learn to use the 'Code' tags.
Edit your last post. Select the code with your mouse. Click the '
Code' button at the top of the edit box. Then click 'Submit'.
When you have done that, I'll see if I can give you some suggestions.
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 6:16 am
by Supergala
ok rocks now i understand how to do code:=)
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 6:22 am
by rock5
That's better.
Because you are using a custom hasBuff function the buff ids have to be correct. If the ones Lisa provided (501328, 501329, 501330) are wrong then use TooltipIds to get the correct buffs ids. When you point at the buffs, the ids should print in the chat box.
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 6:42 am
by Supergala
rocks before I corrected the post, so we check into code mineral section .... I've already used your tooltip and I've already checked the id: the ore has 2 numbers when I go over with the pointer:
242246 and 560089, the buff potion id 501328,,,, now what do you say?
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 8:27 am
by rock5
TooltipIds is not so good for getting node ids because it can only list all the ids that have that name. It can't know which is the correct id. If it shows more than one Id and you want to know which is correct use getid.lua
I suspect 560089 is the correct Id because it follows what is in the node database. By the way, 560089 is not in the database. I take it it's a new ore? The database only goes up to level 75. Can you tell me about it? Like name, level, whether it's rare or not. Are there any other resources need to be added?
I'll try and guess.
I think these are the regular resources.
Level 81 Ore - Silver Star Stone - Id 560089
Level 81 Herb - Isyeh Grass - Id 560097
Level 81 Wood - Nadal Wisteria Wood - Id 560093
I think these are the rare resources.
Level 81 Ore - Ironaxe Stone - Id 560101
Level 81 Herb - Dragonsprout Grass - Id 560105
Level 81 Wood - Blood Palm Wood - Id 560103
Assuming they are correct, here is the updated nodes database. Put it in the "rom/database" folder.
Then correct all your buff ids and hopefully it will work.
By the way, I noticed a bug with TooltipIds. When I point at a resource node I get the same results repeated. It only happens with resources. Does that happen to you?
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 9:00 am
by Supergala
infact now works:)ty rocks..

:):):):):)
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 9:04 am
by rock5
So, do you get that TooltipIds bug like is shown in the picture?
Re: superior collection pot for + 8 level harvest
Posted: Sat Oct 05, 2013 6:52 pm
by Supergala
with other id but y