missing project/build files
[client-tools.git] / src / game / server / database / packages / loader.plsql
blob33261cfe78021b523b483c733d67428b0c69ceaf
1 create or replace package body loader as
3         procedure get_version_number(current_version in out number, min_version in out number)
4         as
5         begin
6                 select version_number, min_version_number
7                 into current_version, min_version
8                 from version_number;
9         end;
11         function get_character_name_list return cursortype
12         as
13                 result_cursor cursortype;
14         begin
15                 -- free up names that aren't in use anymore
16                 delete from players
17                 where not exists (select 1 from objects where objects.object_id = character_object);
19                 open result_cursor for
20                 select character_object, station_id, uc_character_name, character_full_name,
21                        (create_time - to_date('01/01/1970', 'MM/DD/YYYY')) * 24 * 3600,
22                        (last_login_time - to_date('01/01/1970', 'MM/DD/YYYY')) * 24 * 3600
23                 from players;
25                 return result_cursor;
26         end;
28         function locate_player (p_object_id number) return number
29         as
30         begin
31                 insert into object_list (object_id, container_level)
32                 select object_id, 100
33                 from objects
34                 where load_with = p_object_id and deleted = 0;
36                 return sql%rowcount;
37         end;
39         procedure locate_universe
40         as
41         begin
42                 insert into object_list (object_id)
43                 select o.object_id
44                 from objects o, universe_objects u
45                 where o.object_id = u.object_id
46                 and o.deleted=0;
47         end;
49         procedure locate_contained_object (p_container_id number, p_object_id number)
50         as
51         begin
52                 insert into object_list (object_id, container_level)
53                 select object_id, 100
54                 from objects o
55                 start with
56                         o.object_id = p_object_id
57                         and o.contained_by = p_container_id
58                         and o.deleted = 0
59                 connect by
60                         prior o.object_id = o.contained_by
61                         and o.deleted = 0;
62         end;
64         function locate_by_loadwith_batch (p_loadwiths vaofstring, p_chunk_size number)
65         return number
66         as
67         begin
68                 forall i in 1..p_chunk_size
69                         insert into object_list (object_id)
70                         select o.object_id
71                         from objects o
72                         where o.load_with = p_loadwiths(i) and o.deleted = 0;
74                 return sql%rowcount;
75         end;
77         procedure locate_contents (p_container_id number)
78         as
79         begin
80                 insert into object_list (object_id, container_level)
81                 select object_id, 100
82                 from objects o
83                 where o.load_with = p_container_id and o.deleted = 0;
84         end;
86         procedure locate_structure (p_object_id number, p_x out number, p_z out number, p_scene_id out varchar2, p_found out number)
87         as
88         begin
89                 select x, z, scene_id, 1 into p_x, p_z, p_scene_id, p_found
90                 from objects
91                 where object_id = p_object_id and deleted = 0 and
92                       type_id in (1112885583,  -- BuildingObject
93                                   1212763727,  -- HarvesterInstallationObject
94                                   1229869903,  -- InstallationObject
95                                   1296649807); -- ManufactureInstallationObject
96         exception
97             when no_data_found then
98                 p_found := 0;
99         end;
101         function get_characters (p_station_id number) return cursortype
102         as
103                 result_cursor cursortype;
104         begin
105                 open result_cursor for
106                 select
107                         character_object,
108                         object_template_id,
109                         scene_id,
110                         object_name,
111                         container,
112                         x,
113                         y,
114                         z
115                 from character_view
116                 where station_id = p_station_id;
118                 return result_cursor;
119         end;
121         function load_chunk_object_list (p_scene_id varchar, p_node_x float, p_node_z float) return number
122         as
123                 num number;
124         begin
125                 select count(*)
126                 into num
127                 from objects
128                 where node_x = p_node_x
129                         and node_z = p_node_z
130                         and scene_id = p_scene_id
131                         and deleted = 0;
133                 if (num > 0) then
134                         insert into object_list (object_id, container_level)
135                         select object_id, level
136                         from objects
137                         start with
138                                 node_x = p_node_x
139                                 and node_z = p_node_z
140                                 and scene_id = p_scene_id
141                                 and deleted = 0
142                                 and contained_by = 0
143                                 and player_controlled = 'N'
144                         connect by 
145                                 prior object_id = contained_by
146                                 and deleted = 0
147                                 and player_controlled='N'
148                                 and prior load_contents='Y';
150                         return sql%rowcount;
151                 else
152                         return 0;
153                 end if;         
154         end;
156         function load_manf_schematic_attributes return cursortype
157         as
158                 result_cursor cursortype;
159         begin
160         open result_cursor for
161                 select  /*+ ORDERED USE_NL(T) */ t.object_id, t.attribute_type, t.value
162                 from    
163                         object_list l,
164                         manf_schematic_attributes t
165                 where t.object_id = l.object_id;
167                 return result_cursor;
168         end;
170         function load_armor return cursortype
171         as
172                 result_cursor cursortype;
173         begin
174                 open result_cursor for
175                         select /*+ ORDERED USE_NL(T) */
176                                 t.object_id,
177                                 t.layer,
178                                 t.object_template,
179                                 t.effectiveness, 
180                                 t.integrity,
181                                 t.special_protections,
182                                 t.encumberance_0,
183                                 t.encumberance_1,
184                                 t.encumberance_2,
185                                 t.encumberance_3,
186                                 t.encumberance_4,
187                                 t.encumberance_5,
188                                 t.encumberance_6,
189                                 t.encumberance_7,
190                                 t.encumberance_8
191                         from
192                                 object_list l,
193                                 armor t
194                         where t.object_id = l.object_id;
196                 return result_cursor;
197         end;
199         function load_scripts return cursortype
200         as
201                 result_cursor cursortype;
202         begin
203                 open result_cursor for
204                         select /*+ ORDERED USE_NL(T)*/
205                                 t.object_id, t.script, t.sequence_no
206                         from
207                                 object_list l,
208                                 scripts t
209                         where t.object_id = l.object_id;
211                 return result_cursor;
212         end;
214         function load_object_variables return cursortype
215         as
216                 result_cursor cursortype;
217         begin
218                 open result_cursor for
219                         select /*+ ORDERED USE_NL(T)*/
220                                 t.object_id, t.name_id, t.type, t.value
221                         from
222                                 object_list l,
223                                 object_variables t
224                         where l.object_id = t.object_id
225                         and nvl(t.detached,0) = 0;
227                 return result_cursor;
228         end;
230         function load_property_lists return cursortype
231         as
232                 result_cursor cursortype;
233         begin
234                 open result_cursor for
235                         select /*+ ORDERED USE_NL(T) */
236                                 t.object_id, t.list_id, t.value
237                         from object_list l, property_lists t
238                         where t.object_id = l.object_id;
240                 return result_cursor;
241         end;
243         function load_experience return cursortype
244         as
245                 result_cursor cursortype;
246         begin
247                 open result_cursor for
248                         select /*+ ORDERED USE_NL(T) */
249                                 t.object_id, t.experience_type, t.points
250                         from object_list l, experience_points t
251                         where t.object_id = l.object_id;
253                 return result_cursor;
254         end;
256         function load_battlefield_participants return cursortype
257         as
258                 result_cursor cursortype;
259         begin
260                 open result_cursor for
261                         select t.region_object_id, t.character_object_id, t.faction_id  /*+ ORDERED USE_NL(T) */
262                         from object_list l, battlefield_participants t
263                         where t.region_object_id = l.object_id; -- order does not matter
265                 return result_cursor;
266         end;
268         function load_messages return cursortype
269         as
270                 result_cursor cursortype;
271         begin
272                 open result_cursor for
273                         select /*+ ORDERED USE_NL(MESSAGES) */
274                                 target, message_id, method, data, call_time, guaranteed, delivery_type
275                         from  object_list, messages
276                         where target =object_list.object_id;
278                 return result_cursor;
279         end;
281         function load_location return cursortype
282         as
283                 result_cursor cursortype;
284         begin
285                 open result_cursor for
286                         select  /*+ ORDERED USE_NL(T) */
287                                 t.object_id,
288                                 t.list_id,
289                                 t.sequence_number,
290                                 t.name,
291                                 t.scene,
292                                 t.x,
293                                 t.y,
294                                 t.z,
295                                 t.radius
296                         from
297                                 object_list l,
298                                 location_lists t
299                         where t.object_id = l.object_id;
301                 return result_cursor;
302         end;
304         function load_object
305         return cursortype
306         as
307                 result_cursor cursortype;
308         begin
309                 open result_cursor for
310                         select /*+ ORDERED USE_NL(T) */
311                                 t.object_id,
312                                 x,
313                                 y,
314                                 z,
315                                 quaternion_w,
316                                 quaternion_x,
317                                 quaternion_y,
318                                 quaternion_z,
319                                 node_x,
320                                 node_y,
321                                 node_z,
322                                 object_template_id,
323                                 type_id,
324                                 scene_id,
325                                 controller_type,
326                                 deleted,
327                                 object_name,
328                                 volume,
329                                 contained_by,
330                                 slot_arrangement,
331                                 player_controlled,
332                                 cache_version,
333                                 load_contents,
334                                 cash_balance,
335                                 bank_balance,
336                                 complexity,
337                                 name_string_table,
338                                 name_string_text,
339                                 static_item_name,
340                                 nvl(static_item_version,0),
341                                 nvl(conversion_id,0),
342                                 load_with,
343                                 objvar_0_name,
344                                 objvar_0_type,
345                                 objvar_0_value,
346                                 objvar_1_name,
347                                 objvar_1_type,
348                                 objvar_1_value,
349                                 objvar_2_name,
350                                 objvar_2_type,
351                                 objvar_2_value,
352                                 objvar_3_name,
353                                 objvar_3_type,
354                                 objvar_3_value,
355                                 objvar_4_name,
356                                 objvar_4_type,
357                                 objvar_4_value,
358                                 objvar_5_name,
359                                 objvar_5_type,
360                                 objvar_5_value,
361                                 objvar_6_name,
362                                 objvar_6_type,
363                                 objvar_6_value,
364                                 objvar_7_name,
365                                 objvar_7_type,
366                                 objvar_7_value,
367                                 objvar_8_name,
368                                 objvar_8_type,
369                                 objvar_8_value,
370                                 objvar_9_name,
371                                 objvar_9_type,
372                                 objvar_9_value,
373                                 objvar_10_name,
374                                 objvar_10_type,
375                                 objvar_10_value,
376                                 objvar_11_name,
377                                 objvar_11_type,
378                                 objvar_11_value,
379                                 objvar_12_name,
380                                 objvar_12_type,
381                                 objvar_12_value,
382                                 objvar_13_name,
383                                 objvar_13_type,
384                                 objvar_13_value,
385                                 objvar_14_name,
386                                 objvar_14_type,
387                                 objvar_14_value,
388                                 objvar_15_name,
389                                 objvar_15_type,
390                                 objvar_15_value,
391                                 objvar_16_name,
392                                 objvar_16_type,
393                                 objvar_16_value,
394                                 objvar_17_name,
395                                 objvar_17_type,
396                                 objvar_17_value,
397                                 objvar_18_name,
398                                 objvar_18_type,
399                                 objvar_18_value,
400                                 objvar_19_name,
401                                 objvar_19_type,
402                                 objvar_19_value,
403                                 script_list,
404                                 l.container_level
405                         from
406                                 object_list l,
407                                 objects t
408                         where
409                                 t.object_id=l.object_id;
411                 return result_cursor;
412         end;
414         function verify_containment_chain(p_start_with_object_id in number) return number
415         as
416         -- result codes:
417                 --    1 = containment chain is recursive and is in starting(character) object chain 
418                 --        (can be fixed by placing the object in the world if its a character)  
419                 --    2 = containment chain is recursive but not in starting object chain (this must be fixed manually)
420                 --    3 = no recursion in containment chain
421                 
422                 m_retval pls_integer;
423                 m_temp   pls_integer;
424         begin
425 /*              m_retval :=  2;
426                 
427                 select count(*) into m_temp
428                 from objects 
429                 start with object_id = p_start_with_object_id
430                 connect by prior object_id = contained_by
431                 and object_id != p_start_with_object_id;
432 */              
433                 m_retval :=  1;
434                 
435                 select count(*) into m_temp
436                 from objects 
437                 start with object_id = p_start_with_object_id
438                 connect by object_id = prior contained_by;
439                 
440                 m_retval :=  3;
441                                 
442                 return m_retval;
443         exception
444                 when others then
445                         return m_retval;
446         end;
447         
448         function fix_player_containment_chain(p_start_with_object_id in number) return number
449         as
450         -- result codes:
451                 --    0 = database error                
452                 --    4 = success fix player containment issues
453                 
454                 PRAGMA AUTONOMOUS_TRANSACTION;
455                 
456         begin
457                 update objects set contained_by = 0 where object_id = p_start_with_object_id;
458                 admin.fix_load_with(p_start_with_object_id, p_start_with_object_id);
459                 commit;
460                 
461                 return 4;
462                 
463         exception
464                 when others then
465                         return 0;
466         end;
470 procedure verify_character (p_station_id in number, p_character_id in number, p_gold_schema in varchar2, p_approved out varchar2, p_character_name out varchar2, p_scene_id out varchar2, p_container_id out number, p_x out number, p_y out number, p_z out number, p_containment_check out number)
471         as
473         -- p_containment_check is a flag indicating the containment stautus to be used for logging on the C sid
474                 -- 0 = there was a database error trying to fix containment
475                 -- 1 = there is a recursive containment error in the character object chain that wasn't fixed
476                 -- 2 = there is a recursive containment error in the containment chain not in the character chain
477                 -- 3 = the containment chain is ok
478                 -- 4 = there was a recursive containment error in the character object chain that was fixed
480         m_containment_ok pls_integer;
481         
482         wsx number := null;
483         wsy number := null;
484         wsz number := null;
486         begin
487         
489         -- check containment chain
490         m_containment_ok := verify_containment_chain(p_character_id);
492         -- if containment is bad for the character object try to fix it
493         if (m_containment_ok = 1) then
494                 m_containment_ok := fix_player_containment_chain(p_character_id);
495         end if;
497         p_containment_check := m_containment_ok;
499         if (m_containment_ok >= 3) then
501                 select object_name, scene_id, contained_by, x, y, z, ws_x, ws_y, ws_z
502                 into p_character_name, p_scene_id, p_container_id, p_x, p_y, p_z, wsx, wsy, wsz
503                 from players p, objects o, creature_objects c
504                 where p.station_id = p_station_id
505                 and p.character_object = p_character_id
506                 and o.object_id = p.character_object
507                 and c.object_id = o.object_id
508                 and o.deleted = 0;
510                 if (p_container_id = 0) then
511                         begin
512                                 p_container_id := p_character_id;
513                                 p_approved := 'Y';
514                         end;
515                 else
516                         begin
517                                 select object_id, x,y,z,'Y'
518                                 into p_container_id, p_x, p_y, p_z, p_approved
519                                 from objects
520                                 where contained_by=0
521                                 start with object_id = p_character_id
522                                 connect by prior contained_by=object_id and prior scene_id=scene_id and player_controlled = 'N';
524                         exception
525                                 when no_data_found then
526                                         -- might be in a gold building
527                                         if (p_gold_schema is not null) then
528                                                 begin
529                                                         execute immediate
530                                                                 'select object_id, x,y,z,''Y'' ' ||
531                                                                 'from ' || p_gold_schema || 'objects ' ||
532                                                                 'where contained_by=0 ' ||
533                                                                 'start with object_id = :container_id ' ||
534                                                                 'connect by prior contained_by=object_id'
535                                                         into p_container_id, p_x, p_y, p_z, p_approved
536                                                         using p_container_id;
538                                                 exception
539                                                         when no_data_found then
540                                                         select object_id, x,y,z,'Y'
541                                                         into p_container_id, p_x, p_y, p_z, p_approved
542                                                         from objects
543                                                         where object_id = p_character_id;
544                                                 end;
545                                         else
546                                                 select object_id, x,y,z,'Y'
547                                                 into p_container_id, p_x, p_y, p_z, p_approved
548                                                 from objects
549                                                 where object_id = p_character_id;
550                                         end if;
551                         end;
552                 end if;
554         else
556                 select 'N' into p_approved from dual;
558         end if;
561                 if ( wsx is not null ) then
562                         begin
563                                  p_x := wsx;
564                                  p_y := wsy;
565                                  p_z := wsz;
566                         end;
567                 end if;
570                 update players
571                 set last_login_time = sysdate
572                 where station_id = p_station_id
573                 and character_object = p_character_id;
575         exception
576                 when no_data_found then
577                         select 'N'
578                         into p_approved
579                         from dual;
580                 when too_many_rows then
581                         select 'N'
582                         into p_approved
583                         from dual;
584                 when others then
585                         select 'N'
586                         into p_approved
587                         from dual;
588         end;
593         function load_waypoint
594         return cursortype
595         as
596                 result_cursor cursortype;
597         begin
598                 open result_cursor for
599                         select /*+ ORDERED USE_NL(T) */
600                                 t.object_id,
601                                 t.waypoint_id,
602                                 t.appearance_name_crc,
603                                 t.location_x,
604                                 t.location_y,
605                                 t.location_z,
606                                 t.location_cell,
607                                 t.location_scene,
608                                 t.name,
609                                 t.color,
610                                 t.active
611                         from
612                                 object_list l,
613                                 waypoints t
614                         where
615                                 t.object_id=l.object_id;
617                 return result_cursor;
618         end;
620         function load_player_object     return cursortype
621         as
622                 result_cursor cursortype;
623         begin
624                 open result_cursor for
625                         select /*+ ORDERED USE_NL(T) USE_NL(A)*/
626                                 t.object_id,
627                                 t.station_id,
628                                 a.house_id,
629                                 t.num_lots,
630                                 a.is_outcast,
631                                 a.cheater_level,
632                                 a.max_lots_adjustment,
633                                 t.personal_profile_id,
634                                 t.character_profile_id,
635                                 t.skill_title,
636                                 t.born_date,
637                                 t.played_time,
638                                 t.force_regen_rate,
639                                 t.force_power,
640                                 t.max_force_power,
641                                 t.active_quests,
642                                 t.completed_quests,
643                                 t.current_quest,
644                                 t.quests,
645                                 t.role_icon_choice,
646                                 t.quests2,
647                                 t.quests3,
648                                 t.quests4,
649                                 t.skill_template,
650                                 t.working_skill,
651                                 nvl(t.current_gcw_points,0),
652                                 nvl(t.current_gcw_rating,-1),
653                                 nvl(t.current_pvp_kills,0),
654                                 nvl(t.lifetime_gcw_points,0),
655                                 nvl(t.max_gcw_imperial_rating,-1),
656                                 nvl(t.max_gcw_rebel_rating,-1),
657                                 nvl(t.lifetime_pvp_kills,0),
658                                 nvl(t.next_gcw_rating_calc_time,0),
659                                 t.collections,
660                                 nvl(t.show_backpack,'Y'),
661                                 nvl(t.show_helmet,'Y'),
662                                 t.collections2
663                         from
664                                 object_list l,
665                                 player_objects t,
666                                 accounts a
667                         where t.station_id = a.station_id and
668                                 t.object_id=l.object_id;
670                 return result_cursor;
671         end;
672         
673         function load_resource_types return cursortype
674         as
675                 result_cursor cursortype;
676         begin
677                 open result_cursor for
678                         select
679                                 resource_id,
680                                 resource_name,
681                                 resource_class,
682                                 attributes,
683                                 fractal_seeds,
684                                 depleted_timestamp
685                         from
686                                 resource_types;
687                 
688                 return result_cursor;
689         end;
691         function load_bounty_hunter_targets return cursortype
692         as
693                 result_cursor cursortype;
694         begin
695                 open result_cursor for
696                         select object_id, target_id
697                         from bounty_hunter_targets
698                         where target_id <> 0;
699                 return result_cursor;
700         end;
702 -- GENERATED PLSQL FOLLOWS
703 -- generated by makeloader.pl
705         function load_battlefield_marker_object return cursortype
706         as
707                 result_cursor cursortype;
708         begin
709                 open result_cursor for
710                         select /*+ ORDERED USE_NL(T) */
711                                 t.object_id,
712                                 t.region_name
713                         from
714                                 object_list l,
715                                 battlefield_marker_objects t
716                         where
717                                 t.object_id=l.object_id;
719                 return result_cursor;
720         end;
722         function load_building_object   return cursortype
723         as
724                 result_cursor cursortype;
725         begin
726                 open result_cursor for
727                         select /*+ ORDERED USE_NL(T) */
728                                 t.object_id,
729                                 t.maintenance_cost,
730                                 t.time_last_checked,
731                                 t.is_public,
732                                 t.city_id
733                         from
734                                 object_list l,
735                                 building_objects t
736                         where
737                                 t.object_id=l.object_id;
739                 return result_cursor;
740         end;
742         function load_cell_object       return cursortype
743         as
744                 result_cursor cursortype;
745         begin
746                 open result_cursor for
747                         select /*+ ORDERED USE_NL(T) */
748                                 t.object_id,
749                                 t.cell_number,
750                                 t.is_public
751                         from
752                                 object_list l,
753                                 cell_objects t
754                         where
755                                 t.object_id=l.object_id;
757                 return result_cursor;
758         end;
760         function load_city_object       return cursortype
761         as
762                 result_cursor cursortype;
763         begin
764                 open result_cursor for
765                         select /*+ ORDERED USE_NL(T) */
766                                 t.object_id
767                         from
768                                 object_list l,
769                                 city_objects t
770                         where
771                                 t.object_id=l.object_id;
773                 return result_cursor;
774         end;
776         function load_creature_object   return cursortype
777         as
778                 result_cursor cursortype;
779         begin
780                 open result_cursor for
781                         select /*+ ORDERED USE_NL(T) */
782                                 t.object_id,
783                                 t.scale_factor,
784                                 t.states,
785                                 t.posture,
786                                 t.shock_wounds,
787                                 t.master_id,
788                                 t.rank,
789                                 t.base_walk_speed,
790                                 t.base_run_speed,
791                                 t.attribute_0,
792                                 t.attribute_1,
793                                 t.attribute_2,
794                                 t.attribute_3,
795                                 t.attribute_4,
796                                 t.attribute_5,
797                                 t.attribute_6,
798                                 t.attribute_7,
799                                 t.attribute_8,
800                                 t.attribute_9,
801                                 t.attribute_10,
802                                 t.attribute_11,
803                                 t.attribute_12,
804                                 t.attribute_13,
805                                 t.attribute_14,
806                                 t.attribute_15,
807                                 t.attribute_16,
808                                 t.attribute_17,
809                                 t.attribute_18,
810                                 t.attribute_19,
811                                 t.attribute_20,
812                                 t.attribute_21,
813                                 t.attribute_22,
814                                 t.attribute_23,
815                                 t.attribute_24,
816                                 t.attribute_25,
817                                 t.attribute_26,
818                                 t.persisted_buffs,
819                                 t.ws_x,
820                                 t.ws_y,
821                                 t.ws_z
822                         from
823                                 object_list l,
824                                 creature_objects t
825                         where
826                                 t.object_id=l.object_id;
828                 return result_cursor;
829         end;
831         function load_factory_object    return cursortype
832         as
833                 result_cursor cursortype;
834         begin
835                 open result_cursor for
836                         select /*+ ORDERED USE_NL(T) */
837                                 t.object_id
838                         from
839                                 object_list l,
840                                 factory_objects t
841                         where
842                                 t.object_id=l.object_id;
844                 return result_cursor;
845         end;
847         function load_guild_object      return cursortype
848         as
849                 result_cursor cursortype;
850         begin
851                 open result_cursor for
852                         select /*+ ORDERED USE_NL(T) */
853                                 t.object_id
854                         from
855                                 object_list l,
856                                 guild_objects t
857                         where
858                                 t.object_id=l.object_id;
860                 return result_cursor;
861         end;
863         function load_harvester_inst_object     return cursortype
864         as
865                 result_cursor cursortype;
866         begin
867                 open result_cursor for
868                         select /*+ ORDERED USE_NL(T) */
869                                 t.object_id,
870                                 t.installed_efficiency,
871                                 t.max_extraction_rate,
872                                 t.current_extraction_rate,
873                                 t.max_hopper_amount,
874                                 t.hopper_resource,
875                                 t.hopper_amount,
876                                 t.resource_type
877                         from
878                                 object_list l,
879                                 harvester_installation_objects t
880                         where
881                                 t.object_id=l.object_id;
883                 return result_cursor;
884         end;
886         function load_installation_object       return cursortype
887         as
888                 result_cursor cursortype;
889         begin
890                 open result_cursor for
891                         select /*+ ORDERED USE_NL(T) */
892                                 t.object_id,
893                                 t.installation_type,
894                                 t.activated,
895                                 t.tick_count,
896                                 t.activate_start_time,
897                                 t.power,
898                                 t.power_rate
899                         from
900                                 object_list l,
901                                 installation_objects t
902                         where
903                                 t.object_id=l.object_id;
905                 return result_cursor;
906         end;
908         function load_intangible_object return cursortype
909         as
910                 result_cursor cursortype;
911         begin
912                 open result_cursor for
913                         select /*+ ORDERED USE_NL(T) */
914                                 t.object_id,
915                                 t.count
916                         from
917                                 object_list l,
918                                 intangible_objects t
919                         where
920                                 t.object_id=l.object_id;
922                 return result_cursor;
923         end;
925         function load_manf_schematic_object     return cursortype
926         as
927                 result_cursor cursortype;
928         begin
929                 open result_cursor for
930                         select /*+ ORDERED USE_NL(T) */
931                                 t.object_id,
932                                 t.creator_id,
933                                 t.creator_name,
934                                 t.items_per_container,
935                                 t.manufacture_time,
936                                 t.draft_schematic
937                         from
938                                 object_list l,
939                                 manf_schematic_objects t
940                         where
941                                 t.object_id=l.object_id;
943                 return result_cursor;
944         end;
946         function load_manufacture_inst_object   return cursortype
947         as
948                 result_cursor cursortype;
949         begin
950                 open result_cursor for
951                         select /*+ ORDERED USE_NL(T) */
952                                 t.object_id
953                         from
954                                 object_list l,
955                                 manufacture_inst_objects t
956                         where
957                                 t.object_id=l.object_id;
959                 return result_cursor;
960         end;
962         function load_mission_object    return cursortype
963         as
964                 result_cursor cursortype;
965         begin
966                 open result_cursor for
967                         select /*+ ORDERED USE_NL(T) */
968                                 t.object_id,
969                                 t.difficulty,
970                                 t.end_x,
971                                 t.end_y,
972                                 t.end_z,
973                                 t.end_cell,
974                                 t.end_scene,
975                                 t.mission_creator,
976                                 t.reward,
977                                 t.root_script_name,
978                                 t.start_x,
979                                 t.start_y,
980                                 t.start_z,
981                                 t.start_cell,
982                                 t.start_scene,
983                                 t.description_table,
984                                 t.description_text,
985                                 t.title_table,
986                                 t.title_text,
987                                 t.mission_holder_id,
988                                 t.status,
989                                 t.mission_type,
990                                 t.target_appearance,
991                                 t.target_name
992                         from
993                                 object_list l,
994                                 mission_objects t
995                         where
996                                 t.object_id=l.object_id;
998                 return result_cursor;
999         end;
1001         function load_planet_object     return cursortype
1002         as
1003                 result_cursor cursortype;
1004         begin
1005                 open result_cursor for
1006                         select /*+ ORDERED USE_NL(T) */
1007                                 t.object_id,
1008                                 t.planet_name
1009                         from
1010                                 object_list l,
1011                                 planet_objects t
1012                         where
1013                                 t.object_id=l.object_id;
1015                 return result_cursor;
1016         end;
1018         function load_resource_container_object return cursortype
1019         as
1020                 result_cursor cursortype;
1021         begin
1022                 open result_cursor for
1023                         select /*+ ORDERED USE_NL(T) */
1024                                 t.object_id,
1025                                 t.resource_type,
1026                                 t.quantity,
1027                                 t.source
1028                         from
1029                                 object_list l,
1030                                 resource_container_objects t
1031                         where
1032                                 t.object_id=l.object_id;
1034                 return result_cursor;
1035         end;
1037         function load_ship_object       return cursortype
1038         as
1039                 result_cursor cursortype;
1040         begin
1041                 open result_cursor for
1042                         select /*+ ORDERED USE_NL(T) */
1043                                 t.object_id,
1044                                 t.slide_dampener,
1045                                 t.current_chassis_hit_points,
1046                                 t.maximum_chassis_hit_points,
1047                                 t.chassis_type,
1048                                 t.cmp_armor_hp_maximum,
1049                                 t.cmp_armor_hp_current,
1050                                 t.cmp_efficiency_general,
1051                                 t.cmp_efficiency_eng,
1052                                 t.cmp_eng_maintenance,
1053                                 t.cmp_mass,
1054                                 t.cmp_crc,
1055                                 t.cmp_hp_current,
1056                                 t.cmp_hp_maximum,
1057                                 t.cmp_flags,
1058                                 t.cmp_names,
1059                                 t.weapon_damage_maximum,
1060                                 t.weapon_damage_minimum,
1061                                 t.weapon_effectiveness_shields,
1062                                 t.weapon_effectiveness_armor,
1063                                 t.weapon_eng_per_shot,
1064                                 t.weapon_refire_rate,
1065                                 t.weapon_ammo_current,
1066                                 t.weapon_ammo_maximum,
1067                                 t.weapon_ammo_type,
1068                                 t.shield_hp_front_maximum,
1069                                 t.shield_hp_back_maximum,
1070                                 t.shield_recharge_rate,
1071                                 t.capacitor_eng_maximum,
1072                                 t.capacitor_eng_recharge_rate,
1073                                 t.engine_acc_rate,
1074                                 t.engine_deceleration_rate,
1075                                 t.engine_pitch_acc_rate,
1076                                 t.engine_yaw_acc_rate,
1077                                 t.engine_roll_acc_rate,
1078                                 t.engine_pitch_rate_maximum,
1079                                 t.engine_yaw_rate_maximum,
1080                                 t.engine_roll_rate_maximum,
1081                                 t.engine_speed_maximum,
1082                                 t.reactor_eng_generation_rate,
1083                                 t.booster_eng_maximum,
1084                                 t.booster_eng_recharge_rate,
1085                                 t.booster_eng_consumption_rate,
1086                                 t.booster_acc,
1087                                 t.booster_speed_maximum,
1088                                 t.droid_if_cmd_speed,
1089                                 t.installed_dcd,
1090                                 t.chassis_cmp_mass_maximum,
1091                                 t.cmp_creators,
1092                                 t.cargo_hold_contents_maximum,
1093                                 t.cargo_hold_contents_current,
1094                                 t.cargo_hold_contents
1095                         from
1096                                 object_list l,
1097                                 ship_objects t
1098                         where
1099                                 t.object_id=l.object_id;
1101                 return result_cursor;
1102         end;
1104         function load_static_object     return cursortype
1105         as
1106                 result_cursor cursortype;
1107         begin
1108                 open result_cursor for
1109                         select /*+ ORDERED USE_NL(T) */
1110                                 t.object_id
1111                         from
1112                                 object_list l,
1113                                 static_objects t
1114                         where
1115                                 t.object_id=l.object_id;
1117                 return result_cursor;
1118         end;
1120         function load_tangible_object   return cursortype
1121         as
1122                 result_cursor cursortype;
1123         begin
1124                 open result_cursor for
1125                         select /*+ ORDERED USE_NL(T) */
1126                                 t.object_id,
1127                                 t.max_hit_points,
1128                                 t.owner_id,
1129                                 t.visible,
1130                                 t.appearance_data,
1131                                 t.interest_radius,
1132                                 t.pvp_type,
1133                                 t.pvp_faction,
1134                                 t.damage_taken,
1135                                 t.custom_appearance,
1136                                 t.count,
1137                                 t.condition,
1138                                 t.creator_id,
1139                                 t.source_draft_schematic
1140                         from
1141                                 object_list l,
1142                                 tangible_objects t
1143                         where
1144                                 t.object_id=l.object_id;
1146                 return result_cursor;
1147         end;
1149         function load_token_object      return cursortype
1150         as
1151                 result_cursor cursortype;
1152         begin
1153                 open result_cursor for
1154                         select /*+ ORDERED USE_NL(T) */
1155                                 t.object_id,
1156                                 t.reference,
1157                                 t.target_server_template_name,
1158                                 t.target_shared_template_name,
1159                                 t.waypoint
1160                         from
1161                                 object_list l,
1162                                 token_objects t
1163                         where
1164                                 t.object_id=l.object_id;
1166                 return result_cursor;
1167         end;
1169         function load_universe_object   return cursortype
1170         as
1171                 result_cursor cursortype;
1172         begin
1173                 open result_cursor for
1174                         select /*+ ORDERED USE_NL(T) */
1175                                 t.object_id
1176                         from
1177                                 object_list l,
1178                                 universe_objects t
1179                         where
1180                                 t.object_id=l.object_id;
1182                 return result_cursor;
1183         end;
1185         function load_vehicle_object    return cursortype
1186         as
1187                 result_cursor cursortype;
1188         begin
1189                 open result_cursor for
1190                         select /*+ ORDERED USE_NL(T) */
1191                                 t.object_id,
1192                                 t.bogus
1193                         from
1194                                 object_list l,
1195                                 vehicle_objects t
1196                         where
1197                                 t.object_id=l.object_id;
1199                 return result_cursor;
1200         end;
1202         function load_weapon_object     return cursortype
1203         as
1204                 result_cursor cursortype;
1205         begin
1206                 open result_cursor for
1207                         select /*+ ORDERED USE_NL(T) */
1208                                 t.object_id,
1209                                 t.min_damage,
1210                                 t.max_damage,
1211                                 t.damage_type,
1212                                 t.elemental_type,
1213                                 t.elemental_value,
1214                                 t.attack_speed,
1215                                 t.wound_chance,
1216                                 t.accuracy,
1217                                 t.attack_cost,
1218                                 t.damage_radius,
1219                                 t.min_range,
1220                                 t.max_range
1221                         from
1222                                 object_list l,
1223                                 weapon_objects t
1224                         where
1225                                 t.object_id=l.object_id;
1227                 return result_cursor;
1228         end;
1229         
1231         function load_player_quest_object       return cursortype
1232         as
1233                 result_cursor cursortype;
1234         begin
1235                 open result_cursor for
1236                         select /*+ ORDERED USE_NL(T) */
1237                                 t.object_id,
1238                                 t.title,
1239                                 t.description,
1240                                 t.creator,
1241                                 t.total_tasks,
1242                                 t.difficulty,
1243                                 t.task_title1,
1244                                 t.task_description1,
1245                                 t.task_title2,
1246                                 t.task_description2,
1247                                 t.task_title3,
1248                                 t.task_description3,
1249                                 t.task_title4,
1250                                 t.task_description4,
1251                                 t.task_title5,
1252                                 t.task_description5,
1253                                 t.task_title6,
1254                                 t.task_description6,
1255                                 t.task_title7,
1256                                 t.task_description7,
1257                                 t.task_title8,
1258                                 t.task_description8,
1259                                 t.task_title9,
1260                                 t.task_description9,
1261                                 t.task_title10,
1262                                 t.task_description10,
1263                                 t.task_title11,
1264                                 t.task_description11,
1265                                 t.task_title12,
1266                                 t.task_description12
1267                         from
1268                                 object_list l,
1269                                 player_quest_objects t
1270                         where
1271                                 t.object_id=l.object_id;
1273                 return result_cursor;
1274         end;
1275 end;