[Guide] Create a real shop(not text based) with custom npc by cyberghoser1

03/17/2010 12:43 cyberghoser1#1
Hello friends, today i will show you how to create a nice shop, a real one, not a text based npc seller ;-)

It is quite easy to do, you just have to care about the ID's

Let's start:

Part I: Database

First we have to create a custom NPC, go into your database and open cq_npc, create a new not used ID, in my example it will be 100004, here i show you the right way to add it.

paste in cq_npc
Code:
[COLOR="Red"]100004[/COLOR]	0	0	Guilda	123	1000040	0	0	-1	1000	192	341	[COLOR="Blue"]900001020[/COLOR]	0	0	0	0	0	0	0	0	1	0	0	ΞžΞ®	0	0	0	0	1	0	0	0	0	0

NPC ID
cq_task ID
type=123 (Green baloon cursor)


Explanation: The NPC ID will be used also to create the shop with Funhacker's Tool shop.dat editor. The cq_task id must be the same as the cq_action id for this npc, don't worry everything will be easy to understand.

once you have pasted the above cq_npc now we are gonna to to make the task for it, so obviously we are going to open cq_task. Again create a non used id, beware that the same id will be used on cq_action so check on there too that the id is not used.

paste in cq_task
Code:
[COLOR="Blue"]900001020[/COLOR]	[COLOR="Blue"]900001020[/COLOR]	0			0	0	999	-100000	100000	999	0	0	-1	0
as you can see the cq_task id match the one used on the npc, so we are working the right way ;-)

Now we have to create the cq_action for this npc, easy also in here, we will use the same id as cq_task.

paste in cq_action
Code:
[COLOR="Blue"]900001020[/COLOR]	0	0	[COLOR="Red"]1046[/COLOR]	1
Same as cq_task id
Type=1046

Also we have to add those items we are going to sell on cq_goods table, the items are those i use in my example:

paste in cq_goods
Code:
9999995	[COLOR="Red"]100004[/COLOR]	[COLOR="Blue"]420084[/COLOR]
9999994	[COLOR="Red"]100004[/COLOR]	[COLOR="Blue"]420074[/COLOR]
9999996	[COLOR="Red"]100004[/COLOR]	[COLOR="Blue"]420094[/COLOR]
Shop ID(Same as NPC ID)
Items to be sell ID's (See the picture bellow Client Edits)
9999994 to 9999996 = custom ids needed for cq_goods

You follow? Now the Database side is done, we have now to make our shop and customize our npc to look better than those ugly blue 100npcs.

Part II: Client Edits

Very easy in here also, in my example i used 100004 as id, so get [Only registered and activated users can see links. Click Here To Register...] and open your shop.dat file.

[Only registered and activated users can see links. Click Here To Register...]

If you want the shop to be EP set the shop type to 5 as the pic below, for gold shop set type to 2 like the above pic Note: EP Shop is buggy atm, have to see why items cannot be bought!

[Only registered and activated users can see links. Click Here To Register...]

you can see on the above picture that the shop id is the same as the npc created.

Ok now save your shop.dat

Now we are gonna make our npc custom with a title and a lookface. For the npc to have a lookface we can see in the above cq_npc entry that it uses lookface 1000040, easy here, the id of the npc is 100004, to have a lookface we have to calculate npcid*10 so 100004*10 = 1000040, this is valable for all npcs, so open up your npc.ini file and add this:

Code:
[NpcType100004]
Name=Guilda
SimpleObjID=745
StandByMotion=0745000100
BlazeMotion=0745000190
BlazeMotion1=0700000190
BlazeMotion2=0700000190
RestMotion=0745000101
Effect=charm03-999
ZoomPercent=100
Note=WeaponsSeller
where [NPCType100004] = id of the npc
SimpleObjID=745 (Shopping mall lookface)
Effect=charm03-999 (find more here: [Only registered and activated users can see links. Click Here To Register...])
Name=Name of the NPC
Note=What it sells.

Congratulations your custom shop is ready and its beautifull!:

[Only registered and activated users can see links. Click Here To Register...]

Hope you like it, as i always say maybe there are better, easier ways, i'm just sharing what i do the way i do it.

The ID's I am using are custom and do not exist on my database, so please, make a backup of yours first, check that the ID's are not used and go on, create as many shops you want, until the ID's are new you don't have to worry!

Guide by cyberghoser1
03/17/2010 13:08 PraDevil[ELITE]#2
really helpfull about cq_action!! thanks:D
03/17/2010 14:31 matrix89#3
ep or gold NPC?
and how to set in ep?
03/17/2010 14:35 cyberghoser1#4
Yes there is something to do to change that, on the shop.dat tool, set type to 5 for EP Shop and to type 2 for Gold, attention once done you cannot change the type from the tool.
03/17/2010 16:15 ~WARNING~#5
thanks =P this will come in handy for my next server :D

*Added to [Only registered and activated users can see links. Click Here To Register...]
03/17/2010 16:45 cyberghoser1#6
Thanks, also edited first post to clarify how to set if the shop is EP or Gold.
03/17/2010 17:21 King_Arthur#7
Always nice to see a well formatted guide. Good job.
03/17/2010 19:51 hio77#8
have you tested that ep shop ... there was issues when i tried it and i know funhacker and acme had issues with ep shops at the time as well ... idk if they worked it out ... but i tried every shop type and stuff and it never worked

well written guide :)
03/17/2010 19:55 Faith.#9
Really Simple , Step by Step for newbies like me. lol
03/17/2010 20:54 King_Arthur#10
Quote:
Originally Posted by hio77 View Post
i know funhacker and acme had issues with ep shops at the time as well ... idk if they worked it out ...
Never worked it out and havn't tried since.
03/17/2010 22:06 magewarior2#11
Nice!! :bandit: tnxs for this.
03/17/2010 22:34 cyberghoser1#12
Quote:
Originally Posted by hio77 View Post
have you tested that ep shop ... there was issues when i tried it and i know funhacker and acme had issues with ep shops at the time as well ... idk if they worked it out ... but i tried every shop type and stuff and it never worked

well written guide :)
Yeah you are right about that one, tried every type almost myself, cannot buy the stuff, compared to shop 1352(CastleShopEP) cannot find any differences, i will keep search about that.
03/18/2010 04:20 hio77#13
Quote:
Originally Posted by King_Arthur View Post
Never worked it out and havn't tried since.
thought so lol...

Quote:
Originally Posted by cyberghoser1 View Post
Yeah you are right about that one, tried every type almost myself, cannot buy the stuff, compared to shop 1352(CastleShopEP) cannot find any differences, i will keep search about that.
yeh i ended up using the castle ep shop for an custom ep shop on mine ...
03/18/2010 04:22 cyberghoser1#14
If it can be fixed i'm sure i will find it, if not then gold is not bad at all.
04/28/2010 09:21 Hinataa#15
@cyberghoser1
I'm finding that my question is noob, but
as you changed the angle of the game?