• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

DragonrajaDB guide

Newbie Spellweaver
Joined
Feb 19, 2006
Messages
43
Reaction score
0
I think it'll be good idea to post on this topic exact descriptions and examples of database tables and columns/rows. I just prepared some i'd like to share.
Some of columns are unknown to me for now, but maybe we'll figure it out
later together. I'll edit this first post if find any new detail.

EVENTS:

Code:
	event_message:              [B]Global/Local messages of incoming/current events[/B]
		event_no                message index
		event_start_date
		event_end_date
		all			      message to all? (0-no, 1-yes)
		nation			   which nation send it to (if all = 1, choose anything)
		map                        map name
		time			    message period
		message		        The message that will be send

Set of 3 tables for one kind of event (they are connected with the data)
Code:
	event_npc:                     [B]Table with event npc respawn settings[/B]
		event_no		event id index
		event_start_date
		event_end_date
		map			map name (for example: MA-IN)
		map_x
		map_y
		npc_no			id of the npc
		npc_script		0 will work
		npc_many	      how many npc will be spawned once
		regen	                 how many npcs will be respawned (setting many 
                                             to 1 and regen to 0 will make no respawns)
		regen_time		respawn time after killing a monster (in seconds)
	
	event_npcitem:                [B]Table with event item in one of event npcs[/B]
		event_no		 number of the event 
		event_start_date      start date when item may appear
		event_end_date	     end date when item may appear
		map			  map name
		script_no		 dont know, try choosing 0
		number			dont know, try 1
		event_npcitem_bag	bag id (create that bag in another db described
                                                   down here)
		text			event text 
		fail_text		event text when you fail
	

	Event_NpcItem_Bag     [B]Table with bags that may be used in the event[/B]
		no			id number of the bag (same as event_npcitem_bag
                                         in event_npcitem table)
		item1			id of item 1... and same with the other: (table is 
                                           from item1 to item14)

Another event, difference to event_npc is that this starts every choosen day of the week/hour, just like the nation war or local war.
Code:
	Event_Monster             [B]Table with event monster respawn settings[/B]
		Index			event index
		Map_Port	     port of event map
		GroupNo		     Your group number, this event npcs can appear
                                           in a group
		IsBoss			0-no, 1-yes, look at npc_generationSP for it.
		NPC_No		     Npc ID
		LocationX
		LocationY
		Event_No	     dont know what is that, choosing 0 works.
		Max_No		     maximum number of this kind of the event 
                                          (0 = infinitive?)
		
	EM_GroupInfo              [B]Table with monster group settings[/B]
		index			group info index
		MapPort		      port of group event map
		GroupNo		     group that settings apply to (same as GroupNo in
                                          event_monster)
		ExecType	     dont know, choosing 1 works.
		DayOfWeek	   from 0 to 6
		DHour		       hour of the event
		KilledGroup	      dont know, 0 works.
		
	event_monsteritem       [B]setting of items that may appear on the event[/B]
		event_no		event number (from event_monster - index)
		event_start_date     for example 2006-04-10 14:33:10
		event_end_date		
		map			 map name, for example MA-IN
		npc_no			index of npc with the event item (npc must be the
                                             one of group members of that event)
		percent			0-100
		max			max items that can be obtained by this event
		item_no		      id of the item
		item_mutant	    choose 0
		item_grade	     choose 0
		amount		      0 > as many as you wish
		reg_date	      <NULL> is fine

On this one, you can choose the items for a starting character. It may be good
if you want push new players to choose the character you need. On my server,
we need more zypern members so i'll focus on doing something here for them...
Code:
	Event_StartItem
		event_no		number of the event
		event_start_date
		event_end_date
		all			   all nations? (0- no, 1-yes)
		sex			 which gender (0-male, 1-female)
		class			 which class shall get the item
		nation			which nation will get the item
		item1_no	      id of the item1
		item1_mutant	    choose 0
		item1_grade	     grade, choose 0
		item2_no
		item2_mutant
		item2_grade
 
Last edited:
Newbie Spellweaver
Joined
Feb 19, 2006
Messages
43
Reaction score
0
well, i have "small" problem with sql queries, trying to make some for quests...

here's the example code of query to event_monster:
Code:
insert into event_monster ([Index], Map_Port, GroupNo, isBoss, NPC_No, LocationX, LocationY, Event_No, Max_No) 
(select max([Index])+1, 5000, 1, 0, 7, 100, 100, 0, 1)

as far as i know, every name that's reserved in SQL, and is used by DR, should be written between [ and ], to avoid querry errors. It works with columns like "Name", "Time" etc, but when i want to make a query to event_monster, first column is Index. And i am now confused how to write that query to make it work... "Index" is SQL reserved word too, and even "[index]" form doesn't solve the problem... i got error:
Code:
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'Index'.

any ideas how to make this query correct, not by hand-editing this column? :p
 
Newbie Spellweaver
Joined
Dec 7, 2005
Messages
8
Reaction score
0
insert into event_monster (index, map_port, groupno, isboss, npc_no, locationx, locationy, event_no, max_no) (select max(index)+1,
5000, 1, 0, 7, 100, 100, 0, 1, from event_monster)


that should work....
 
Newbie Spellweaver
Joined
Feb 19, 2006
Messages
43
Reaction score
0
as the matter of fact, this isn't working at all... i'm not a sql noob... and if you post a solution you should check it first... word "Index" is reserved as SQL command, and to put something into table by query, you must take that word into two brackets []... Anyway in this case, even this brackets won't help.

i hate designers of DR dbase, why they use reserved words, dunno...
 
Junior Spellweaver
Joined
Apr 16, 2005
Messages
129
Reaction score
0
if you're no sql noob, you should at least know the sql insertion syntax... it's not

insert into event_monster ([Index], Map_Port, GroupNo, isBoss, NPC_No, LocationX, LocationY, Event_No, Max_No)
(select max([Index])+1, 5000, 1, 0, 7, 100, 100, 0, 1)

but
insert into event_monster ([Index], Map_Port, GroupNo, isBoss, NPC_No, LocationX, LocationY, Event_No, Max_No) VALUES(select max([Index])+1, 5000, 1, 0, 7, 100, 100, 0, 1)

the select max() won't work because it has no table to select from.. something like
SELECT MAX([Index])+1 AS 'maxindex' FROM event_monster
should somehow solve it, but I've never ever done any MSSQL querries before so its up to you
 
Junior Spellweaver
Joined
Jun 4, 2004
Messages
163
Reaction score
0
Just modify the table structure and make it auto increment, then just skip it in the field selection.
 
Back
Top