Likes: 0
Results 1 to 1 of 1
-
20-08-17, 02:55 AM #1
Player Housing Updated and "rewritten"
Register to remove this adOriginally Posted by Loud21
You have 2 usable commands, one is .house add the other is .house fix.
.house add will add a 10x10 house at the location you are currently standing in, adding a new house will also spawn an npc at that location, which the player will buy the house from.
You can place an NPC using the creature script "player_housing_npc" at the location of your main mall or whatever. The players can later talk to the NPC in the mall to preview or buy the houses which you created.
You should use the command .house fix whenever one of the houses is sold to fix the ids in the database since they get "distorted"
when someone buys a house.
I left a couple of entries in the player_house_spawns table in hope that it will explain how the whole database system works.
If not here's a short tutorial.
The maximum amount of creatures or objects you can add to each package is 15
So thats 30 entries for one package in total.
There are 5 columns in total in the player_house_spawns table.
id, CreaOrObjId, CreaOrObjName, CreatureOrObject, package.
In total the players can purchase up to 4 package upgrades from the NPC using the "player_housing_npc" script.
These upgrades will allow them to spawn more objects and creatures.
Theid column is the most confusing out of the bunch.
For example, if you have 1 creature and 1 object and they are both in the package 1 you can set both of their ids as 1,
but if you add one more creature or one more object into package 1, that new entry will have to have its id set to 2, the old object and creature will still have the number 1 in the entry column. If you add a creature or an object to package 2 you can set their id's as 1 again. (Idk if this makes any sense honestly for some reason its hard for me to explain this.)
CreaOrObjId is the entry of either the creature or the object from creature_template or object_template.
CreaOrObjName is the name of your object or creature, it doesnt have to be the same as the one in the creature_template or the object_template
CreatureOrObject determines if the entry is a creature or the object, the value 0 is used for creatures the value 1 is used for objects.
packages determines which package the creature and the object belong to.
SQL Part
SQL
C++ Part
Player Housing Npc
Player Housing <- The one I "rewrote"
SQL For the needed creatures.
Code:INSERT INTO `creature_template` VALUES (535535, 0, 0, 0, 0, 0, 20291, 0, 0, 0, 'Player Housing', 'Purchase a Home', '', 68, 80, 80, 2, 35, 129, 1, 1, 0.3, 0, 0, 2000, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 'player_housing_npc', 12340, 0, 0, NULL); INSERT INTO `creature_template` VALUES (555555, 0, 0, 0, 0, 0, 22209, 0, 0, 0, 'Buy this Land', 'House', '', 68, 80, 80, 2, 35, 1, 1, 1, 1.5, 0, 0, 2000, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 'player_housing_npc_guide', 12340, 0, 0, NULL);
Code:INSERT INTO `item_template` VALUES (351270, 15, 0, -1, 'House Controller', 32300, 6, 0, 0, 1, 35000, 0, 0, -1, -1, 255, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 2000, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70522, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, 'Proud owner of an Astral House.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 'npc_player_house', 0, 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, 0, 0, 0, 0, 15595); INSERT INTO `item_template` VALUES (351290, 15, 0, -1, 'House Token', 32300, 6, 0, 0, 1, 0, 0, 0, -1, -1, 255, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 2000, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 'This item is used for purchasing and upgrading houses. It\'s price is 1 000 MG.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15595);
Code:void AddSC_PlayerHousing(); void AddSC_npc_player_house(); And AddSC_PlayerHousing(); AddSC_npc_player_house();
Update credits : Loud21
› See More: Player Housing Updated and "rewritten"
Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!
SEO Blog