Quote:
Originally Posted by fakeheader
Thank you for your answer but here is my problem
in zbot there is no alex npc in the parse and also you made other npc static
so what if the client have custom npc names how would I auto buy pots for example
thats why I need to make it generic
|
GGWP; You just wasted a lot of time.
1st: Parse SingleSpawn & GroupSpawn
You get, NPCObjectID, XYZ from them.
Then you need to load up a few txt files, get the item locations via this.
Quote:
Originally Posted by Royalblade*
This won't be useful for the general people here. However, when somebody else goes n makes a bot in future, this will save up tons of brainfuck.
However, if you do find a better way to do this, go ahead and post it.
This is strictly speaking only for Type 8 @ 0xB034, since the rest is entirely different.
All those people making alchemy bots etc.. this is highly useful for you :p
EDIT: For shit like this:
First create this function
PHP Code:
CREATE FUNCTION _getTabIndex(@NPCID INT, @TabCodename VARCHAR(128))
RETURNS INT
AS
BEGIN
DECLARE @Index INT;
SELECT @Index = tabindex
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY tab.RefTabGroupCodeName ASC, tab.ID ASC)-1 tabindex, tab.CodeName128
FROM _RefShopTab tab
JOIN _RefMappingShopWithTab maptab ON tab.RefTabGroupCodeName = maptab.RefTabGroupCodeName
JOIN _RefShop shop ON maptab.RefShopCodeName = shop.CodeName128
JOIN _RefMappingShopGroup mapshop ON shop.CodeName128 = mapshop.RefShopCodeName
JOIN _RefShopGroup shopgroup ON mapshop.RefShopGroupCodeName = shopgroup.CodeName128
JOIN _Refobjcommon R ON shopgroup.RefNPCCodeName = R.CodeName128
WHERE R.ID = @NPCID
) q
WHERE q.CodeName128 = @TabCodename
RETURN @Index
END
Then run this and create your npcshoplist. You need to parse NPCs via single/groupspawn beforehand though, otherwise you cant get the NPC ID.
PHP Code:
SELECT npc.ID as NPCID,.dbo._getTabIndex(npc.ID,goods.RefTabCodeName) TabID, Item.id as ItemID, goods.SlotIndex ,scrap.Data
FROM _RefShopGoods goods
JOIN _RefShopTab tab ON goods.RefTabCodeName = tab.CodeName128
JOIN _RefMappingShopWithTab maptab ON tab.RefTabGroupCodeName = maptab.RefTabGroupCodeName
JOIN _RefShop shop ON maptab.RefShopCodeName = shop.CodeName128
JOIN _RefMappingShopGroup mapgroup ON shop.CodeName128 = mapgroup.RefShopCodeName
JOIN _RefShopGroup shopgroup ON mapgroup.RefShopGroupCodeName = shopgroup.CodeName128
JOIN _Refobjcommon npc ON shopgroup.RefNPCCodeName = npc.CodeName128
JOIN _RefPackageItem package ON goods.RefPackageItemCodeName = package.CodeName128
JOIN _RefScrapOfPackageItem scrap ON package.CodeName128 = scrap.RefPackageItemCodeName
JOIN _Refobjcommon item ON scrap.RefItemCodeName = item.CodeName128
WHERE npc.ID = 2073
ORDER BY tab.RefTabGroupCodeName ASC, tab.ID ASC
|
THEN it would be properly dynamic. But you don't need anything like XYZ from CharData.txt