Elite Diviner
- Joined
- Sep 12, 2020
- Messages
- 442
- Reaction score
- 224
Adding STORES
To add a item store to lets say NPC 124416 you have to start buy creating a new lua code with
Then all you have to do is add it to QuestNPCObjectDB , So you would add lua_ZONE35_124416 to szluainitscript and finish it with LuaS_ComShop in szluascript. check items for sale in ShopObjectData 601015.
Adding SHOPS
To adding a Recipe shop all you need is a lua code like below.
we will use the Blacksmith_RecipeList_124042 to add in the sell items like below.
after this you need to finish the function for the sell you can have many setup above and just the one call to buy, that would be added like this
as long as you add in your sql links to lua code everything will work ...
Then all you have to do is add it to QuestNPCObjectDB , So you would add Blacksmith_RecipeList_124042 to szluainitscript and finish it with Lua_buytheskill in szluascript. NO need to check items for sale in ShopObjectData, Not needed for recipes.
Janebug
To add a item store to lets say NPC 124416 you have to start buy creating a new lua code with
Code:
function lua_ZONE35_124416()
SetMinimapIcon ( OwnerID(), EM_MapIconType_Shop ); -- Others include _Armor, _Weapon, _Mat or _Potion.
SetShop( OwnerID() , 601015 , "Test_Shop_Close" );
end
Then all you have to do is add it to QuestNPCObjectDB , So you would add lua_ZONE35_124416 to szluainitscript and finish it with LuaS_ComShop in szluascript. check items for sale in ShopObjectData 601015.
Adding SHOPS
To adding a Recipe shop all you need is a lua code like below.
we will use the Blacksmith_RecipeList_124042 to add in the sell items like below.
Code:
function Blacksmith_RecipeList_124042()
AddRecipe( OwnerID(), 553228 );
AddRecipe( OwnerID(), 553229 );
AddRecipe( OwnerID(), 553230 );
AddRecipe( OwnerID(), 553234 );
AddRecipe( OwnerID(), 553235 );
end
after this you need to finish the function for the sell you can have many setup above and just the one call to buy, that would be added like this
Code:
function Lua_buytheskill()
LoadQuestOption(OwnerID())
AddSpeakOption( OwnerID(), TargetID( ), GetString("SO_FORMULA_STORE") , "Lua_buytheskill_1", 0 ) -- Janebug
end
function lua_buytheskill_1()
closeSpeak( OwnerID() )
GetRecipeList( OwnerID(), TargetID() ); -- GetRecipeList( Player, NPC );
end
as long as you add in your sql links to lua code everything will work ...
Then all you have to do is add it to QuestNPCObjectDB , So you would add Blacksmith_RecipeList_124042 to szluainitscript and finish it with Lua_buytheskill in szluascript. NO need to check items for sale in ShopObjectData, Not needed for recipes.
Janebug