M2 Docs
LuaFuncList

Enumerations

enum  eMakeItemArgs
 arg enum for pc.make_item0; 1: vnum or locale_name, 2: count; socket 1-2-3; (type, value)*7;
 
enum  eMakeItemType
 type enum for pc.make_item0
 
enum  MKGLD
 enum for pc.make_guild0 function
 

Functions

int32_t highscore_show (lua_State *L)
 it will send an INFO chat packet to the current player about his registered highscore filtered by [board_name] and [order] (only 0-1 for [order]) More...
 
int32_t highscore_register (lua_State *L)
 it will insert inside player.register a row containing [board_name] [value] [order] (only 0-1 for [order]) More...
 
int32_t member_chat (lua_State *L)
 it will send a TALKING chat packet containing [text] to the current player's party More...
 
int32_t member_clear_ready (lua_State *L)
 it will remove the affect DUNGEON_READY from the whole current player's party (unused) More...
 
int32_t member_set_ready (lua_State *L)
 it will set the affect DUNGEON_READY to the whole current player's party (unused) More...
 
int32_t mob_spawn (lua_State *L)
 it will spawn a mob [vnum] in [map_index] coordinates [local_x],[local_y] for [count] times, and if [is_aggressive]=true it will be aggressive More...
 
int32_t mob_spawn_group (lua_State *L)
 it will spawn a mob group [vnum] in [map_index] coordinates [local_x],[local_y] for [count] times, and if [is_aggressive]=true it will be aggressive More...
 
int32_t affect_add (lua_State *L)
 it will add to the current pc the affect with apply bonus [apply_type] with value [value] for [duration] seconds (affect id AFFECT_QUEST_START_IDX) More...
 
int32_t affect_remove (lua_State *L)
 it will remove from the current pc the affect with apply bonus [apply_type] (affect id AFFECT_QUEST_START_IDX+GetCurrentPC()->GetCurrentQuestIndex()) More...
 
int32_t affect_remove_bad (lua_State *L)
 it will remove from the current pc all the negative affects (skill debuffs, poison, bleeding, fire, stun, slow) More...
 
int32_t affect_remove_good (lua_State *L)
 it will remove from the current pc all the positive affects (skill buffs, potion buffs, firework buffs) More...
 
int32_t affect_add_hair (lua_State *L)
 it will add to the current pc the affect with apply bonus [apply_type] with value [hair_id] for [duration] seconds (affect id AFFECT_HAIR) More...
 
int32_t affect_remove_hair (lua_State *L)
 it will remove from the current pc the affect AFFECT_HAIR More...
 
int32_t affect_get_apply_on (lua_State *L)
 lua will return the apply_type of the specified [affect_type] (cube type affects will still return the first entry, not the whole list) More...
 
int32_t affect_add_collect (lua_State *L)
 it will add to the current pc the affect with apply bonus [apply_type] with value [value] for [duration] seconds (affect id AFFECT_COLLECT) More...
 
int32_t affect_add_collect_point (lua_State *L)
 it will add to the current pc the affect with point bonus [point_type] with value [value] for [duration] seconds (affect id AFFECT_COLLECT) More...
 
int32_t affect_remove_collect (lua_State *L)
 it will remove from the current pc the affect with apply bonus [apply_type] and value [value] (affect id AFFECT_COLLECT) More...
 
int32_t affect_remove_all_collect (lua_State *L)
 it will remove from the current pc all the AFFECT_COLLECT affects More...
 
int32_t arena_start_duel (lua_State *L)
 it will start the duel between you and player [name]. The first who will get [total_rounds] wins, will win. More...
 
int32_t arena_add_map (lua_State *L)
 it will add an arena location in [map_index]; player A will spawn at the coordinates [startposAX],[startposAY] and player B at [startposBX],[startposBY]
Note: the observer point (where you will be warped if you want to see the fight) will be (PosA+PosB)/2 More...
 
int32_t arena_get_duel_list (lua_State *L)
 lua will return the list of every arena duel More...
 
int32_t arena_add_observer (lua_State *L)
 the current player will be warped to the respective observer arena coordinates (you get them by using arena.get_duel_list) More...
 
int32_t arena_is_in_arena (lua_State *L)
 lua will return whether or not player [pid] is NOT in an arena map (must not be used for the contrary reason) More...
 
int32_t ba_start (lua_State *L)
 it will start the battle arena for the specific [empire] More...
 
int32_t building_get_land_id (lua_State *L)
 lua will return the id of the land in map [map_index] coordinates [map_x] [map_y] if found, otherwise 0 More...
 
int32_t building_get_land_info (lua_State *L)
 lua will return the info of the land [land_id] More...
 
int32_t building_set_land_owner (lua_State *L)
 it will set the guild owner of the land [land_id] to [guild_id] More...
 
int32_t building_has_land (lua_State *L)
 lua will return if the guild [guild_id] does NOT have a land (must not be used for the contrary reason) More...
 
int32_t building_reconstruct (lua_State *L)
 it will create or recreate the object [object_proto_id]'s npc and should only be used in the guild's land.
it will get the guild's id from the current npc and the land's id from the guild's id.
it will get the spawn coordinates from the object [object_proto_id]'s reg_1,reg_2 (initial x,y) reg_3,reg_4 (ending x,y) fields.
it's usually used for NPCs in the vnum range of 14000~14049, 20044~20046, 20060~20072 and 20077~20079. More...
 
int32_t dance_event_go_home (lua_State *L)
 it will warp back to village everyone inside the map index 115 in the coordinates startpos 764503~22807 endpos 772362~26499 More...
 
int32_t dl_startRaid (lua_State *L)
 it will start the dragon lair event in the current pc's map index for the current pc's guild id More...
 
int32_t ds_open_refine_window (lua_State *L)
 it will open the dragon soul refine window for the current pc More...
 
int32_t ds_give_qualification (lua_State *L)
 it will give the dragon soul qualification for the current pc More...
 
int32_t ds_is_qualified (lua_State *L)
 lua will return 1 if the current pc has the dragon soul qualification, 0 otherwise More...
 
int32_t dungeon_notice (lua_State *L)
 it will send a notice [text] inside the current dungeon More...
 
int32_t dungeon_set_quest_flag (lua_State *L)
 it will change the current quest's [flag_name] to [flag_value] from everyone inside the current dungeon More...
 
int32_t dungeon_set_flag (lua_State *L)
 it will change the current dungeon's flag [flag_name] to [flag_value] More...
 
int32_t dungeon_get_flag (lua_State *L)
 lua will return the current dungeon's flag [flag_name]'s value More...
 
int32_t dungeon_get_flag_from_map_index (lua_State *L)
 lua will return the dungeon [map_index]'s flag [flag_name]'s value More...
 
int32_t dungeon_get_map_index (lua_State *L)
 lua will return the current dungeon's map index More...
 
int32_t dungeon_regen_file (lua_State *L)
 it will read and spawn ONCE the regen file [regen_filename], respawn event NOT included, in the current dungeon More...
 
int32_t dungeon_set_regen_file (lua_State *L)
 it will read and spawn the regen file [regen_filename], respawn event included, in the current dungeon More...
 
int32_t dungeon_clear_regen (lua_State *L)
 it will clear any regen of the current dungeon More...
 
int32_t dungeon_check_eliminated (lua_State *L)
 it there will be 0 monsters in the current dungeon, it will check if an exit or warp condition has been set, and creates the relative event runned after n seconds (specified by d.set_exit/warp_all_at_eliminate) More...
 
int32_t dungeon_set_exit_all_at_eliminate (lua_State *L)
 it will set an exit all condition after [seconds] in the current dungeon; it's triggered by d.check_eliminated and only if there is no monster left. More...
 
int32_t dungeon_set_warp_at_eliminate (lua_State *L)
 it will set a warp all condition after [seconds] to map [map_index] coordinates [map_x] [map_y], inside the current dungeon;
it's triggered either by d.check_eliminated when there is no monster left or if [regen_filename] has been cleared More...
 
int32_t dungeon_new_jump (lua_State *L)
 it will create a new dungeon instance from map [map_index] and warp yourself to the generated map at [world_x] [world_y] coordinates More...
 
int32_t dungeon_new_jump_guild (lua_State *L)
 it will create a new dungeon instance from map [map_index] and warp you and every guild member of yours of your current map to the generated map at [world_x] [world_y] coordinates More...
 
int32_t dungeon_new_jump_all (lua_State *L)
 it will create a new dungeon instance from map [map_index] and warp you and everyone else of your current map to the generated map at [world_x] [world_y] coordinates More...
 
int32_t dungeon_new_jump_party (lua_State *L)
 it will create a new dungeon instance from map [map_index] and warp you and every party member of yours of your current map to the generated map at [world_x] [world_y] coordinates More...
 
int32_t dungeon_jump_all (lua_State *L)
 it will warp you and every party member of yours in the current dungeon at [world_x] [world_y] coordinates (no uiloading refresh) More...
 
int32_t dungeon_warp_all (lua_State *L)
 it will warp you and every party member of yours in the current dungeon at [world_x] [world_y] coordinates (there will be a uiloading refresh) More...
 
int32_t dungeon_get_kill_stone_count (lua_State *L)
 lua will return the count of every metin stone destroyed in the current dungeon
[unk1] and [unk2] are unused, but required, otherwise it will return 0 (two random numbers is enough) More...
 
int32_t dungeon_get_kill_mob_count (lua_State *L)
 lua will return the count of every monster destroyed in the current dungeon
[unk1] and [unk2] are unused, but required, otherwise it will return 0 (two random numbers is enough) More...
 
int32_t dungeon_is_use_potion (lua_State *L)
 lua will return false if you cannot use potions in the current dungeon, true otherwise (don't use it for the contrary reason)
[unk1] and [unk2] are unused, but required, otherwise it will return true (two random numbers is enough) More...
 
int32_t dungeon_revived (lua_State *L)
 lua will return false if you cannot be revived in the current dungeon, true otherwise (don't use it for the contrary reason)
[unk1] and [unk2] are unused, but required, otherwise it will return true (two random numbers is enough) More...
 
int32_t dungeon_set_dest (lua_State *L)
 it will move your current dungeon's party to the local [map_x] and [map_y] coordinates, no refresh (mostly client-side) More...
 
int32_t dungeon_unique_set_maxhp (lua_State *L)
 it will set the unique mob [unique_name]'s max hp to [max_hp] (in the current dungeon) More...
 
int32_t dungeon_unique_set_hp (lua_State *L)
 it will set the unique mob [unique_name]'s hp to [hp] (in the current dungeon) More...
 
int32_t dungeon_unique_set_def_grade (lua_State *L)
 it will set the unique mob [unique_name]'s def_grade to [def_grade] (in the current dungeon) More...
 
int32_t dungeon_unique_get_hp_perc (lua_State *L)
 lua will return the unique mob [unique_name]'s hp percent (in the current dungeon) More...
 
int32_t dungeon_is_unique_dead (lua_State *L)
 lua will return whether or not the unique mob [unique_name] dungeon is dead (in the current dungeon) More...
 
int32_t dungeon_purge_unique (lua_State *L)
 it will purge (destroy/make disappear) the unique mob [unique_name] (in the current dungeon) More...
 
int32_t dungeon_purge_area (lua_State *L)
 it will purge (destroy/make disappear) all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY] (in the current dungeon) More...
 
int32_t dungeon_kill_area (lua_State *L)
 it will kill all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY] (in the current dungeon) More...
 
int32_t dungeon_kill_unique (lua_State *L)
 it will kill the unique mob [unique_name] (in the current dungeon) More...
 
int32_t dungeon_spawn_stone_door (lua_State *L)
 it will spawn a stone door (vnum 13001) with the unique name [unique_name] in the area name [area_name] (in the current dungeon) More...
 
int32_t dungeon_spawn_wooden_door (lua_State *L)
 it will spawn a wooden door (vnum 13000) with the unique name [unique_name] in the area name [area_name] (in the current dungeon)
its hp/max_hp are hardcoded to 10000, and def grade to 300 (unique bonus) More...
 
int32_t dungeon_spawn_move_group (lua_State *L)
 it will spawn a monster group [group_id] in the area [pos_from],[pos_to] (in the current dungeon) More...
 
int32_t dungeon_spawn_move_unique (lua_State *L)
 it will spawn the monster [mob_vnum] with unique name [unique_name] in the area [pos_from],[pos_to] (in the current dungeon) More...
 
int32_t dungeon_spawn_unique (lua_State *L)
 it will spawn the monster [mob_vnum] with unique name [unique_name] in the area [area_name] (in the current dungeon) More...
 
int32_t dungeon_spawn (lua_State *L)
 it will spawn the monster [mob_vnum] in the area [area_name] (in the current dungeon) More...
 
int32_t dungeon_set_unique (lua_State *L)
 it will set to the monster [mob_vid] the unique name [unique_name] (in the current dungeon) More...
 
int32_t dungeon_get_damage_from_race (lua_State *L)
 lua will return the DamageRaceFlag of the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_get_damage_from_affect (lua_State *L)
 lua will return the list of any DamageAffectFlag of the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_set_damage_from_race (lua_State *L)
 it will append the DamageRaceFlag [damage_race_flag] to the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_set_damage_from_affect (lua_State *L)
 it will append the DamageAffectFlag [damage_affect_flag] to the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_unset_damage_from_race (lua_State *L)
 it will remove the DamageRaceFlag [damage_race_flag] from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_unset_damage_from_affect (lua_State *L)
 it will remove the DamageAffectFlag [damage_affect_flag] from the mob [mob_vid] More...
 
int32_t dungeon_reset_damage_from_race (lua_State *L)
 it will remove all the DamageRaceFlag from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_reset_damage_from_affect (lua_State *L)
 it will remove all the DamageAffectFlag from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func More...
 
int32_t dungeon_is_available0 (lua_State *L)
 lua will return true if the current dungeon is not nullptr, false otherwise More...
 
int32_t dungeon_get_unique_vid (lua_State *L)
 lua will return the vid of the specific [unique_name] monster (in the current dungeon) More...
 
int32_t dungeon_spawn_mob (lua_State *L)
 it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] (in the current dungeon)
if [radius] is specified, the spawn coordinates will be affect by a little
if [count] is specified, there will be spawned a total of [count] mobs instead of one, and the returned vid will be the one of the first spawned one More...
 
int32_t dungeon_spawn_mob_dir (lua_State *L)
 it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] and in the direction of [direction] (in the current dungeon) More...
 
int32_t dungeon_spawn_mob_ac_dir (lua_State *L)
 it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] and in the direction of [direction] (in the current dungeon)
the spawned monster will have no spawn effect More...
 
int32_t dungeon_spawn_goto_mob (lua_State *L)
 it will spawn a mob (vnum 20039) in the square range from [from_x][from_y] to [to_x][to_y] More...
 
int32_t dungeon_spawn_name_mob (lua_State *L)
 it will spawn a mob [mob_vnum] in [map_x][map_y] with the name [name] (mostly, for NPCs) More...
 
int32_t dungeon_spawn_group (lua_State *L)
 it will spawn the mob group [group_vnum] in [map_x][map_y] with radius [radius] and the aggressive flag as [is_aggressive] for [count] times
the [radius] isn't fundamental, even 0 for it is enough More...
 
int32_t dungeon_join (lua_State *L)
 it will create a dungeon in [map_index] and warp yourself (or your whole party if near) into it
this function is famous for being instable, use d.new_jump and d.new_jump_party altogether with party.is_party() instead More...
 
int32_t dungeon_exit (lua_State *L)
 it will warp yourself to the saved exit location (not specifically in the current dungeon) More...
 
int32_t dungeon_exit_all (lua_State *L)
 it will warp everyone to the saved exit location (in the current dungeon) More...
 
int32_t dungeon_say_diff_by_item_group (lua_State *L)
 it will show to everyone in the current dungeon the [can_proceed_text] say if individually they have at least one of the items of the [item_group_name] item group
otherwise they will get the [cannot_proceed_text] say and will be warped out of the current dungeon More...
 
int32_t dungeon_exit_all_by_item_group (lua_State *L)
 it will warp out everyone who doesn't have at least one of the items of the [item_group_name] item group (in the current dungeon) More...
 
int32_t dungeon_delete_item_in_item_group_from_all (lua_State *L)
 it will warp out everyone who doesn't have at least one of the items of the [item_group_name] item group (in the current dungeon) More...
 
int32_t dungeon_kill_all (lua_State *L)
 it will kill every monster in the current dungeon More...
 
int32_t dungeon_purge (lua_State *L)
 it will purge (destroy/make disappear) every monster in the current dungeon More...
 
int32_t dungeon_exit_all_to_start_position (lua_State *L)
 it will warp out everyone to the start position (in the current dungeon) More...
 
int32_t dungeon_count_monster (lua_State *L)
 lua will return the count of the monsters residing in the current dungeon More...
 
int32_t dungeon_select (lua_State *L)
 it will set the dungeon map [map_index] as the current dungeon More...
 
int32_t dungeon_find (lua_State *L)
 lua will return whether or not the dungeon map [map_index] has been found More...
 
int32_t dungeon_all_near_to (lua_State *L)
 it will warp everyone near the coordinates [map_x],[map_y] with a max distance of 30px More...
 
int32_t dungeon_set_warp_location (lua_State *L)
 it will set the warp location to map [map_index] in the coordinates [map_x],[map_y] More...
 
int32_t dungeon_set_item_group (lua_State *L)
 it will set the item group [item_group_name] with [total_count] elements and for each of them two additional [item_vnum],[item_count] arguments More...
 
int32_t dungeon_set_quest_flag2 (lua_State *L)
 it will change the [quest_name]'s [flag_name] to [flag_value] from everyone inside the current dungeon More...
 
int32_t forked_set_dead_count (lua_State *L)
 it will set the current player's dead count to the event flag's "threeway_war_dead_count" More...
 
int32_t forked_get_dead_count (lua_State *L)
 lua will return the current player's dead count (threeway event) More...
 
int32_t forked_init_kill_count_per_empire (lua_State *L)
 it will set the current player's empire's score to 0 (threeway event) More...
 
int32_t forked_init (lua_State *L)
 it will initialize the threeway event and choose a random event map More...
 
int32_t forked_sungzi_start_pos (lua_State *L)
 lua will return the initial position of the current player's empire's forked sungzi map More...
 
int32_t forked_pass_start_pos (lua_State *L)
 lua will return the initial position of the current player's empire's forked pass map More...
 
int32_t forked_sungzi_mapindex (lua_State *L)
 lua will return the map_index of the current player's empire's forked sungzi map More...
 
int32_t forked_pass_mapindex_by_empire (lua_State *L)
 lua will return the map_index of the empire [empire]'s forked pass map More...
 
int32_t forked_get_pass_path_my_empire (lua_State *L)
 lua will return the map_index of the current player's forked pass path map More...
 
int32_t forked_get_pass_path_by_empire (lua_State *L)
 lua will return the map_index of the empire [empire]'s forked pass path map More...
 
int32_t forked_is_forked_mapindex (lua_State *L)
 lua will return true if [map_index] is a threeway war map, false otherwise More...
 
int32_t forked_is_sungzi_mapindex (lua_State *L)
 lua will return true if [map_index] is a sungzi war map, false otherwise More...
 
int32_t forked_warp_all_in_map (lua_State *L)
 it will warp everyone from [from_map_index] to the (not necessarily threeway map) [to_map_index] in the coordinates [map_x][map_y] in [seconds] seconds More...
 
int32_t forked_is_registered_user (lua_State *L)
 lua will return true if the current player is a registered threeway user, otherwise false More...
 
int32_t forked_register_user (lua_State *L)
 it will register the current player as threeway user More...
 
int32_t forked_purge_all_monsters (lua_State *L)
 it will purge (destroy/make disappear) all the monsters in the threeway event More...
 
int32_t forked_get_kill_score0 (lua_State *L)
 lua will return the kill score of the specific [empire] (threeway event) More...
 
int32_t game_set_event_flag (lua_State *L)
 it will set the event name [event_name] with the value [event_value] More...
 
int32_t game_get_event_flag (lua_State *L)
 lua will return the event name [event_name]'s value More...
 
int32_t game_request_make_guild (lua_State *L)
 it will open the client-side guild make window More...
 
int32_t game_get_safebox_level (lua_State *L)
 lua will return the current player's safebox level More...
 
int32_t game_set_safebox_level (lua_State *L)
 it will set the current player's safebox level to [safebox_level More...
 
int32_t game_open_safebox (lua_State *L)
 it will open the current player's safebox login window More...
 
int32_t game_open_mall (lua_State *L)
 it will open the current player's mall (itemshop) login window More...
 
int32_t game_drop_item (lua_State *L)
 it will create an item [item_vnum] with count [count] on the ground beside the current player More...
 
int32_t game_drop_item_with_ownership (lua_State *L)
 it will create an item [item_vnum] with count [count] on the ground beside the current player
it will have the ownership set to the current player for [ownership_duration] seconds (10 if not specified) More...
 
int32_t game_drop_item_with_ownership_and_dice (lua_State *L)
 it will create an item [item_vnum] with count [count] on the ground beside the current player
it will have the ownership set to the current player for [ownership_duration] seconds (10 if not specified)
if the player has a party, the item will be rolled amongst them (check party.is_party() to be sure you're not giving it to the player alone) More...
 
int32_t game_web_mall (lua_State *L)
 it will open the current player's web mall (itemshop page) window More...
 
int32_t _get_locale (lua_State *L)
 lua will return the name of the locale More...
 
int32_t _number (lua_State *L)
 lua will return a random number between [min] and [max] More...
 
int32_t _time_to_str (lua_State *L)
 lua will return the asctime of [timestamp] More...
 
int32_t _say (lua_State *L)
 it will send a script packet containing [text] with a trailing "[ENTER]" to the current pc More...
 
int32_t _chat (lua_State *L)
 it will send a TALKING chat packet containing [text] to the current pc More...
 
int32_t _cmdchat (lua_State *L)
 it will send a COMMAND chat packet containing [text] to the current pc More...
 
int32_t _syschat (lua_State *L)
 it will send an INFO chat packet containing [text] to the current pc More...
 
int32_t _chat_in_map0 (lua_State *L)
 it will send a TALKING chat packet containing [text] to everyone in map [map_index] More...
 
int32_t _cmdchat_in_map0 (lua_State *L)
 it will send a COMMAND chat packet containing [text] to everyone in map [map_index] More...
 
int32_t _syschat_in_map0 (lua_State *L)
 it will send an INFO chat packet containing [text] to everyone in map [map_index] More...
 
int32_t _notice (lua_State *L)
 it will send a NOTICE chat packet containing [text] to the current pc More...
 
int32_t _left_image (lua_State *L)
 it will send a LEFTIMAGE script packet containing [text] to the current pc More...
 
int32_t _top_image (lua_State *L)
 it will send a LEFTIMAGE script packet containing [text] to the current pc More...
 
int32_t _set_skin (lua_State *L)
 it will set the quest skin as [skin_id] to the current pc (usually NOWINDOW, NORMAL, CINEMATIC, SCROLL) More...
 
int32_t _set_server_timer (lua_State *L)
 it will create a server_timer event [name] called ONCE in [time] seconds with an argument [arg] (usually the map index) More...
 
int32_t _set_server_loop_timer (lua_State *L)
 it will create a server_timer event [name] it will be runned and REPEATED every [time] seconds with an argument [arg] (usually the map index) More...
 
int32_t _clear_server_timer (lua_State *L)
 it will delete a server_timer event [name] with argument [arg] (usually the map index) More...
 
int32_t _set_named_loop_timer (lua_State *L)
 it will create a timer event [name] for the current player and it will be runned and REPEATED every [timer] seconds More...
 
int32_t _get_server_timer_arg (lua_State *L)
 lua will return the current server_timer's arg (usually the map index) More...
 
int32_t _set_timer (lua_State *L)
 it will create a timer event "" for the current player and it will be runned ONCE in [timer] seconds More...
 
int32_t _set_named_timer (lua_State *L)
 it will create a timer event [name] for the current player and it will be runned ONCE in [timer] seconds More...
 
int32_t _timer (lua_State *L)
 it will create a timer event [name] for the current player and it will be runned ONCE in [timer] seconds More...
 
int32_t _clear_named_timer (lua_State *L)
 it will delete a timer event [name] from the current player More...
 
int32_t _getnpcid (lua_State *L)
 lua will return the npc id from the [name] specified inside questnpc.txt More...
 
int32_t _is_test_server (lua_State *L)
 lua will return true if the config TEST_SERVER is true, false otherwise More...
 
int32_t _is_speed_server (lua_State *L)
 lua will return true if the config SPEED_SERVER is true, false otherwise More...
 
int32_t _raw_script (lua_State *L)
 it will send a script packet containing [text] to the current pc More...
 
int32_t _char_log (lua_State *L)
 it will send a char_log for the current player with what=[what], how=[how], hint=[hint]
char_log = a row of type CHARACTER in the database's table log.log More...
 
int32_t _item_log (lua_State *L)
 it will send an item_log for the current player about the item [item_id] with how=[how], hint=[hint]
it will send nothing if the item [item_id] is not found
item_log = a row of type ITEM in the database's table log.log More...
 
int32_t _syslog (lua_State *L)
 it will write a line [text] in the syslog file of the actual game core
if the [log_level] flag is higher than 0, this line will be added only if the test_server mode is active More...
 
int32_t _syserr (lua_State *L)
 it will write a line [text] in the syserr file of the actual game core More...
 
int32_t _syslog2 (lua_State *L)
 it will write a line [text] in the syslog file of the actual game core (server_timer safe)
if the [log_level] flag is higher than 0, this line will be added only if the test_server mode is active More...
 
int32_t _syserr2 (lua_State *L)
 it will write a line [text] in the syserr file of the actual game core (server_timer safe) More...
 
int32_t _set_bgm_volume_enable (lua_State *L)
 it will enable the bgm volume (required line in settings.lua) More...
 
int32_t _add_bgm_info (lua_State *L)
 it will enable the bgm [filename] for the map [map_index]
it will be played client-side when accessing the specified map
used mostly in settings.lua More...
 
int32_t _add_goto_info (lua_State *L)
 it will enable, for the specific player [empire], a /goto [name] location for [map_index] coordinates [world_x],[world_y] More...
 
int32_t _refine_pick (lua_State *L)
 it will refine the pickaxe in inventory position [item_cell] More...
 
int32_t _fish_real_refine_rod (lua_State *L)
 it will refine the fishrod in inventory position [item_cell] More...
 
int32_t _give_char_privilege (lua_State *L)
 it will set to player [pid] the priv type [type] with value [value] More...
 
int32_t _give_empire_privilege (lua_State *L)
 it will set to the empire [empire] the priv type [type] with value [value] for [time] seconds More...
 
int32_t _give_guild_privilege (lua_State *L)
 it will set to the guild [guild_id] the priv type [type] with value [value] for [time] seconds More...
 
int32_t _get_empire_privilege_string (lua_State *L)
 lua will return all the priv types of the specific [empire] as preformatted std::string text More...
 
int32_t _get_empire_privilege (lua_State *L)
 lua will return the priv type [type]'s value of the specific [empire] More...
 
int32_t _get_guild_privilege_string (lua_State *L)
 lua will return all the priv types of the specific [guild] as preformatted std::string text More...
 
int32_t _get_guildid_byname (lua_State *L)
 lua will return the id of the guild's [name] More...
 
int32_t _get_guild_privilege (lua_State *L)
 lua will return the priv type [type]'s value of the specific [guild] More...
 
int32_t _item_name (lua_State *L)
 lua will return the item [item_vnum]'s locale name More...
 
int32_t _mob_name (lua_State *L)
 lua will return the mob [mob_vnum]'s locale name More...
 
int32_t _mob_vnum (lua_State *L)
 lua will return the vnum of the mob's [mob_name] More...
 
int32_t _get_global_time (lua_State *L)
 lua will return the timestamp of the server More...
 
int32_t _get_channel_id (lua_State *L)
 lua will return the actual game core's CHANNEL value More...
 
int32_t _do_command (lua_State *L)
 it will make the current player send the specified [command] (gm level checked) More...
 
int32_t _find_pc (lua_State *L)
 lua will return the player [name]'s vid, 0 otherwise More...
 
int32_t _find_pc_cond (lua_State *L)
 lua will return the first player's vid having the level between [min_level]~[max_level] and job as [job_flag] More...
 
int32_t _find_npc_by_vnum (lua_State *L)
 lua will return the first npc [npc_vnum]'s vid More...
 
int32_t _set_quest_state (lua_State *L)
 it will set the quest [quest_name]'s state to [state_name] More...
 
int32_t _get_quest_state (lua_State *L)
 lua will return the quest [quest_name]'s state (the relative [quest_name].__status value) More...
 
int32_t _under_han (lua_State *L)
 lua will return whether or not [text] is a valid hangul std::string (korean alphabet) More...
 
int32_t _big_notice (lua_State *L)
 it will send a BIG_NOTICE chat packet containing [text] to the current pc More...
 
int32_t _big_notice_in_map (lua_State *L)
 it will send a BIG_NOTICE chat packet containing [text] to everyone in the current player's map More...
 
int32_t _big_notice_all (lua_State *L)
 it will send a BIG_NOTICE chat packet containing [text] to everyone More...
 
int32_t _notice_all (lua_State *L)
 it will send a BIG_NOTICE chat packet containing [text] to everyone More...
 
int32_t _warp_all_to_village (lua_State *L)
 it will warp everyone from map [LuaNumber] back to village in [time] seconds More...
 
int32_t _warp_to_village (lua_State *L)
 it will warp the current player back to village More...
 
int32_t _say_in_map (lua_State *L)
 it will send a script packet containing [text] with a trailing "[ENTER][DONE]" to everyone in map [map_index] More...
 
int32_t _kill_all_in_map (lua_State *L)
 it will kill every monster in map [map_index] More...
 
int32_t _regen_in_map (lua_State *L)
 it will load the regen file [filename] ONCE in map [map_index] More...
 
int32_t _enable_over9refine (lua_State *L)
 it will allow the refine from item [vnum_from] to item [vnum_to], used mostly in settings.lua More...
 
int32_t _add_ox_quiz (lua_State *L)
 it will add in the oxevent the quiz [quiz] having the answer [answer] by the level [level]
you can make different quiz lists based on different level; it's the same used to pick up questions with oxevent.quiz
the answer is simply true/false More...
 
int32_t _block_chat (lua_State *L)
 it will block the player [name]'s chat for [time] seconds
the [time] can also be a formatted std::string such as "7d 1h 25m 50s" (check parse_time_str in Utils.cpp) More...
 
int32_t _spawn_mob0 (lua_State *L)
 it will spawn a mob [vnum] in [map_index] coordinates [map_x],[map_y] More...
 
int32_t _spawn_mob (lua_State *L)
 it will spawn a mob [vnum] beside the current player for [count] times, and if [is_aggressive]=true it will be aggressive More...
 
int32_t _spawn_mob_in_map (lua_State *L)
 it will spawn a mob [vnum] in [map_index] coordinates [map_x],[map_y] for [count] times, and if [is_aggressive]=true it will be aggressive More...
 
int32_t _notice_in_map (lua_State *L)
 it will send a NOTICE chat packet containing [text] to everyone in the current player's map
if [big_font] is true, it will be a BIG_NOTICE chat packet instead More...
 
int32_t _get_locale_base_path (lua_State *L)
 lua will return the path of the loaded locale (e.g. locale/germany) More...
 
int32_t _purge_area (lua_State *L)
 it will purge (destroy/make disappear) all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY] More...
 
int32_t _warp_all_in_area_to_area (lua_State *L)
 it will warp everyone in the square range [FromStartPosX],[FromStartPosY] until [FromEndPosX],[FromEndPosY] to [ToStartPosX],[ToStartPosY] until [ToEndPosX],[ToEndPosY] More...
 
int32_t _get_special_item_group (lua_State *L)
 lua will return the list of every element of the relative special_item_group's [group_id] More...
 
int32_t _get_table_postfix (lua_State *L)
 lua will return the TABLE_POSTFIX value in the current game core's CONFIG ("" by default) More...
 
int32_t _mysql_direct_query (lua_State *L)
 it will send the mysql query [query]; default database: player More...
 
int32_t _mysql_escape_string (lua_State *L)
 lua will return the escaped std::string of the mysql query [query] More...
 
int32_t _mysql_password (lua_State *L)
 lua will return the hashed std::string of [password]
the password algorithm is: sha1(sha1_bin(password)) More...
 
int32_t _get_item_attr_norm_table (lua_State *L)
 lua will return the list of the fields in item_attr More...
 
int32_t _get_item_attr_rare_table (lua_State *L)
 lua will return the list of the fields in item_attr_rare More...
 
int32_t _map_allow_find (lua_State *L)
 lua will return whether or not this game core contains the map [map_index] (to be more precise, if it has been specified in the MAP_ALLOW game CONFIG) More...
 
int32_t guild_around_ranking_string (lua_State *L)
 lua will return a colored guild members' rank as say text of the current player's guild More...
 
int32_t guild_high_ranking_string (lua_State *L)
 lua will return a colored guild list' top rank as say text of the current player's guild More...
 
int32_t guild_get_ladder_point (lua_State *L)
 lua will return the current player's guild's ladder points (the guild rank points) More...
 
int32_t guild_get_rank (lua_State *L)
 lua will return the current player's guild's rank of the server More...
 
int32_t guild_is_war (lua_State *L)
 lua will return whether or not the current player's guild is in war against the guild [guild_id] More...
 
int32_t guild_name (lua_State *L)
 lua will return the guild [guild_id]'s name More...
 
int32_t guild_level (lua_State *L)
 lua will return the guild [guild_id]'s level More...
 
int32_t guild_war_enter (lua_State *L)
 you will join the war against guild [guild_id] More...
 
int32_t guild_get_any_war (lua_State *L)
 lua will return the opponent guild's id of the current player's guild More...
 
int32_t guild_get_name (lua_State *L)
 lua will return the guild [guild_id]'s name More...
 
int32_t guild_war_bet (lua_State *L)
 the current player will make a bet at the war [war_id] against the guild [guild_id] for [amount] yangs More...
 
int32_t guild_is_bet (lua_State *L)
 lua will return whether or not the current player made a bet at the war [war_id] More...
 
int32_t guild_get_warp_war_list (lua_State *L)
 lua will return the table of the available guild war lists More...
 
int32_t guild_get_reserve_war_table (lua_State *L)
 lua will return the table of the reserved guild wars More...
 
int32_t guild_get_member_count (lua_State *L)
 lua will return the count of how many people are present in the current player's guild More...
 
int32_t guild_change_master (lua_State *L)
 it will change the current player's guild master to player [name] More...
 
int32_t guild_change_master_with_limit (lua_State *L)
 it will change the current player's guild master to player [name]. More...
 
int32_t guild_get_id0 (lua_State *L)
 lua will return the current player's guild's id More...
 
int32_t guild_get_sp0 (lua_State *L)
 lua will return the current player's guild's spirit points More...
 
int32_t guild_get_maxsp0 (lua_State *L)
 lua will return the current player's guild's max spirit points More...
 
int32_t guild_get_money0 (lua_State *L)
 lua will return the current player's guild's money More...
 
int32_t guild_get_max_member0 (lua_State *L)
 lua will return the current player's guild's max allowed members More...
 
int32_t guild_get_total_member_level0 (lua_State *L)
 lua will return the current player's guild's average member level More...
 
int32_t guild_has_land0 (lua_State *L)
 lua will return whether or not the current player's guild has a land More...
 
int32_t guild_get_win_count0 (lua_State *L)
 lua will return the current player's guild's win count More...
 
int32_t guild_get_draw_count0 (lua_State *L)
 lua will return the current player's guild's draw count More...
 
int32_t guild_get_loss_count0 (lua_State *L)
 lua will return the current player's guild's loss count More...
 
int32_t guild_add_comment0 (lua_State *L)
 it will add a comment [comment] in the current player's guild's board (the author is current player's name) More...
 
int32_t guild_set_ladder_point0 (lua_State *L)
 it will set the current player's guild's ladder points to [ladder_point] More...
 
int32_t guild_get_skill_level0 (lua_State *L)
 lua will return the current player's guild's skill [skill_id]'s level More...
 
int32_t guild_set_skill_level0 (lua_State *L)
 it will set the current player's guild's skill [skill_id]'s value to [value] More...
 
int32_t guild_get_skill_point0 (lua_State *L)
 lua will return the current player's guild's skill points More...
 
int32_t guild_set_skill_point0 (lua_State *L)
 it will set the current player's guild's skill points to [value] More...
 
int32_t guild_get_exp_level0 (lua_State *L)
 lua will return the needed exp for levelling up a guild to level [level] More...
 
int32_t guild_offer_exp0 (lua_State *L)
 the current player will offer [exp] exp points to his guild More...
 
int32_t guild_give_exp0 (lua_State *L)
 it will give [exp] exp points to the current player's guild (it won't decrease the current player's exp) More...
 
int32_t horse_is_riding (lua_State *L)
 lua will return whether or not the current player is riding the horse More...
 
int32_t horse_is_summon (lua_State *L)
 lua will return whether or not the current player's horse is summoned More...
 
int32_t horse_ride (lua_State *L)
 the current player will ride the horse More...
 
int32_t horse_unride (lua_State *L)
 the current player will unride the horse More...
 
int32_t horse_summon (lua_State *L)
 the current player will summon the horse
if [from_afar]=true, it will be spawned from afar;
if [horse_vnum] is specified, the spawned horse's vnum will be [horse_vnum];
if [horse_name] is specified, the spawned horse's name will be [horse_name]; More...
 
int32_t horse_unsummon (lua_State *L)
 the current player will unsummon the horse More...
 
int32_t horse_is_mine (lua_State *L)
 lua will return true if the current npc is the current player's horse, false otherwise More...
 
int32_t horse_set_level (lua_State *L)
 the current player's horse level will be set to [level] More...
 
int32_t horse_get_level (lua_State *L)
 lua will return the current player's horse level More...
 
int32_t horse_advance (lua_State *L)
 the current player's horse level will be increased by one More...
 
int32_t horse_get_health (lua_State *L)
 lua will return the current player's horse health, 0 otherwise More...
 
int32_t horse_get_health_pct (lua_State *L)
 lua will return the current player's horse health as percentage, 0 otherwise More...
 
int32_t horse_get_stamina (lua_State *L)
 lua will return the current player's horse stamina, 0 otherwise More...
 
int32_t horse_get_stamina_pct (lua_State *L)
 lua will return the current player's horse stamina as percentage, 0 otherwise More...
 
int32_t horse_get_grade (lua_State *L)
 lua will return the current player's horse grade More...
 
int32_t horse_is_dead (lua_State *L)
 lua will return whether or not the current player's horse is dead (health<=0) More...
 
int32_t horse_revive (lua_State *L)
 the current player's horse will be revived More...
 
int32_t horse_feed (lua_State *L)
 the current player's horse will be fed More...
 
int32_t horse_set_name (lua_State *L)
 the current player's horse's name will be set to [name] More...
 
int32_t horse_get_name (lua_State *L)
 lua will return the current player's horse's name More...
 
int32_t horse_set_stat0 (lua_State *L)
 it will set the current player's horse health to [health] (max 50) and stamina to [stamina] (max 200) More...
 
int32_t item_get_cell (lua_State *L)
 it will return the current item's cell More...
 
int32_t item_select_cell (lua_State *L)
 the current item's will be set to the item in pos [cell] of the current player More...
 
int32_t item_select (lua_State *L)
 the current item's will be set to the item id [item_id] More...
 
int32_t item_get_id (lua_State *L)
 lua will return the current item's id More...
 
int32_t item_remove (lua_State *L)
 it will remove the current item More...
 
int32_t item_get_socket (lua_State *L)
 lua will return the value of the current item's socket [index] (from 0 to 2) More...
 
int32_t item_set_socket (lua_State *L)
 il will set the value of the current item's socket [index] to [value] More...
 
int32_t item_get_vnum (lua_State *L)
 lua will return the vnum of the current item More...
 
int32_t item_has_flag (lua_State *L)
 lua will return whether or not the current item has the flag's value [value] More...
 
int32_t item_get_value (lua_State *L)
 lua will return the value in pos [index] of the current item More...
 
int32_t item_set_value (lua_State *L)
 it will set the value in pos [index] to [value] of the current item More...
 
int32_t item_get_name (lua_State *L)
 lua will return the name of the current item More...
 
int32_t item_get_size (lua_State *L)
 lua will return the size of the current item More...
 
int32_t item_get_count (lua_State *L)
 lua will return the count of the current item More...
 
int32_t item_get_type (lua_State *L)
 lua will return the type of the current item More...
 
int32_t item_get_sub_type (lua_State *L)
 lua will return the subtype of the current item More...
 
int32_t item_get_refine_vnum (lua_State *L)
 lua will return the refine vnum of the current item More...
 
int32_t item_next_refine_vnum (lua_State *L)
 lua will return the refine vnum of the item [vnum] More...
 
int32_t item_get_level (lua_State *L)
 lua will return the refine level of the current item More...
 
int32_t item_can_over9refine (lua_State *L)
 lua will return whether or not the current item has been added by enable_over9refine More...
 
int32_t item_change_to_over9 (lua_State *L)
 it will refine the current item to its relative over9 refine, if present (by enable_over9refine) More...
 
int32_t item_over9refine (lua_State *L)
 it will refine the current item to its relative refine, if present (by enable_over9refine) More...
 
int32_t item_get_over9_material_vnum (lua_State *L)
 lua will return the material vnum of the item [vnum] More...
 
int32_t item_get_level_limit (lua_State *L)
 lua will return the level limit of the current item More...
 
int32_t item_start_realtime_expire (lua_State *L)
 it will start the real time expire event for the current item (useless) More...
 
int32_t item_copy_and_give_before_remove (lua_State *L)
 it will copy and replace the current item to a new one by vnum [vnum] More...
 
int32_t item_get_wearflag0 (lua_State *L)
 lua will return the current item's wear flag More...
 
int32_t item_has_wearflag0 (lua_State *L)
 lua will return whether or not the current item has the wear flag's value [value] More...
 
int32_t item_get_antiflag0 (lua_State *L)
 lua will return the current item's anti flag More...
 
int32_t item_has_antiflag0 (lua_State *L)
 lua will return whether or not the current item has the anti flag's value [value] More...
 
int32_t item_get_immuneflag0 (lua_State *L)
 lua will return the current item's immune flag More...
 
int32_t item_has_immuneflag0 (lua_State *L)
 lua will return whether or not the current item has the immune flag's value [value] More...
 
int32_t item_add_attr0 (lua_State *L)
 it will add a bonus to the current item based on the specific [mode]
if [mode]=0, it will add a normal and a rare bonus;
if [mode]=1, it will add a normal bonus;
if [mode]=2, it will add a rare bonus; More...
 
int32_t item_change_attr0 (lua_State *L)
 it will change the bonuses to the current item based on the specific [mode]
if [mode]=0, it will switch both normal and rare bonuses;
if [mode]=1, it will switch the normal bonuses;
if [mode]=2, it will switch the rare bonuses; More...
 
int32_t item_clear_attr0 (lua_State *L)
 it will clear the bonuses to the current item based on the specific [mode]
if [mode]=0, it will clear both normal and rare bonuses;
if [mode]=1, it will clear the normal bonuses;
if [mode]=2, it will clear the rare bonuses; More...
 
int32_t item_count_attr0 (lua_State *L)
 lua will return the count of the bonuses to the current item based on the specific [mode] More...
 
int32_t item_get_attr0 (lua_State *L)
 lua will return the list of all the bonuses of the current items More...
 
int32_t item_set_attr0 (lua_State *L)
 it will set the current item's attr bonuses with the list of parameters [id1~7] to [value1~7] More...
 
int32_t item_set_count0 (lua_State *L)
 it will set the current item's count to [count] More...
 
int32_t item_is_available0 (lua_State *L)
 lua will return whether or not there's a current item More...
 
int32_t marriage_engage_to (lua_State *L)
 it will make an engagement request between the current player and the player [vid] More...
 
int32_t marriage_remove (lua_State *L)
 it will remove the current player's engagement request More...
 
int32_t marriage_set_to_marriage (lua_State *L)
 it will make the current player and the requested one engaged More...
 
int32_t marriage_find_married_vid (lua_State *L)
 lua will return the current player's married player's vid More...
 
int32_t marriage_get_wedding_list (lua_State *L)
 lua will return the table of the available weddings More...
 
int32_t marriage_join_wedding (lua_State *L)
 the current player will join the wedding between player [pid1] and [pid2] More...
 
int32_t marriage_warp_to_my_marriage_map (lua_State *L)
 the current player will warp to his/her wedding map More...
 
int32_t marriage_end_wedding (lua_State *L)
 the current player's wedding will be terminated More...
 
int32_t marriage_wedding_dark (lua_State *L)
 the current player's wedding's environment will be set to dark if [to_dark] is true, day otherwise More...
 
int32_t marriage_wedding_client_command (lua_State *L)
 everyone in the current player's wedding will get a COMMAND script packet [command] More...
 
int32_t marriage_wedding_is_playing_music (lua_State *L)
 lua will return whether or not in the current player's wedding the wedding music is in play More...
 
int32_t marriage_wedding_music (lua_State *L)
 the current player's wedding's music [filename] will be set to play if [to_play] is true, stopped otherwise More...
 
int32_t marriage_wedding_snow (lua_State *L)
 the current player's wedding's weather will be set to snow if [to_snow] is true, normal otherwise More...
 
int32_t marriage_in_my_wedding (lua_State *L)
 lua will return whether or not the current player is in his/her wedding map More...
 
int32_t marriage_get_married_time (lua_State *L)
 lua will return the timestamp of how long the current player is married More...
 
int32_t mgmt_monarch_state (lua_State *L)
 lua will return the info of the empire [empire]'s monarch More...
 
int32_t mgmt_monarch_change_lord (lua_State *L)
 it will change the empire [empire]'s monarch with player [pid] More...
 
int32_t takemonarchmoney (lua_State *L)
 if the current player is monarch, it will make the player retrieve the relative empire's money by [money] More...
 
int32_t is_guild_master (lua_State *L)
 lua will return whether or not the current player is guild master (duplicate function) More...
 
int32_t monarch_bless (lua_State *L)
 if the current player is monarch or gm, for 2kk empire's money he can full heal his own empire's players More...
 
int32_t monarch_powerup (lua_State *L)
 if the current player is monarch or gm, for 5kk empire's money he can power up his own empire's players More...
 
int32_t monarch_defenseup (lua_State *L)
 if the current player is monarch or gm, for 5kk yangs he can defense up his own empire's players More...
 
int32_t is_monarch (lua_State *L)
 lua will returh whether or not the current player is monarch More...
 
int32_t spawn_mob (lua_State *L)
 if the current player is a monarch, it will spawn the mob [mob_vnum]
in the commented code: if the spawned mob would have been the castle frog (vnum 11505), it will have been spawned in the relative empire castle for 100kk empire's money More...
 
int32_t spawn_guard (lua_State *L)
 if the current player is a monarch, it will spawn the mob group [group_vnum] for 10~100kk empire's money
the cost is based on the [group_vnum] range: 9501~2,9511~2,9521~2=10kk; 9503~4,9513~4,9523~4=30kk; 9505~6,9515~6,9525~6=100kk;
the [region_index] is 0 north, 1 east, 2 west, 3 south More...
 
int32_t frog_to_empire_money (lua_State *L)
 if the current player is a monarch, it will spawn the castle frog (vnum 11505) in the relative empire castle for 100kk empire's money More...
 
int32_t monarch_warp (lua_State *L)
 if the current player is a monarch, he will warp to the player [name] for 10k empire's money, and only if of the same empire More...
 
int32_t empire_info (lua_State *L)
 if the current player is a monarch, it will print to him the relative empire's money More...
 
int32_t monarch_transfer (lua_State *L)
 if the current player is a monarch, the player [name] will be warped to him for 10k empire's money, and only if of the same empire More...
 
int32_t monarch_notice (lua_State *L)
 if the current player is a monarch, it will send a message [text] to the relative empire More...
 
int32_t monarch_mob (lua_State *L)
 if the current player is a monarch, it will spawn the relative mob [mob_vnum] for 5kk empire's money More...
 
int32_t monarch_transfer2 (lua_State *L)
 if the current player is a monarch, the player [name] will be warped to him for 10k empire's money, and only if of the same empire More...
 
int32_t npc_open_shop (lua_State *L)
 it will open the npc's shop id [shop_vnum] More...
 
int32_t npc_is_pc (lua_State *L)
 lua will return whether or not the current npc is a pc More...
 
int32_t npc_get_empire (lua_State *L)
 lua will return the current npc's empire More...
 
int32_t npc_get_race (lua_State *L)
 lua will return the current npc's race More...
 
int32_t npc_get_guild (lua_State *L)
 lua will return the current npc's guild id More...
 
int32_t npc_get_remain_skill_book_count (lua_State *L)
 if the npc is the santa (vnum 20031), lua will return its relative att grade bonus More...
 
int32_t npc_dec_remain_skill_book_count (lua_State *L)
 if the npc is the santa (vnum 20031), the current npc's att grade bonus will be decreased by 1 More...
 
int32_t npc_get_remain_hairdye_count (lua_State *L)
 if the npc is the santa (vnum 20031), lua will return its relative def grade bonus More...
 
int32_t npc_dec_remain_hairdye_count (lua_State *L)
 if the npc is the santa (vnum 20031), the current npc's def grade bonus will be decreased by 1 More...
 
int32_t npc_is_quest (lua_State *L)
 lua will return whether or not the current npc is of the current quest More...
 
int32_t npc_kill (lua_State *L)
 it will kill the current npc More...
 
int32_t npc_purge (lua_State *L)
 it will purge (destroy/make disappear) the current npc More...
 
int32_t npc_is_near (lua_State *L)
 lua will return whether or not the current npc is near the current pc More...
 
int32_t npc_is_near_vid (lua_State *L)
 lua will return whether or not the current npc is near the pc [vid] More...
 
int32_t npc_unlock (lua_State *L)
 it will unlock the current npc that was unclickable by npc.lock More...
 
int32_t npc_lock (lua_State *L)
 it will block the current npc making it unclickable until npc.unlock is used More...
 
int32_t npc_get_leader_vid (lua_State *L)
 lua will return the current npc's group's leader vid More...
 
int32_t npc_get_vid (lua_State *L)
 lua will return the current npc's vid More...
 
int32_t npc_get_vid_attack_mul (lua_State *L)
 lua will return the npc [vid]'s attack multiply More...
 
int32_t npc_set_vid_attack_mul (lua_State *L)
 it will set the npc [vid]'s attack multiply to [value] More...
 
int32_t npc_get_vid_damage_mul (lua_State *L)
 lua will return the npc [vid]'s damage multiply More...
 
int32_t npc_set_vid_damage_mul (lua_State *L)
 it will set the npc [vid]'s damage multiply to [value] More...
 
int32_t npc_get_level0 (lua_State *L)
 lua will return the npc's level More...
 
int32_t npc_get_name0 (lua_State *L)
 lua will return the npc's name More...
 
int32_t npc_get_pid0 (lua_State *L)
 lua will return the npc's pid More...
 
int32_t npc_get_vnum0 (lua_State *L)
 lua will return the npc's vnum More...
 
int32_t npc_is_available0 (lua_State *L)
 lua will return whether or not there is a current npc More...
 
int32_t oxevent_get_status (lua_State *L)
 lua will return the oxevent status More...
 
int32_t oxevent_get_oxquiz_fn (lua_State *L)
 lua will return the oxquiz file name (locale_path+"oxquiz.lua" by default) More...
 
int32_t oxevent_set_oxquiz_fn (lua_State *L)
 it will set the oxquiz file name as locale_path+[filename] More...
 
int32_t oxevent_set_oxquiz_fn0 (lua_State *L)
 it will set the oxquiz file name as [filename] More...
 
int32_t oxevent_open (lua_State *L)
 it will read the oxquiz file and set the oxevent status as OXEVENT_OPEN More...
 
int32_t oxevent_close (lua_State *L)
 it will set the oxevent status as OXEVENT_CLOSE More...
 
int32_t oxevent_quiz (lua_State *L)
 it will pick up an oxquiz question with level=[level] and make the announcement
the answer will be given after [timeout] seconds More...
 
int32_t oxevent_get_attender (lua_State *L)
 lua will return the count of the remaining oxevent's partecipants (no observers) More...
 
int32_t oxevent_end_event (lua_State *L)
 it will stop the oxevent within 5 seconds and set its status to OXEVENT_FINISH More...
 
int32_t oxevent_end_event_force (lua_State *L)
 it will stop the oxevent and set its status to OXEVENT_FINISH More...
 
int32_t oxevent_give_item (lua_State *L)
 it will give to every remaining oxevent's partecipants (no observers) More...
 
int32_t party_clear_ready (lua_State *L)
 it clears the AFFECT_DUNGEON_READY affect from each near member More...
 
int32_t party_get_max_level (lua_State *L)
 lua will return the higher level of the party More...
 
int32_t party_get_min_level (lua_State *L)
 lua will return the lower level of the party More...
 
int32_t party_leave_party (lua_State *L)
 the current pc leaves the party, and lua will return whether it succeeded or not More...
 
int32_t party_delete_party (lua_State *L)
 the current pc deletes the party if the current pc is leader, and lua will return whether it succeeded or not More...
 
int32_t party_run_cinematic (lua_State *L)
 it sends a RUN_CINEMA [str] script to all the near members More...
 
int32_t party_show_cinematic (lua_State *L)
 it sends a CINEMATIC [str] packet script to all the near members More...
 
int32_t party_get_near_count (lua_State *L)
 lua will return the count of near members More...
 
int32_t party_syschat (lua_State *L)
 it will send a syschat [s] message to any online member More...
 
int32_t party_is_leader (lua_State *L)
 lua will return true if pc is the leader, otherwise false More...
 
int32_t party_is_party (lua_State *L)
 lua will return true if pc is in a party, otherwise false More...
 
int32_t party_get_leader_pid (lua_State *L)
 lua will return the pid of the party's leader, otherwise -1 More...
 
int32_t party_chat (lua_State *L)
 it will send a chat [s] message to any online member More...
 
int32_t party_is_map_member_flag_lt (lua_State *L)
 lua will return whether or not [value] is higher than the party flag [flagname] for each member More...
 
int32_t party_set_flag (lua_State *L)
 each party member will have the party flag [flagname] set as [value] More...
 
int32_t party_get_flag (lua_State *L)
 lua will return the value of the party flag [flagname] More...
 
int32_t party_set_quest_flag (lua_State *L)
 each party member will have the quest flag [flagname] set as [value] More...
 
int32_t party_is_in_dungeon (lua_State *L)
 lua will return whether or not the party is in dungeon More...
 
int32_t party_give_buff (lua_State *L)
 it will give the relative buff to the every party member in the current pc map, and lua will return whether or not the buff has been given More...
 
int32_t party_get_member_pids (lua_State *L)
 lua will return a list of every online party member's pid present in the same map of the current pc More...
 
int32_t pc_has_master_skill (lua_State *L)
 lua will return whether or not the current player's skill [skill_id] is at least master or higher (lvl 21 or above) More...
 
int32_t pc_remove_skill_book_no_delay (lua_State *L)
 it will remove the affect SKILL_NO_BOOK_DELAY from the current player More...
 
int32_t pc_is_skill_book_no_delay (lua_State *L)
 lua will return whether or not the current player has the affect SKILL_NO_BOOK_DELAY More...
 
int32_t pc_learn_grand_master_skill (lua_State *L)
 it will increase the grand master skill [skill_id] of the current player if learnable More...
 
int32_t pc_set_warp_location (lua_State *L)
 it will set the warp location of the current player to map [map_index] in the coordinates [world_x] and [world_y] More...
 
int32_t pc_set_warp_location_local (lua_State *L)
 it will set the warp location of the current player to map [map_index] in the coordinates [local_x] and [local_y] More...
 
int32_t pc_get_start_location (lua_State *L)
 lua will return the start location of the current player's empire More...
 
int32_t pc_warp (lua_State *L)
 it will warp the current player to map [map_index] in the coordinates [world_x] and [world_y] More...
 
int32_t pc_warp_local (lua_State *L)
 it will warp the current player to map [map_index] in the coordinates [local_x] and [local_y] More...
 
int32_t pc_warp_exit (lua_State *L)
 it will warp the current player to the previous saved location (like by pc.save_exit_location) More...
 
int32_t pc_in_dungeon (lua_State *L)
 lua will return whether or not the current player is in a dungeon More...
 
int32_t pc_hasguild (lua_State *L)
 lua will return whether or not the current player is in a guild More...
 
int32_t pc_getguild (lua_State *L)
 lua will return the current player's guild id More...
 
int32_t pc_isguildmaster (lua_State *L)
 lua will return whether or not the current player is guild master More...
 
int32_t pc_destroy_guild (lua_State *L)
 it will destroy the current player's guild if guild master More...
 
int32_t pc_remove_from_guild (lua_State *L)
 it will remove the current player from the guild More...
 
int32_t pc_give_gold (lua_State *L)
 it will give to the current player [amount] yangs More...
 
int32_t pc_warp_to_guild_war_observer_position (lua_State *L)
 it will warp the current player in the guild war between [guild_id1] and [guild_id2] as observer More...
 
int32_t pc_give_item_from_special_item_group (lua_State *L)
 it will give to the current player the item by special_item_group [special_item_group_id]
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it More...
 
int32_t pc_enough_inventory (lua_State *L)
 lua will return whether or not the current player has enough space in the inventory to store the item [item_vnum] More...
 
int32_t pc_give_item (lua_State *L)
 it will give to the current player the item by name|vnum [item_name] with count [count] only if the current quest's flag [flag_name] is NOT set (probably, to prevent duplicated rewards)
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it More...
 
int32_t pc_give_or_drop_item (lua_State *L)
 it will give to the current player the item by name|vnum [item_name] with count [count]
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it More...
 
int32_t pc_give_or_drop_item_with_dice (lua_State *L)
 it will give to the current player the item by name|vnum [item_name] with count [count] in dice mode
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it
dice mode = it will be given to a random party member if the current player is in party, otherwise it will be given to the current player More...
 
int32_t pc_give_or_drop_item_and_select (lua_State *L)
 it will give to the current player the item by name|vnum [item_name] with count [count], and, if succeeded, the item will become the new current item
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it More...
 
int32_t pc_get_current_map_index (lua_State *L)
 lua will return the current player's map index More...
 
int32_t pc_get_x (lua_State *L)
 lua will return the current player's world map x More...
 
int32_t pc_get_y (lua_State *L)
 lua will return the current player's world map y More...
 
int32_t pc_get_local_x (lua_State *L)
 lua will return the current player's local map x More...
 
int32_t pc_get_local_y (lua_State *L)
 lua will return the current player's local map y More...
 
int32_t pc_count_item (lua_State *L)
 lua will return the count of the item by name|vnum [item_name] from the whole current player's inventory More...
 
int32_t pc_remove_item (lua_State *L)
 it will remove the first item found by name|vnum [item_name], and, if [count] is specified, it will remove only [count] unities instead of all More...
 
int32_t pc_get_leadership (lua_State *L)
 lua will return the current player's leadership subskill's level More...
 
int32_t pc_reset_point (lua_State *L)
 it will reset the current player's status points More...
 
int32_t pc_get_playtime (lua_State *L)
 lua will return the current player's playtime More...
 
int32_t pc_get_vid (lua_State *L)
 lua will return the current player's vid More...
 
int32_t pc_get_name (lua_State *L)
 lua will return the current player's name More...
 
int32_t pc_get_next_exp (lua_State *L)
 lua will return the current player's next exp More...
 
int32_t pc_get_exp (lua_State *L)
 lua will return the current player's exp More...
 
int32_t pc_get_race (lua_State *L)
 lua will return the current player's race More...
 
int32_t pc_change_sex (lua_State *L)
 it will switch the current player's sex More...
 
int32_t pc_get_job (lua_State *L)
 lua will return the current player's job More...
 
int32_t pc_get_max_sp (lua_State *L)
 lua will return the current player's max sp More...
 
int32_t pc_get_sp (lua_State *L)
 lua will return the current player's sp More...
 
int32_t pc_change_sp (lua_State *L)
 it will set the current player's sp to [amount] More...
 
int32_t pc_get_max_hp (lua_State *L)
 lua will return the current player's max hp More...
 
int32_t pc_get_hp (lua_State *L)
 lua will return the current player's hp More...
 
int32_t pc_get_level (lua_State *L)
 lua will return the current player's level More...
 
int32_t pc_set_level (lua_State *L)
 it will set the current player's level to [level] More...
 
int32_t pc_get_weapon (lua_State *L)
 lua will return the current player's wear weapon's vnum More...
 
int32_t pc_get_armor (lua_State *L)
 lua will return the current player's wear armor's vnum More...
 
int32_t pc_get_wear (lua_State *L)
 lua will return the current player's wear in pos [cell]'s vnum More...
 
int32_t pc_get_money (lua_State *L)
 lua will return the current player's yangs More...
 
int32_t pc_get_real_alignment (lua_State *L)
 lua will return the current player's real_alignment More...
 
int32_t pc_get_alignment (lua_State *L)
 lua will return the current player's alignment More...
 
int32_t pc_change_alignment (lua_State *L)
 it will change the current player's alignment to [amount] (increase or decrease) More...
 
int32_t pc_change_money (lua_State *L)
 it will change the current player's yangs to [amount] (increase or decrease) More...
 
int32_t pc_set_another_quest_flag (lua_State *L)
 it will set the current player's quest [questname]'s flag [flagname]'s value to [value] More...
 
int32_t pc_get_another_quest_flag (lua_State *L)
 lua will return the current player's quest [questname]'s flag [flagname]'s value More...
 
int32_t pc_get_flag (lua_State *L)
 lua will return the current player's quest flag [questandflag]'s value (it must be as "quest.flag") More...
 
int32_t pc_get_quest_flag (lua_State *L)
 lua will return the current player's quest flag GetCurrentQuestName()".[flagname]"'s value More...
 
int32_t pc_set_flag (lua_State *L)
 it will set the current player's quest flag [questandflag]'s value (it must be as "quest.flag") to [value] More...
 
int32_t pc_set_quest_flag (lua_State *L)
 it will set the current player's quest flag GetCurrentQuestName()".[flagname]"'s value to [value] More...
 
int32_t pc_del_quest_flag (lua_State *L)
 it will delete from the current player the quest flag GetCurrentQuestName()".[flagname]" More...
 
int32_t pc_give_exp2 (lua_State *L)
 it will give to player [name] [exp] exp points (via point change) More...
 
int32_t pc_give_exp (lua_State *L)
 it will give to player [name] [exp] exp points More...
 
int32_t pc_give_exp_perc (lua_State *L)
 it will give to player [name] just [perc] percent of the exp required for the level [level] More...
 
int32_t pc_get_empire (lua_State *L)
 lua will return the current player's empire More...
 
int32_t pc_get_part (lua_State *L)
 lua will return the current player's part [part_id] More...
 
int32_t pc_set_part (lua_State *L)
 it will set the current player's part [part_id] to [value] More...
 
int32_t pc_get_skillgroup (lua_State *L)
 lua will return the current player's skill group More...
 
int32_t pc_set_skillgroup (lua_State *L)
 it will set the current player's skill group to [skillgroup_id] (0: none, 1: first, 2: second) More...
 
int32_t pc_is_polymorphed (lua_State *L)
 lua will return whether or not the current player is polymorphed More...
 
int32_t pc_remove_polymorph (lua_State *L)
 it will remove the polymorph from current player More...
 
int32_t pc_polymorph (lua_State *L)
 it will polymorph the current player into [vnum] for [duration] seconds More...
 
int32_t pc_is_mount (lua_State *L)
 lua will return whether or not the current player is mounting More...
 
int32_t pc_mount (lua_State *L)
 the current player will mount [mount_vnum] (as affect MOUNT) until [duration] timestamp More...
 
int32_t pc_mount_bonus (lua_State *L)
 it will add the affect MOUNT_BONUS to the current player with apply bonus [apply_id] set to [value] until [duration] timestamp More...
 
int32_t pc_unmount (lua_State *L)
 it will unride the current player's horse More...
 
int32_t pc_get_horse_level (lua_State *L)
 lua will return the current player's horse's level More...
 
int32_t pc_get_horse_hp (lua_State *L)
 lua will return the current player's horse's health More...
 
int32_t pc_get_horse_stamina (lua_State *L)
 lua will return the current player's horse's stamina More...
 
int32_t pc_is_horse_alive (lua_State *L)
 lua will return whether the current player's horse is alive (health > 0) More...
 
int32_t pc_revive_horse (lua_State *L)
 it will revive the current player's horse More...
 
int32_t pc_have_map_scroll (lua_State *L)
 lua will return whether or not the current player has any location scroll for the map [map_name] More...
 
int32_t pc_get_war_map (lua_State *L)
 lua will return the current player's guild war map's index More...
 
int32_t pc_have_pos_scroll (lua_State *L)
 lua will return whether or not the current player has any location scroll for the coordinates [world_x][world_y] with range [range] More...
 
int32_t pc_get_equip_refine_level (lua_State *L)
 lua will return the current player's wear item in pos [cell]'s refine level More...
 
int32_t pc_refine_equip (lua_State *L)
 it will refine the current player's wear item in pos [cell] if its refine level is below [level_limit] with the percent of success of [pct] to the relative item's refined vnum More...
 
int32_t pc_get_skill_level (lua_State *L)
 lua will return the current player's skill [vnum]'s level More...
 
int32_t pc_give_lotto (lua_State *L)
 it will insert a lotto ticket with player's pid in player.lotto_list, and will give to the current player a lotto item (vnum 50001, count 1, socket0 the lotto_list's insert id, socket1 event flag "lotto_round") More...
 
int32_t pc_aggregate_monster (lua_State *L)
 it will aggro against the current player all the monsters close More...
 
int32_t pc_forget_my_attacker (lua_State *L)
 it will let all the monsters forget about attacking the current player, and be in REVIVE_INVISIBLE for 5 seconds More...
 
int32_t pc_attract_ranger (lua_State *L)
 it will set the BOW_DISTANCE to 150 for 3 minutes to the monsters close to the current player More...
 
int32_t pc_select_pid (lua_State *L)
 it will select the current player to player [pid] More...
 
int32_t pc_select_vid (lua_State *L)
 it will select the current player to player [vid] More...
 
int32_t pc_get_sex (lua_State *L)
 lua will return the current player's sex (0 male, 1 female) More...
 
int32_t pc_is_engaged (lua_State *L)
 lua will return whether or not the current player is engaged More...
 
int32_t pc_is_married (lua_State *L)
 lua will return whether or not the current player is married More...
 
int32_t pc_is_engaged_or_married (lua_State *L)
 lua will return whether or not the current player is married/engaged More...
 
int32_t pc_is_gm (lua_State *L)
 lua will return whether or not the current player is gm More...
 
int32_t pc_get_gm_level (lua_State *L)
 lua will return the current player's gm level (normal players are 0) More...
 
int32_t pc_mining (lua_State *L)
 it will start the mining event for the current player (available only for ore_npc.click quest events) More...
 
int32_t pc_diamond_refine (lua_State *L)
 it will refine the current player's current ore item (mineral) with the percentage [pct] of success, and with the cost of [cost] yangs More...
 
int32_t pc_ore_refine (lua_State *L)
 it will refine the current player's ore item (mineral) in inventory position [cell] with the percentage [pct] of success, and with the cost of [cost] yangs More...
 
int32_t pc_clear_skill (lua_State *L)
 it will clear the current player's skills More...
 
int32_t pc_clear_sub_skill (lua_State *L)
 it will clear the current player's sub skills More...
 
int32_t pc_set_skill_point (lua_State *L)
 it will set the current player's skill points to [amount] More...
 
int32_t pc_clear_one_skill (lua_State *L)
 it will clear the current player's skill [vnum] More...
 
int32_t pc_is_clear_skill_group (lua_State *L)
 lua will return whether or not the current player's quest flag "skill_group_clear.clear" is 1 More...
 
int32_t pc_save_exit_location (lua_State *L)
 it will save the current position as exit location for the current player More...
 
int32_t pc_teleport (lua_State *L)
 if the first arg is a number, it will warp the current player to a hardcoded town id [town_id] (only values between 0~9 are available)
if the first arg is a std::string, it will warp the current player to the player [player_name] More...
 
int32_t pc_set_skill_level (lua_State *L)
 it will set the skill [vnum] to [level] for the current player More...
 
int32_t pc_give_polymorph_book (lua_State *L)
 it will give to the current player the marble item (vnum 50322) with socket0 [vnum], socket1 [practice_count], socket2 [book_level]; the field [level_limit] is required but unused More...
 
int32_t pc_upgrade_polymorph_book (lua_State *L)
 it will upgrade the current item of the current player (for marble poly items, but not checked). It will increase socket1 per 50, and socket2 by one More...
 
int32_t pc_get_premium_remain_sec (lua_State *L)
 lua will return the current player's premium [index]'s value; if [index]==0 exp, 1 item, 2 safebox, 3 autoloot, 4 fish_mind, 5 marriage_fast, 6 gold More...
 
int32_t pc_send_block_mode (lua_State *L)
 it will set the current player's block mode to [mode] More...
 
int32_t pc_change_empire (lua_State *L)
 it will change the current player's empire to [empire] More...
 
int32_t pc_get_change_empire_count (lua_State *L)
 lua will return the current player's change_empire count More...
 
int32_t pc_set_change_empire_count (lua_State *L)
 it will increase the current player's change_empire count by one More...
 
int32_t pc_change_name (lua_State *L)
 it will switch the current player's name to [name] deleting also the friend list of the old name from everyone More...
 
int32_t pc_is_dead (lua_State *L)
 lua will return whether or not the current player is dead More...
 
int32_t pc_reset_status (lua_State *L)
 it will reset the specific status [type] to 1; [type]=0 vit, [type]=1 int, [type]=2 str, [type]=3 dex; More...
 
int32_t pc_get_ht (lua_State *L)
 lua will return the current player's vit points More...
 
int32_t pc_set_ht (lua_State *L)
 it will set the vit points to [value] for the current player More...
 
int32_t pc_get_iq (lua_State *L)
 lua will return the current player's int points More...
 
int32_t pc_set_iq (lua_State *L)
 it will set the int points to [value] for the current player More...
 
int32_t pc_get_st (lua_State *L)
 lua will return the current player's str points More...
 
int32_t pc_set_st (lua_State *L)
 it will set the str points to [value] for the current player More...
 
int32_t pc_get_dx (lua_State *L)
 lua will return the current player's dex points More...
 
int32_t pc_set_dx (lua_State *L)
 it will set the dex points to [value] for the current player More...
 
int32_t pc_is_near_vid (lua_State *L)
 lua will return whether or not the player [vid] has a distance at maximum of [distance] from the current player More...
 
int32_t pc_get_socket_items (lua_State *L)
 lua will return the table of any items containing stone sockets More...
 
int32_t pc_get_empty_inventory_count (lua_State *L)
 lua will return how many empty slots are present in the current player's inventory More...
 
int32_t pc_get_logoff_interval (lua_State *L)
 lua will return the current player's logoff interval
the logoff interval is a variable set at login and it's the result of NOW()-last_play (so the time passed before the last login) More...
 
int32_t pc_get_player_id (lua_State *L)
 lua will return the current player's pid More...
 
int32_t pc_get_account_id (lua_State *L)
 lua will return the current player's account id More...
 
int32_t pc_get_account (lua_State *L)
 lua will return the current player's account name More...
 
int32_t pc_is_riding (lua_State *L)
 lua will return whether or not the current player is riding (either horse or mount) More...
 
int32_t pc_get_special_ride_vnum (lua_State *L)
 lua will return the current player's mount seal's vnum and left time More...
 
int32_t pc_can_warp (lua_State *L)
 lua will return whether or not the current player can warp More...
 
int32_t pc_dec_skill_point (lua_State *L)
 it will decrease the current player's skill points by one More...
 
int32_t pc_get_skill_point (lua_State *L)
 lua will return the current player's skill points More...
 
int32_t pc_get_channel_id (lua_State *L)
 lua will return the current game's channel id More...
 
int32_t pc_give_poly_marble (lua_State *L)
 lua will return whether or not the polymorph marble of the mob [vnum] has been created and given to the current player More...
 
int32_t pc_get_sig_items (lua_State *L)
 lua will return the list of every mount seal item's vnum by id [group_vnum] More...
 
int32_t pc_charge_cash (lua_State *L)
 lua will return whether or not the cash charge request of [amount] by type [charge_type] has been sent More...
 
int32_t pc_give_award (lua_State *L)
 it will create the item [vnum], count [count] with reason [why] to the current pc More...
 
int32_t pc_give_award_socket (lua_State *L)
 it will create the item [vnum], count [count] and sockets [socket1~3] with reason [why] to the current pc More...
 
int32_t pc_get_informer_type (lua_State *L)
 lua will return the current item award's cmd for the current pc (available only in the quest event item_informer) More...
 
int32_t pc_get_informer_item (lua_State *L)
 lua will return the current item award's vnum for the current pc (available only in the quest event item_informer) More...
 
int32_t pc_get_killee_drop_pct (lua_State *L)
 lua will return the current npc's kill drop pct for the current pc More...
 
int32_t pc_make_item0 (lua_State *L)
 it will make the item [vnumcount][1] by count [vnumcount][2], sockets [sockets], attrs [attrs] in the mode [mode]
if [mode] is 0, it will give it directly in the inventory;
if [mode] is 1, it will put it in the ground, beside the current player without ownership;
if [mode] is 2, it will put it in the ground, beside the current player with current player's ownership; More...
 
int32_t pc_set_race0 (lua_State *L)
 it will set the current player's race to [race]; sex will be kept (lycan is only male)
0: warrior, 1: ninja, 2: sura, 3: shaman, 4: lycan More...
 
int32_t pc_del_another_quest_flag (lua_State *L)
 it will delete the [questname].[flagname] quest flag from the current player More...
 
int32_t pc_pointchange (lua_State *L)
 it will temporary (until relogin) add to the current player the [point_type] with amount [amount];
if [client_refresh]=true, it will send the changed amount in the update client packet as well
if [is_around]=true, it will send the update client packet to everyone close to the current player; if false, only to the current player More...
 
int32_t pc_pullmob (lua_State *L)
 it will all the mobs close to the current player (such as /pull) More...
 
int32_t pc_set_level0 (lua_State *L)
 it will set the current player's level to [level]; it will reset points, skills and subskills as well (such as /level) More...
 
int32_t pc_set_gm_level (lua_State *L)
 it will reset the current player's gm level to [level] (it's safe: it's based on gmlist/gmhost) More...
 
int32_t pc_if_fire (lua_State *L)
 lua will return whether or not the current player is on fire More...
 
int32_t pc_if_invisible (lua_State *L)
 lua will return whether or not the current player is invisible More...
 
int32_t pc_if_poison (lua_State *L)
 lua will return whether or not the current player is poisoned More...
 
int32_t pc_if_bleeding (lua_State *L)
 lua will return whether or not the current player is bleeding More...
 
int32_t pc_if_slow (lua_State *L)
 lua will return whether or not the current player is slowed More...
 
int32_t pc_if_stun (lua_State *L)
 lua will return whether or not the current player is stunned More...
 
int32_t pc_sf_fire (lua_State *L)
 it will turn on fire the current player if [mode] is true, unturn the fire otherwise More...
 
int32_t pc_sf_invisible (lua_State *L)
 it will turn (gm) invisible the current player if [mode] is true, unturn invisibility otherwise otherwise More...
 
int32_t pc_sf_poison (lua_State *L)
 it will poison the current player if [mode] is true, depoison otherwise More...
 
int32_t pc_sf_bleeding (lua_State *L)
 it will bleed the current player if [mode] is true, debleed otherwise More...
 
int32_t pc_sf_slow (lua_State *L)
 it will slow the current player if [mode] is true, deslow otherwise More...
 
int32_t pc_sf_stun (lua_State *L)
 it will stun the current player if [mode] is true, destun otherwise More...
 
int32_t pc_sf_kill (lua_State *L)
 it will kill the player [name] More...
 
int32_t pc_sf_dead (lua_State *L)
 it will kill the current player More...
 
int32_t pc_get_exp_level (lua_State *L)
 lua will return the exp required for the level [level] More...
 
int32_t pc_get_exp_level0 (lua_State *L)
 lua will return just [pct] percent of the exp required for the level [level] More...
 
int32_t pc_get_ip0 (lua_State *L)
 lua will return the current player's ip More...
 
int32_t pc_get_client_version0 (lua_State *L)
 lua will return the current player's client version More...
 
int32_t pc_dc_delayed0 (lua_State *L)
 it will disconnect the current player in [seconds] seconds (if you run twice, the second time, the second could fail since there's already a disconnect event) More...
 
int32_t pc_dc_direct0 (lua_State *L)
 it will immediately disconnect the current player with the reason [reason] More...
 
int32_t pc_is_trade0 (lua_State *L)
 lua will return whether or not the current pc is exchanging More...
 
int32_t pc_is_busy0 (lua_State *L)
 lua will return whether or not the current pc is busy with exchange, myshop, shopowner, safebox/mall, cube windows More...
 
int32_t pc_is_arena0 (lua_State *L)
 lua will return whether or not the current pc is in the arena dueling More...
 
int32_t pc_is_arena_observer0 (lua_State *L)
 lua will return whether or not the current pc is in arena observer mode More...
 
int32_t pc_equip_slot0 (lua_State *L)
 it will equip the item [slot] from the inventory More...
 
int32_t pc_unequip_slot0 (lua_State *L)
 it will unequip the equipped item [slot] More...
 
int32_t pc_is_available0 (lua_State *L)
 lua will return whether or not there is a current pc More...
 
int32_t pc_give_random_book0 (lua_State *L)
 lua will return whether or not it succedeed More...
 
int32_t pc_is_pvp0 (lua_State *L)
 lua will return whether or not the current pc is pvp fighting More...
 
int32_t pc_make_guild0 (lua_State *L)
 it will make the guild [guild_name], and the current pc will be its leader More...
 
int32_t pet_summon (lua_State *L)
 it will summon a pet [mob_vnum] with the name [pet_name] for the current pc
if [from_afar] is specified and true, the pet will be spawned afar, otherwise it will be close to the current pc More...
 
int32_t pet_unsummon (lua_State *L)
 it will unsummon a pet [mob_vnum] from the current pc More...
 
int32_t pet_count_summoned (lua_State *L)
 lua will return the count of the current pc's summoned pets More...
 
int32_t pet_is_summon (lua_State *L)
 lua will return whether or not the current pc has a pet [mob_vnum] spawned More...
 
int32_t pet_spawn_effect (lua_State *L)
 it will append to the current pc's spawned pet [mob_vnum] the effect [effect_pathfile] (full client's path) More...
 
int32_t quest_start (lua_State *L)
 it will start the quest and send the current quest's letter (hardcoded in questlib.lua: send_letter) More...
 
int32_t quest_done (lua_State *L)
 it will stop the quest and clear the current quest's letter (hardcoded in questlib.lua: clear_letter) More...
 
int32_t quest_set_title (lua_State *L)
 it will set the title of the current quest's letter to [quest_title] that will be sent with q.start() (hardcoded in questlib.lua: send_letter) More...
 
int32_t quest_set_another_title (lua_State *L)
 it will set the title of the quest [quest_name]'s letter to [quest_title] More...
 
int32_t quest_set_clock_name (lua_State *L)
 it will set the title of the current quest's clock to clock_name More...
 
int32_t quest_set_clock_value (lua_State *L)
 it will set the value of the current quest's clock clock_value More...
 
int32_t quest_set_counter_name (lua_State *L)
 it will set the title of the current quest's counter to counter_name More...
 
int32_t quest_set_counter_value (lua_State *L)
 it will set the value of the current quest's counter counter_value More...
 
int32_t quest_set_icon_file (lua_State *L)
 it will set the icon of the current quest's letter to [icon_name] that will be sent with q.start() (hardcoded in questlib.lua: send_letter_ex)
the path starts from "D:/ymir work/ui/game/quest/questicon/"+[icon_name] and it is clearly client-side related More...
 
int32_t quest_setstate (lua_State *L)
 it will set the state of the current quest to state_name More...
 
int32_t quest_coroutine_yield (lua_State *L)
 it will set the current quest to be yielded, in few words, it will be paused and other quests will be processed in meantime (hardcoded in questlib.lua: select, select_table, wait, input, confirm, select_item) More...
 
int32_t quest_no_send (lua_State *L)
 it will set a global NoSend flag and all the quests of everyone won't ever send any GC_SCRIPT packet to the players' clients More...
 
int32_t quest_get_current_quest_index (lua_State *L)
 lua will return the index of the current quest More...
 
int32_t quest_get_current_quest_name (lua_State *L)
 lua will return the name of the current quest More...
 
int32_t quest_begin_other_pc_block (lua_State *L)
 it will ignore the current pc and will switch control to the player [pid]'s quests instead (usually used for each element of the party.get_member_pids() result) More...
 
int32_t quest_end_other_pc_block (lua_State *L)
 it will switch control to the current pc after having used q.begin_other_pc_block More...
 
int32_t speedserver_get_wday (lua_State *L)
 lua will return the exp table of the specific [empire] and [wday] More...
 
int32_t speedserver_set_wday (lua_State *L)
 it will set for the empire [empire] in the [wday] day, the [exp_percent] exp% until [end_hour]:[end_minute] More...
 
int32_t speedserver_init_wday (lua_State *L)
 it will initialize the exp table for the empire [empire] in the [wday] day More...
 
int32_t speedserver_get_holiday (lua_State *L)
 lua will return the exp table of the specific [empire] for the date [year]/[month]/[day] More...
 
int32_t speedserver_set_holiday (lua_State *L)
 it will set for the empire [empire] until [year]/[month]/[day] [end_hour]:[end_minute], the [exp_percent] exp% More...
 
int32_t speedserver_init_holiday (lua_State *L)
 it will initialize the exp table for the empire [empire] for the [year]/[month]/[day] date More...
 
int32_t speedserver_get_current_exp_priv (lua_State *L)
 lua will return the exp table's information of the empire [empire] More...
 
int32_t target_pos (lua_State *L)
 it will create a target circle in the map [map_index], coordinates [map_x] and [map_y] with the name [target_name] (only the current pc can see it);
the minimap will display the relative [target_desc] description if present, and it will be shown to the client if [send_to_client]=1 (if not present, it's still 1 by default)
to trigger the event via quest when the player reach the relative target, you can use "when [target_name].target.arrive begin"; it is common to use "__TARGET__" for the [target_name] More...
 
int32_t target_vid (lua_State *L)
 it will create a target circle on the player/npc [vid]'s head with the name [target_name] (only the current pc can see it);
the minimap will display the relative [target_desc] description if present, and it will be shown to the client if [send_to_client]=1 (if not present, it's still 1 by default)
to trigger the event via quest when the player clicks on the relative target, you can use "when [target_name].target.click begin"; it is common to use "__TARGET__" for the [target_name] More...
 
int32_t target_delete (lua_State *L)
 it will delete the target [target_name] from the current pc's target list; it is common to use "__TARGET__" for the [target_name] More...
 
int32_t target_clear (lua_State *L)
 it will delete all the targets from the current pc's target list More...
 
int32_t target_id (lua_State *L)
 lua will return the vid of the the current pc's [target_name], or 0 if not found More...
 

Detailed Description

Function Documentation

◆ _add_bgm_info()

int32_t quest::_add_bgm_info ( lua_State *  L)

it will enable the bgm [filename] for the map [map_index]
it will be played client-side when accessing the specified map
used mostly in settings.lua

LuaFunc:
add_bgm_info(LuaNumber map_index, LuaString filename)
Returns
nil

◆ _add_goto_info()

int32_t quest::_add_goto_info ( lua_State *  L)

it will enable, for the specific player [empire], a /goto [name] location for [map_index] coordinates [world_x],[world_y]

LuaFunc:
add_goto_info(LuaString name, LuaNumber empire, LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ _add_ox_quiz()

int32_t quest::_add_ox_quiz ( lua_State *  L)

it will add in the oxevent the quiz [quiz] having the answer [answer] by the level [level]
you can make different quiz lists based on different level; it's the same used to pick up questions with oxevent.quiz
the answer is simply true/false

LuaFunc:
add_ox_quiz(LuaNumber level, LuaString quiz, LuaBoolean answer)
Returns
nil

◆ _big_notice()

int32_t quest::_big_notice ( lua_State *  L)

it will send a BIG_NOTICE chat packet containing [text] to the current pc

LuaFunc:
big_notice(LuaString text...)
NewStuff:
big_notice(LuaString text...)
New LuaFunc:
big_notice(LuaString text...)
Returns
nil

◆ _big_notice_all()

int32_t quest::_big_notice_all ( lua_State *  L)

it will send a BIG_NOTICE chat packet containing [text] to everyone

LuaFunc:
big_notice_all(LuaString text...)
NewStuff:
big_notice_all(LuaString text...)
New LuaFunc:
big_notice_all(LuaString text...)
Returns
nil

◆ _big_notice_in_map()

int32_t quest::_big_notice_in_map ( lua_State *  L)

it will send a BIG_NOTICE chat packet containing [text] to everyone in the current player's map

LuaFunc:
big_notice_in_map(LuaString text
NewStuff:
big_notice_in_map(LuaString text
New LuaFunc:
big_notice_in_map(LuaString text
Returns
nil

◆ _block_chat()

int32_t quest::_block_chat ( lua_State *  L)

it will block the player [name]'s chat for [time] seconds
the [time] can also be a formatted std::string such as "7d 1h 25m 50s" (check parse_time_str in Utils.cpp)

LuaFunc:
block_chat(LuaString name, LuaString time)
Returns
nil

◆ _char_log()

int32_t quest::_char_log ( lua_State *  L)

it will send a char_log for the current player with what=[what], how=[how], hint=[hint]
char_log = a row of type CHARACTER in the database's table log.log

LuaFunc:
char_log([LuaNumber what=0], [LuaString how=""], [LuaString hint=""])
Returns
nil

◆ _chat()

int32_t quest::_chat ( lua_State *  L)

it will send a TALKING chat packet containing [text] to the current pc

LuaFunc:
chat(LuaString text...)
Returns
nil

◆ _chat_in_map0()

int32_t quest::_chat_in_map0 ( lua_State *  L)

it will send a TALKING chat packet containing [text] to everyone in map [map_index]

LuaFunc:
chat_in_map0(LuaString text, LuaNumber map_index)
NewStuff:
chat_in_map0(LuaString text, LuaNumber map_index)
New LuaFunc:
chat_in_map0(LuaString text, LuaNumber map_index)
Returns
nil

◆ _clear_named_timer()

int32_t quest::_clear_named_timer ( lua_State *  L)

it will delete a timer event [name] from the current player

LuaFunc:
cleartimer(LuaString name)
Returns
nil

◆ _clear_server_timer()

int32_t quest::_clear_server_timer ( lua_State *  L)

it will delete a server_timer event [name] with argument [arg] (usually the map index)

LuaFunc:
clear_server_timer(LuaString name, LuaNumber arg)
Returns
nil

◆ _cmdchat()

int32_t quest::_cmdchat ( lua_State *  L)

it will send a COMMAND chat packet containing [text] to the current pc

LuaFunc:
cmdchat(LuaString text...)
Returns
nil

◆ _cmdchat_in_map0()

int32_t quest::_cmdchat_in_map0 ( lua_State *  L)

it will send a COMMAND chat packet containing [text] to everyone in map [map_index]

LuaFunc:
cmdchat_in_map0(LuaString text, LuaNumber map_index)
NewStuff:
cmdchat_in_map0(LuaString text, LuaNumber map_index)
New LuaFunc:
cmdchat_in_map0(LuaString text, LuaNumber map_index)
Returns
nil

◆ _do_command()

int32_t quest::_do_command ( lua_State *  L)

it will make the current player send the specified [command] (gm level checked)

LuaFunc:
command(LuaString command)
Returns
nil

◆ _enable_over9refine()

int32_t quest::_enable_over9refine ( lua_State *  L)

it will allow the refine from item [vnum_from] to item [vnum_to], used mostly in settings.lua

LuaFunc:
enable_over9refine(LuaNumber vnum_from, LuaNumber vnum_to)
Returns
nil

◆ _find_npc_by_vnum()

int32_t quest::_find_npc_by_vnum ( lua_State *  L)

lua will return the first npc [npc_vnum]'s vid

LuaFunc:
find_npc_by_vnum(LuaNumber npc_vnum)
Returns
[1] LuaNumber: the found npc's vid, 0 otherwise

◆ _find_pc()

int32_t quest::_find_pc ( lua_State *  L)

lua will return the player [name]'s vid, 0 otherwise

LuaFunc:
find_pc_by_name(LuaString name)
Returns
[1] LuaNumber: the player [name]'s vid, 0 otherwise

◆ _find_pc_cond()

int32_t quest::_find_pc_cond ( lua_State *  L)

lua will return the first player's vid having the level between [min_level]~[max_level] and job as [job_flag]

LuaFunc:
find_pc_cond(LuaNumber min_level, LuaNumber max_level, LuaNumber job_flag)
Returns
[1] LuaNumber: the found player's vid, 0 otherwise

◆ _fish_real_refine_rod()

int32_t quest::_fish_real_refine_rod ( lua_State *  L)

it will refine the fishrod in inventory position [item_cell]

LuaFunc:
__fish_real_refine_rod(LuaNumber item_cell)
Returns
[1] LuaNumber: 0 if failed, 1 if succeeded, 2 if hacking is detected

◆ _get_channel_id()

int32_t quest::_get_channel_id ( lua_State *  L)

lua will return the actual game core's CHANNEL value

LuaFunc:
get_channel_id()
Returns
[1] LuaNumber: the actual game core's CHANNEL value

◆ _get_empire_privilege()

int32_t quest::_get_empire_privilege ( lua_State *  L)

lua will return the priv type [type]'s value of the specific [empire]

LuaFunc:
__get_empire_priv(LuaNumber empire, LuaNumber type)
Returns
[1] LuaNumber: the priv type [type]'s value of the specific [empire]

◆ _get_empire_privilege_string()

int32_t quest::_get_empire_privilege_string ( lua_State *  L)

lua will return all the priv types of the specific [empire] as preformatted std::string text

LuaFunc:
__get_empire_priv_string(LuaNumber empire)
Returns
[1] LuaString: all the priv types of the specific [empire] as preformatted std::string text

◆ _get_global_time()

int32_t quest::_get_global_time ( lua_State *  L)

lua will return the timestamp of the server

LuaFunc:

get_time()

get_global_time()

Returns
[1] LuaNumber: the timestamp of the server

◆ _get_guild_privilege()

int32_t quest::_get_guild_privilege ( lua_State *  L)

lua will return the priv type [type]'s value of the specific [guild]

LuaFunc:
__get_guild_priv(LuaNumber guild, LuaNumber type)
Returns
[1] LuaNumber: the priv type [type]'s value of the specific [guild]

◆ _get_guild_privilege_string()

int32_t quest::_get_guild_privilege_string ( lua_State *  L)

lua will return all the priv types of the specific [guild] as preformatted std::string text

LuaFunc:
__get_guild_priv_string(LuaNumber guild)
Returns
[1] LuaString: all the priv types of the specific [guild] as preformatted std::string text

◆ _get_guildid_byname()

int32_t quest::_get_guildid_byname ( lua_State *  L)

lua will return the id of the guild's [name]

LuaFunc:
__get_guildid_byname(LuaString name)
Returns
[1] LuaNumber: the id of the guild's [name], 0 if not found

◆ _get_item_attr_norm_table()

int32_t quest::_get_item_attr_norm_table ( lua_State *  L)

lua will return the list of the fields in item_attr

LuaFunc:
get_item_attr_norm_table()
NewStuff:
get_item_attr_norm_table()
New LuaFunc:
get_item_attr_norm_table()
Returns
[1] LuaNumber,LuaNumber,LuaTable[LuaNumber, LuaTable[LuaNumber*ATTRIBUTE_SET_MAX_NUM+LuaNumber*ATTRIBUTE_SET_MAX_NUM]]: ITEM_ATTRIBUTE_MAX_LEVEL,ATTRIBUTE_SET_MAX_NUM,list[apply_index,info]
Examples:
function is_it_a_valid_norm_bonus(point_type, point_value)
--[[get the item_attr table]]
local levelNum, valueNum, itemAttrNorm = get_item_attr_norm_table()
local ret = false
--[[iter all the elements]]
for k,v in pairs(itemAttrNorm) begin
--[[find the right row]]
if k==point_type then
--[[iter all the lvl1~5]]
for i=1,levelNum do
--[[find if the value is present in the 1-5 levels]]
if v[i]==point_value then
ret = true
break
end
end
end
--[[leave the main loop if it has been already found]]
if ret then break end
end
return ret
end
syschat(is_it_a_valid_norm_bonus(apply["MAX_HP"], 500) and "yes" or "no")
See also
Some examples about its usage can be found in _get_item_attr_rare_table()

◆ _get_item_attr_rare_table()

int32_t quest::_get_item_attr_rare_table ( lua_State *  L)

lua will return the list of the fields in item_attr_rare

LuaFunc:
get_item_attr_rare_table()
NewStuff:
get_item_attr_rare_table()
New LuaFunc:
get_item_attr_rare_table()
Returns
[1] LuaNumber,LuaNumber,LuaTable[LuaNumber, LuaTable[LuaNumber*ATTRIBUTE_SET_MAX_NUM+LuaNumber*ATTRIBUTE_SET_MAX_NUM]]: ITEM_ATTRIBUTE_MAX_LEVEL,ATTRIBUTE_SET_MAX_NUM,list[apply_index,info]
Examples:
local itemAttrTypeList = {weapon=1, body=2, wrist=3, foots=4, neck=5, head=6, shield=7, ear=8, costume_body=9, costume_hair=10, costume_weapon=11}
function is_it_a_valid_rare_bonus_type_for_equip_type(point_type, equip_type)
--[[get the item_attr_attr table]]
local levelNum, valueNum, itemAttrNorm = get_item_attr_rare_table()
local ret = false
--[[iter all the elements]]
for k,v in pairs(itemAttrNorm) begin
--[[find the right row]]
if k==point_type then
ret = v[levelNum+equip_type] > 0
break
end
--[[leave the main loop if it has been already found]]
if ret then break end
end
return ret
end
syschat(is_it_a_valid_rare_bonus_type_for_equip_type(apply["CON"], itemAttrTypeList.weapon) and "yes" or "no")
See also
Some examples about its usage can be found in _get_item_attr_norm_table()

◆ _get_locale()

int32_t quest::_get_locale ( lua_State *  L)

lua will return the name of the locale

LuaFunc:
get_locale()
Returns
[1] LuaString: the name of the locale

◆ _get_locale_base_path()

int32_t quest::_get_locale_base_path ( lua_State *  L)

lua will return the path of the loaded locale (e.g. locale/germany)

LuaFunc:
get_locale_base_path()
Returns
[1] LuaString: the path of the loaded locale

◆ _get_quest_state()

int32_t quest::_get_quest_state ( lua_State *  L)

lua will return the quest [quest_name]'s state (the relative [quest_name].__status value)

LuaFunc:
get_quest_state(LuaString quest_name)
Returns
[1] LuaNumber: the quest [quest_name]'s state

◆ _get_server_timer_arg()

int32_t quest::_get_server_timer_arg ( lua_State *  L)

lua will return the current server_timer's arg (usually the map index)

LuaFunc:
get_server_timer_arg()
Returns
[1] LuaNumber: the current server_timer's arg

◆ _get_special_item_group()

int32_t quest::_get_special_item_group ( lua_State *  L)

lua will return the list of every element of the relative special_item_group's [group_id]

LuaFunc:
get_special_item_group(LuaNumber group_id)
Returns
[1] LuaTable[LuaNumber,LuaNumber]: item vnum, item count for each element; nil otherwise

◆ _get_table_postfix()

int32_t quest::_get_table_postfix ( lua_State *  L)

lua will return the TABLE_POSTFIX value in the current game core's CONFIG ("" by default)

LuaFunc:
get_table_postfix()
NewStuff:
get_table_postfix()
New LuaFunc:
get_table_postfix()
Returns
[1] LuaString: the TABLE_POSTFIX value in the current game core's CONFIG

◆ _getnpcid()

int32_t quest::_getnpcid ( lua_State *  L)

lua will return the npc id from the [name] specified inside questnpc.txt

LuaFunc:
getnpcid(LuaString name)
Returns
[1] LuaNumber: the npc id from the [name] specified inside questnpc.txt

◆ _give_char_privilege()

int32_t quest::_give_char_privilege ( lua_State *  L)

it will set to player [pid] the priv type [type] with value [value]

LuaFunc:
__give_char_priv(LuaNumber pid, LuaNumber type, LuaNumber value)
Returns
nil

◆ _give_empire_privilege()

int32_t quest::_give_empire_privilege ( lua_State *  L)

it will set to the empire [empire] the priv type [type] with value [value] for [time] seconds

LuaFunc:
__give_empire_priv(LuaNumber empire, LuaNumber type, LuaNumber value, LuaNumber time)
Returns
nil

◆ _give_guild_privilege()

int32_t quest::_give_guild_privilege ( lua_State *  L)

it will set to the guild [guild_id] the priv type [type] with value [value] for [time] seconds

LuaFunc:
__give_guild_priv(LuaNumber guild_id, LuaNumber type, LuaNumber value, LuaNumber time)
Returns
nil

◆ _is_speed_server()

int32_t quest::_is_speed_server ( lua_State *  L)

lua will return true if the config SPEED_SERVER is true, false otherwise

LuaFunc:
is_speed_server()
Returns
[1] LuaBoolean: true if the config SPEED_SERVER is true, false otherwise

◆ _is_test_server()

int32_t quest::_is_test_server ( lua_State *  L)

lua will return true if the config TEST_SERVER is true, false otherwise

LuaFunc:
is_test_server()
Returns
[1] LuaBoolean: true if the config TEST_SERVER is true, false otherwise

◆ _item_log()

int32_t quest::_item_log ( lua_State *  L)

it will send an item_log for the current player about the item [item_id] with how=[how], hint=[hint]
it will send nothing if the item [item_id] is not found
item_log = a row of type ITEM in the database's table log.log

LuaFunc:
item_log([LuaNumber item_id=0], [LuaString how=""], [LuaString hint=""])
Returns
nil

◆ _item_name()

int32_t quest::_item_name ( lua_State *  L)

lua will return the item [item_vnum]'s locale name

LuaFunc:
item_name(LuaNumber item_vnum)
Returns
[1] LuaString: the item [item_vnum]'s locale name

◆ _kill_all_in_map()

int32_t quest::_kill_all_in_map ( lua_State *  L)

it will kill every monster in map [map_index]

LuaFunc:
kill_all_in_map(LuaNumber map_index)
Returns
nil

◆ _left_image()

int32_t quest::_left_image ( lua_State *  L)

it will send a LEFTIMAGE script packet containing [text] to the current pc

LuaFunc:
setleftimage(LuaString text)
Returns
nil

◆ _map_allow_find()

int32_t quest::_map_allow_find ( lua_State *  L)

lua will return whether or not this game core contains the map [map_index] (to be more precise, if it has been specified in the MAP_ALLOW game CONFIG)

LuaFunc:
map_allow_find(LuaNumber map_index)
NewStuff:
map_allow_find(LuaNumber map_index)
New LuaFunc:
map_allow_find(LuaNumber map_index)
Returns
[1] LuaBoolean: true if present, false otherwise

◆ _mob_name()

int32_t quest::_mob_name ( lua_State *  L)

lua will return the mob [mob_vnum]'s locale name

LuaFunc:
mob_name(LuaNumber mob_vnum)
Returns
[1] LuaString: the mob [mob_vnum]'s locale name

◆ _mob_vnum()

int32_t quest::_mob_vnum ( lua_State *  L)

lua will return the vnum of the mob's [mob_name]

LuaFunc:
mob_name(LuaString mob_name)
Returns
[1] LuaNumber: the vnum of the mob's [mob_name]

◆ _mysql_direct_query()

int32_t quest::_mysql_direct_query ( lua_State *  L)

it will send the mysql query [query]; default database: player

LuaFunc:
mysql_direct_query(LuaString query)
NewStuff:
mysql_direct_query(LuaString query)
New LuaFunc:
mysql_direct_query(LuaString query)
Returns
[1] LuaTable[LuaNumber,LuaTable] the count of the affected rows, the fetched mysql table
Examples:
function get_top_player_rank()
--[[query to show the first 10 nonbanned players with no gm tags and that logged in the last 24h, sorted by level, exp and name]]
local query = [[
SELECT player.name as m_name, player.level as m_level, player.exp as m_exp
FROM player.player, account.account
WHERE
player.name not like '[%]%' AND
date_sub(now(), interval 1 day) < player.last_play AND
player.account_id=account.id AND
account.status='OK'
ORDER BY player.level DESC, player.exp DESC, player.name ASC
LIMIT 10;
]]
--[[fetch the result]]
local res1, res2 = mysql_direct_query(query)
--[[process the result]]
say_title(string.format("Top %d players.", res1))
for n,s in ipairs(res2) do
say_reward(string.format("%d\t%s\t%s\t%s", n, s.m_name, s.m_level, s.m_exp))
end
end
get_top_player_rank()

◆ _mysql_escape_string()

int32_t quest::_mysql_escape_string ( lua_State *  L)

lua will return the escaped std::string of the mysql query [query]

LuaFunc:
mysql_escape_string(LuaString query)
NewStuff:
mysql_escape_string(LuaString query)
New LuaFunc:
mysql_escape_string(LuaString query)
Returns
[1] LuaString: the escaped std::string of the mysql query [query]

◆ _mysql_password()

int32_t quest::_mysql_password ( lua_State *  L)

lua will return the hashed std::string of [password]
the password algorithm is: sha1(sha1_bin(password))

LuaFunc:
mysql_password(LuaString password)
NewStuff:
mysql_password(LuaString password)
New LuaFunc:
mysql_password(LuaString password)
Returns
[1] LuaString: the escaped std::string of the mysql query [query]

◆ _notice()

int32_t quest::_notice ( lua_State *  L)

it will send a NOTICE chat packet containing [text] to the current pc

LuaFunc:
notice(LuaString text...)
Returns
nil

◆ _notice_all()

int32_t quest::_notice_all ( lua_State *  L)

it will send a BIG_NOTICE chat packet containing [text] to everyone

LuaFunc:
notice_all(LuaString text...)
Returns
nil

◆ _notice_in_map()

int32_t quest::_notice_in_map ( lua_State *  L)

it will send a NOTICE chat packet containing [text] to everyone in the current player's map
if [big_font] is true, it will be a BIG_NOTICE chat packet instead

LuaFunc:
notice_in_map(LuaString text, LuaBoolean big_font)
Returns
nil

◆ _number()

int32_t quest::_number ( lua_State *  L)

lua will return a random number between [min] and [max]

LuaFunc:
number(LuaNumber min, LuaNumber max)
Returns
[1] LuaNumber: a random number between [min] and [max]

◆ _purge_area()

int32_t quest::_purge_area ( lua_State *  L)

it will purge (destroy/make disappear) all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY]

LuaFunc:
purge_area(LuaNumber StartPosX, LuaNumber StartPosY, LuaNumber EndPosX, LuaNumber EndPosY)
Returns
nil

◆ _raw_script()

int32_t quest::_raw_script ( lua_State *  L)

it will send a script packet containing [text] to the current pc

LuaFunc:
raw_script(LuaString text)
Returns
nil

◆ _refine_pick()

int32_t quest::_refine_pick ( lua_State *  L)

it will refine the pickaxe in inventory position [item_cell]

LuaFunc:
__refine_pick(LuaNumber item_cell)
Returns
[1] LuaNumber: 0 if failed, 1 if succeeded, 2 if hacking is detected

◆ _regen_in_map()

int32_t quest::_regen_in_map ( lua_State *  L)

it will load the regen file [filename] ONCE in map [map_index]

LuaFunc:
regen_in_map(LuaNumber map_index, LuaString filename)
Returns
nil

◆ _say()

int32_t quest::_say ( lua_State *  L)

it will send a script packet containing [text] with a trailing "[ENTER]" to the current pc

LuaFunc:
say(LuaString text...)
Returns
nil

◆ _say_in_map()

int32_t quest::_say_in_map ( lua_State *  L)

it will send a script packet containing [text] with a trailing "[ENTER][DONE]" to everyone in map [map_index]

LuaFunc:
say_in_map(LuaNumber map_index, LuaString text)
Returns
nil

◆ _set_bgm_volume_enable()

int32_t quest::_set_bgm_volume_enable ( lua_State *  L)

it will enable the bgm volume (required line in settings.lua)

LuaFunc:
set_bgm_volume_enable()
Returns
nil

◆ _set_named_loop_timer()

int32_t quest::_set_named_loop_timer ( lua_State *  L)

it will create a timer event [name] for the current player and it will be runned and REPEATED every [timer] seconds

LuaFunc:
loop_timer(LuaNumber timer, LuaString name)
Returns
nil

◆ _set_named_timer()

int32_t quest::_set_named_timer ( lua_State *  L)

it will create a timer event [name] for the current player and it will be runned ONCE in [timer] seconds

LuaFunc:
timer(LuaNumber timer, LuaString name)
Returns
nil

◆ _set_quest_state()

int32_t quest::_set_quest_state ( lua_State *  L)

it will set the quest [quest_name]'s state to [state_name]

LuaFunc:
set_quest_state(LuaString quest_name, LuaString state_name)
Returns
nil

◆ _set_server_loop_timer()

int32_t quest::_set_server_loop_timer ( lua_State *  L)

it will create a server_timer event [name] it will be runned and REPEATED every [time] seconds with an argument [arg] (usually the map index)

LuaFunc:
server_loop_timer(LuaString name, LuaNumber time, [LuaNumber arg=0])
Returns
nil

◆ _set_server_timer()

int32_t quest::_set_server_timer ( lua_State *  L)

it will create a server_timer event [name] called ONCE in [time] seconds with an argument [arg] (usually the map index)

LuaFunc:
server_timer(LuaString name, LuaNumber time, [LuaNumber arg=0])
Returns
nil

◆ _set_skin()

int32_t quest::_set_skin ( lua_State *  L)

it will set the quest skin as [skin_id] to the current pc (usually NOWINDOW, NORMAL, CINEMATIC, SCROLL)

LuaFunc:

set_skin(LuaNumber skin_id)

setskin(LuaNumber skin_id)

Returns
nil

◆ _set_timer()

int32_t quest::_set_timer ( lua_State *  L)

it will create a timer event "" for the current player and it will be runned ONCE in [timer] seconds

LuaFunc:
timer(LuaNumber timer)
Returns
nil

◆ _spawn_mob()

int32_t quest::_spawn_mob ( lua_State *  L)

it will spawn a mob [vnum] beside the current player for [count] times, and if [is_aggressive]=true it will be aggressive

LuaFunc:
spawn_mob(LuaNumber vnum, LuaNumber count, LuaBoolean is_aggressive)
Returns
[1] LuaNumber: the count of the spawned mobs, 0 otherwise

◆ _spawn_mob0()

int32_t quest::_spawn_mob0 ( lua_State *  L)

it will spawn a mob [vnum] in [map_index] coordinates [map_x],[map_y]

LuaFunc:
spawn_mob0(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
NewStuff:
spawn_mob0(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
New LuaFunc:
spawn_mob0(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
LuaFunc:
spawn_mob_ex(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
NewStuff:
spawn_mob_ex(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
New LuaFunc:
spawn_mob_ex(LuaNumber vnum, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
Returns
[1] LuaNumber: the vid of the spawned mob, 0 if failed, -1 if wrong args, -2 if no mob [vnum] exists, -3 if no map [map_index] exists

◆ _spawn_mob_in_map()

int32_t quest::_spawn_mob_in_map ( lua_State *  L)

it will spawn a mob [vnum] in [map_index] coordinates [map_x],[map_y] for [count] times, and if [is_aggressive]=true it will be aggressive

LuaFunc:
spawn_mob_in_map(LuaNumber vnum, LuaNumber count, LuaBoolean is_aggressive, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
NewStuff:
spawn_mob_in_map(LuaNumber vnum, LuaNumber count, LuaBoolean is_aggressive, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
New LuaFunc:
spawn_mob_in_map(LuaNumber vnum, LuaNumber count, LuaBoolean is_aggressive, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
Returns
[1] LuaNumber: the count of the spawned mobs, 0 otherwise

◆ _syschat()

int32_t quest::_syschat ( lua_State *  L)

it will send an INFO chat packet containing [text] to the current pc

LuaFunc:
syschat(LuaString text...)
Returns
nil

◆ _syschat_in_map0()

int32_t quest::_syschat_in_map0 ( lua_State *  L)

it will send an INFO chat packet containing [text] to everyone in map [map_index]

LuaFunc:
syschat_in_map0(LuaString text, LuaNumber map_index)
NewStuff:
syschat_in_map0(LuaString text, LuaNumber map_index)
New LuaFunc:
syschat_in_map0(LuaString text, LuaNumber map_index)
Returns
nil

◆ _syserr()

int32_t quest::_syserr ( lua_State *  L)

it will write a line [text] in the syserr file of the actual game core

LuaFunc:
sys_err(LuaString text)
Returns
nil

◆ _syserr2()

int32_t quest::_syserr2 ( lua_State *  L)

it will write a line [text] in the syserr file of the actual game core (server_timer safe)

LuaFunc:
sys_err2(LuaString text)
NewStuff:
sys_err2(LuaString text)
New LuaFunc:
sys_err2(LuaString text)
LuaFunc:
sys_err0(LuaString text)
NewStuff:
sys_err0(LuaString text)
New LuaFunc:
sys_err0(LuaString text)
LuaFunc:
sys_err_ex(LuaString text)
NewStuff:
sys_err_ex(LuaString text)
New LuaFunc:
sys_err_ex(LuaString text)
Returns
nil

◆ _syslog()

int32_t quest::_syslog ( lua_State *  L)

it will write a line [text] in the syslog file of the actual game core
if the [log_level] flag is higher than 0, this line will be added only if the test_server mode is active

LuaFunc:
sys_log(LuaNumber log_level=0, LuaString text)
Returns
nil

◆ _syslog2()

int32_t quest::_syslog2 ( lua_State *  L)

it will write a line [text] in the syslog file of the actual game core (server_timer safe)
if the [log_level] flag is higher than 0, this line will be added only if the test_server mode is active

LuaFunc:
sys_log2(LuaNumber log_level=0, LuaString text)
NewStuff:
sys_log2(LuaNumber log_level=0, LuaString text)
New LuaFunc:
sys_log2(LuaNumber log_level=0, LuaString text)
LuaFunc:
sys_log0(LuaNumber log_level=0, LuaString text)
NewStuff:
sys_log0(LuaNumber log_level=0, LuaString text)
New LuaFunc:
sys_log0(LuaNumber log_level=0, LuaString text)
LuaFunc:
sys_log_ex(LuaNumber log_level=0, LuaString text)
NewStuff:
sys_log_ex(LuaNumber log_level=0, LuaString text)
New LuaFunc:
sys_log_ex(LuaNumber log_level=0, LuaString text)
Returns
nil

◆ _time_to_str()

int32_t quest::_time_to_str ( lua_State *  L)

lua will return the asctime of [timestamp]

LuaFunc:
time_to_str(LuaNumber timestamp)
Returns
[1] LuaString: the asctime of [timestamp]

◆ _timer()

int32_t quest::_timer ( lua_State *  L)

it will create a timer event [name] for the current player and it will be runned ONCE in [timer] seconds

LuaFunc:
timer(LuaNumber timer, [LuaString name=""])
Returns
nil

◆ _top_image()

int32_t quest::_top_image ( lua_State *  L)

it will send a LEFTIMAGE script packet containing [text] to the current pc

LuaFunc:
settopimage(LuaString text)
Returns
nil

◆ _under_han()

int32_t quest::_under_han ( lua_State *  L)

lua will return whether or not [text] is a valid hangul std::string (korean alphabet)

LuaFunc:
hunder_han(LuaString text)
Returns
[1] LuaNumber: true if valid, false otherwise

◆ _warp_all_in_area_to_area()

int32_t quest::_warp_all_in_area_to_area ( lua_State *  L)

it will warp everyone in the square range [FromStartPosX],[FromStartPosY] until [FromEndPosX],[FromEndPosY] to [ToStartPosX],[ToStartPosY] until [ToEndPosX],[ToEndPosY]

LuaFunc:
purge_area(LuaNumber FromStartPosX, LuaNumber FromStartPosY, LuaNumber FromEndPosX, LuaNumber FromEndPosY, LuaNumber ToStartPosX, LuaNumber ToStartPosY, LuaNumber ToEndPosX, LuaNumber ToEndPosY)
Returns
nil

◆ _warp_all_to_village()

int32_t quest::_warp_all_to_village ( lua_State *  L)

it will warp everyone from map [LuaNumber] back to village in [time] seconds

LuaFunc:
warp_all_to_village(LuaNumber map_index, LuaNumber time)
Returns
nil

◆ _warp_to_village()

int32_t quest::_warp_to_village ( lua_State *  L)

it will warp the current player back to village

LuaFunc:
warp_to_village()
Returns
nil

◆ affect_add()

int32_t quest::affect_add ( lua_State *  L)

it will add to the current pc the affect with apply bonus [apply_type] with value [value] for [duration] seconds (affect id AFFECT_QUEST_START_IDX)

LuaFunc:
affect.add(LuaNumber apply_type, LuaNumber value, LuaNumber duration)
Returns
nil

◆ affect_add_collect()

int32_t quest::affect_add_collect ( lua_State *  L)

it will add to the current pc the affect with apply bonus [apply_type] with value [value] for [duration] seconds (affect id AFFECT_COLLECT)

LuaFunc:
affect.add_collect(LuaNumber apply_type, LuaNumber value, LuaNumber duration)
Returns
nil

◆ affect_add_collect_point()

int32_t quest::affect_add_collect_point ( lua_State *  L)

it will add to the current pc the affect with point bonus [point_type] with value [value] for [duration] seconds (affect id AFFECT_COLLECT)

LuaFunc:
affect.add_collect(LuaNumber point_type, LuaNumber value, LuaNumber duration)
Returns
nil

◆ affect_add_hair()

int32_t quest::affect_add_hair ( lua_State *  L)

it will add to the current pc the affect with apply bonus [apply_type] with value [hair_id] for [duration] seconds (affect id AFFECT_HAIR)

LuaFunc:
affect.add_hair(LuaNumber apply_type, LuaNumber hair_id, LuaNumber duration)
Returns
nil

◆ affect_get_apply_on()

int32_t quest::affect_get_apply_on ( lua_State *  L)

lua will return the apply_type of the specified [affect_type] (cube type affects will still return the first entry, not the whole list)

LuaFunc:
affect.get_apply_on(LuaNumber affect_type)
Returns
[1] LuaNumber: the apply_type of the specified [affect_type] (cube type affects will still return the first entry, not the whole list), nil if missing

◆ affect_remove()

int32_t quest::affect_remove ( lua_State *  L)

it will remove from the current pc the affect with apply bonus [apply_type] (affect id AFFECT_QUEST_START_IDX+GetCurrentPC()->GetCurrentQuestIndex())

LuaFunc:
affect.remove(LuaNumber apply_type)
Returns
nil

◆ affect_remove_all_collect()

int32_t quest::affect_remove_all_collect ( lua_State *  L)

it will remove from the current pc all the AFFECT_COLLECT affects

LuaFunc:
affect.remove_all_collect()
Returns
nil

◆ affect_remove_bad()

int32_t quest::affect_remove_bad ( lua_State *  L)

it will remove from the current pc all the negative affects (skill debuffs, poison, bleeding, fire, stun, slow)

LuaFunc:
affect.remove_bad()
Returns
nil

◆ affect_remove_collect()

int32_t quest::affect_remove_collect ( lua_State *  L)

it will remove from the current pc the affect with apply bonus [apply_type] and value [value] (affect id AFFECT_COLLECT)

LuaFunc:
affect.remove_collect(LuaNumber apply_type, LuaNumber value)
Returns
nil

◆ affect_remove_good()

int32_t quest::affect_remove_good ( lua_State *  L)

it will remove from the current pc all the positive affects (skill buffs, potion buffs, firework buffs)

LuaFunc:
affect.remove_good()
Returns
nil

◆ affect_remove_hair()

int32_t quest::affect_remove_hair ( lua_State *  L)

it will remove from the current pc the affect AFFECT_HAIR

LuaFunc:
affect.remove_hair()
Returns
[1] LuaNumber: the remaining duration of the removed hair if found, 0 otherwise

◆ arena_add_map()

int32_t quest::arena_add_map ( lua_State *  L)

it will add an arena location in [map_index]; player A will spawn at the coordinates [startposAX],[startposAY] and player B at [startposBX],[startposBY]
Note: the observer point (where you will be warped if you want to see the fight) will be (PosA+PosB)/2

NewStuff:
added the return value (true if succeeded, false otherwise)
LuaFunc:
arena.add_map(LuaNumber map_index, LuaNumber startposAX, LuaNumber startposAY, LuaNumber startposBX, LuaNumber startposBY)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ arena_add_observer()

int32_t quest::arena_add_observer ( lua_State *  L)

the current player will be warped to the respective observer arena coordinates (you get them by using arena.get_duel_list)

NewStuff:
added the return value (true if succeeded, false otherwise)
LuaFunc:
arena.add_observer(LuaNumber map_index, LuaNumber observer_x, LuaNumber observer_y)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ arena_get_duel_list()

int32_t quest::arena_get_duel_list ( lua_State *  L)

lua will return the list of every arena duel

LuaFunc:
arena.get_duel_list()
Returns
[1] LuaTable[LuaString,LuaString,LuaNumber,LuaNumber,LuaNumber]: player A's name, player B's name, map_index, observer_x, observer_y
Note: the observer point (where you will be warped if you want to see the fight) will be (PosA+PosB)/2

◆ arena_is_in_arena()

int32_t quest::arena_is_in_arena ( lua_State *  L)

lua will return whether or not player [pid] is NOT in an arena map (must not be used for the contrary reason)

LuaFunc:
arena.is_in_arena(LuaNumber pid)
Returns
[1] LuaNumber: 0 if false, 1 any other cases ([pid] not found, [pid] is in arena observer_mode, [pid] is already arena dueling)

◆ arena_start_duel()

int32_t quest::arena_start_duel ( lua_State *  L)

it will start the duel between you and player [name]. The first who will get [total_rounds] wins, will win.

LuaFunc:
arena.start_duel(LuaString name, LuaNumber total_rounds)
Returns
[1] LuaNumber:
0 if you or player [name] don't exist;
1 if everything goes well;
2 if you or player [name] are not members of the arena map;
3 if the duel can't be started (already busy?);

◆ ba_start()

int32_t quest::ba_start ( lua_State *  L)

it will start the battle arena for the specific [empire]

LuaFunc:
ba.start(LuaNumber empire)
Returns
nil

◆ building_get_land_id()

int32_t quest::building_get_land_id ( lua_State *  L)

lua will return the id of the land in map [map_index] coordinates [map_x] [map_y] if found, otherwise 0

LuaFunc:
building.get_land_id(LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
Returns
[1] LuaNumber: the id of the land in map [map_index] coordinates [map_x] [map_y] if found, otherwise 0

◆ building_get_land_info()

int32_t quest::building_get_land_info ( lua_State *  L)

lua will return the info of the land [land_id]

LuaFunc:
building.get_land_info(LuaNumber land_id)
Returns
[1] LuaTable[LuaNumber,LuaNumber,LuaNumber]: price, guild_id and level_limit (1000000000,1000000000,1000000000 in case of failure)

◆ building_has_land()

int32_t quest::building_has_land ( lua_State *  L)

lua will return if the guild [guild_id] does NOT have a land (must not be used for the contrary reason)

LuaFunc:
building.has_land(LuaNumber guild_id)
Returns
[1] LuaBoolean: false if the guild has no land; true if [guild_id] is not a number, if the query failed, or if the count is higher than 0

◆ building_reconstruct()

int32_t quest::building_reconstruct ( lua_State *  L)

it will create or recreate the object [object_proto_id]'s npc and should only be used in the guild's land.
it will get the guild's id from the current npc and the land's id from the guild's id.
it will get the spawn coordinates from the object [object_proto_id]'s reg_1,reg_2 (initial x,y) reg_3,reg_4 (ending x,y) fields.
it's usually used for NPCs in the vnum range of 14000~14049, 20044~20046, 20060~20072 and 20077~20079.

LuaFunc:
building.reconstruct(LuaNumber object_proto_id)
Returns
nil
Used in:
guild_building_alter_of_power.quest, guild_building_melt.quest

◆ building_set_land_owner()

int32_t quest::building_set_land_owner ( lua_State *  L)

it will set the guild owner of the land [land_id] to [guild_id]

LuaFunc:
building.set_land_owner(LuaNumber land_id, LuaNumber guild_id)
Returns
nil

◆ dance_event_go_home()

int32_t quest::dance_event_go_home ( lua_State *  L)

it will warp back to village everyone inside the map index 115 in the coordinates startpos 764503~22807 endpos 772362~26499

LuaFunc:
dance_event.go_home()
Returns
nil

◆ dl_startRaid()

int32_t quest::dl_startRaid ( lua_State *  L)

it will start the dragon lair event in the current pc's map index for the current pc's guild id

LuaFunc:
DragonLair.startRaid()
Returns
nil

◆ ds_give_qualification()

int32_t quest::ds_give_qualification ( lua_State *  L)

it will give the dragon soul qualification for the current pc

LuaFunc:
ds.give_qualification()
Returns
nil

◆ ds_is_qualified()

int32_t quest::ds_is_qualified ( lua_State *  L)

lua will return 1 if the current pc has the dragon soul qualification, 0 otherwise

LuaFunc:
ds.give_qualification()
Returns
[1] LuaNumber: 1 if the current pc has the dragon soul qualification, 0 otherwise

◆ ds_open_refine_window()

int32_t quest::ds_open_refine_window ( lua_State *  L)

it will open the dragon soul refine window for the current pc

LuaFunc:
ds.open_refine_window()
Returns
nil

◆ dungeon_all_near_to()

int32_t quest::dungeon_all_near_to ( lua_State *  L)

it will warp everyone near the coordinates [map_x],[map_y] with a max distance of 30px

LuaFunc:
d.all_near_to(LuaNumber map_x, LuaNumber map_y)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ dungeon_check_eliminated()

int32_t quest::dungeon_check_eliminated ( lua_State *  L)

it there will be 0 monsters in the current dungeon, it will check if an exit or warp condition has been set, and creates the relative event runned after n seconds (specified by d.set_exit/warp_all_at_eliminate)

LuaFunc:
d.check_eliminated()
Returns
nil

◆ dungeon_clear_regen()

int32_t quest::dungeon_clear_regen ( lua_State *  L)

it will clear any regen of the current dungeon

LuaFunc:
d.clear_regen()
Returns
nil

◆ dungeon_count_monster()

int32_t quest::dungeon_count_monster ( lua_State *  L)

lua will return the count of the monsters residing in the current dungeon

LuaFunc:
d.count_monster()
Returns
[1] LuaNumber: the count of the monsters residing in the current dungeon, otherwise INT_MAX if out of dungeon

◆ dungeon_delete_item_in_item_group_from_all()

int32_t quest::dungeon_delete_item_in_item_group_from_all ( lua_State *  L)

it will warp out everyone who doesn't have at least one of the items of the [item_group_name] item group (in the current dungeon)

LuaFunc:
d.delete_item_in_item_group_from_all(LuaString item_group_name)
Returns
nil
See also
Some examples about its usage can be found in dungeon_say_diff_by_item_group()

◆ dungeon_exit()

int32_t quest::dungeon_exit ( lua_State *  L)

it will warp yourself to the saved exit location (not specifically in the current dungeon)

LuaFunc:
d.exit()
Returns
nil

◆ dungeon_exit_all()

int32_t quest::dungeon_exit_all ( lua_State *  L)

it will warp everyone to the saved exit location (in the current dungeon)

LuaFunc:
d.exit_all()
Returns
nil

◆ dungeon_exit_all_by_item_group()

int32_t quest::dungeon_exit_all_by_item_group ( lua_State *  L)

it will warp out everyone who doesn't have at least one of the items of the [item_group_name] item group (in the current dungeon)

LuaFunc:
d.exit_all_by_item_group(LuaString item_group_name)
Returns
nil
See also
Some examples about its usage can be found in dungeon_say_diff_by_item_group()

◆ dungeon_exit_all_to_start_position()

int32_t quest::dungeon_exit_all_to_start_position ( lua_State *  L)

it will warp out everyone to the start position (in the current dungeon)

LuaFunc:
d.exit_all_to_start_position()
Returns
nil

◆ dungeon_find()

int32_t quest::dungeon_find ( lua_State *  L)

lua will return whether or not the dungeon map [map_index] has been found

LuaFunc:
d.find(LuaNumber map_index)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ dungeon_get_damage_from_affect()

int32_t quest::dungeon_get_damage_from_affect ( lua_State *  L)

lua will return the list of any DamageAffectFlag of the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.get_damage_from_affect(LuaNumber mob_vid)
NewStuff:
d.get_damage_from_affect(LuaNumber mob_vid)
New LuaFunc:
d.get_damage_from_affect(LuaNumber mob_vid)
Returns
[1] LuaTable[LuaNumber]: the list of any DamageAffectFlag of the mob [mob_vid]; nil if the [mob_vid] parameter is missing

◆ dungeon_get_damage_from_race()

int32_t quest::dungeon_get_damage_from_race ( lua_State *  L)

lua will return the DamageRaceFlag of the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.get_damage_from_race(LuaNumber mob_vid)
NewStuff:
d.get_damage_from_race(LuaNumber mob_vid)
New LuaFunc:
d.get_damage_from_race(LuaNumber mob_vid)
Returns
[1] LuaNumber: the DamageRaceFlag of the mob [mob_vid], 0 if [mob_vid] is not found; nil if the [mob_vid] parameter is missing

◆ dungeon_get_flag()

int32_t quest::dungeon_get_flag ( lua_State *  L)

lua will return the current dungeon's flag [flag_name]'s value

LuaFunc:
d.getf(LuaString flag_name)
Returns
[1] LuaNumber: the current dungeon's flag [flag_name]'s value

◆ dungeon_get_flag_from_map_index()

int32_t quest::dungeon_get_flag_from_map_index ( lua_State *  L)

lua will return the dungeon [map_index]'s flag [flag_name]'s value

LuaFunc:
d.getf_from_map_index(LuaString flag_name, LuaNumber map_index)
Returns
[1] LuaNumber: the dungeon [map_index]'s flag [flag_name]'s value

◆ dungeon_get_kill_mob_count()

int32_t quest::dungeon_get_kill_mob_count ( lua_State *  L)

lua will return the count of every monster destroyed in the current dungeon
[unk1] and [unk2] are unused, but required, otherwise it will return 0 (two random numbers is enough)

LuaFunc:
d.get_kill_stone_count(LuaNumber unk1, LuaNumber unk2)
Returns
[1] LuaNumber: the count of every monster destroyed in the current dungeon

◆ dungeon_get_kill_stone_count()

int32_t quest::dungeon_get_kill_stone_count ( lua_State *  L)

lua will return the count of every metin stone destroyed in the current dungeon
[unk1] and [unk2] are unused, but required, otherwise it will return 0 (two random numbers is enough)

LuaFunc:
d.get_kill_stone_count(LuaNumber unk1, LuaNumber unk2)
Returns
[1] LuaNumber: the count of every metin stone destroyed in the current dungeon

◆ dungeon_get_map_index()

int32_t quest::dungeon_get_map_index ( lua_State *  L)

lua will return the current dungeon's map index

LuaFunc:
d.get_map_index()
Returns
[1] LuaNumber: the current dungeon's map index

◆ dungeon_get_unique_vid()

int32_t quest::dungeon_get_unique_vid ( lua_State *  L)

lua will return the vid of the specific [unique_name] monster (in the current dungeon)

LuaFunc:
d.get_unique_vid(LuaString unique_name)
Returns
[1] LuaNumber: the vid of the specific [unique_name] monster, otherwise 0

◆ dungeon_is_available0()

int32_t quest::dungeon_is_available0 ( lua_State *  L)

lua will return true if the current dungeon is not nullptr, false otherwise

LuaFunc:
d.is_available0()
NewStuff:
d.is_available0()
New LuaFunc:
d.is_available0()
LuaFunc:
d.is_available()
NewStuff:
d.is_available()
New LuaFunc:
d.is_available()
Returns
[1] LuaBoolean: true if the current dungeon is not nullptr, false otherwise

◆ dungeon_is_unique_dead()

int32_t quest::dungeon_is_unique_dead ( lua_State *  L)

lua will return whether or not the unique mob [unique_name] dungeon is dead (in the current dungeon)

LuaFunc:
d.is_unique_dead(LuaString unique_name)
Returns
[1] LuaBoolean: true if the unique mob [unique_name] is dead, false otherwise

◆ dungeon_is_use_potion()

int32_t quest::dungeon_is_use_potion ( lua_State *  L)

lua will return false if you cannot use potions in the current dungeon, true otherwise (don't use it for the contrary reason)
[unk1] and [unk2] are unused, but required, otherwise it will return true (two random numbers is enough)

LuaFunc:
d.is_use_potion(LuaNumber unk1, LuaNumber unk2)
Returns
[1] LuaBoolean: false if you cannot use potions in the current dungeon, true otherwise

◆ dungeon_join()

int32_t quest::dungeon_join ( lua_State *  L)

it will create a dungeon in [map_index] and warp yourself (or your whole party if near) into it
this function is famous for being instable, use d.new_jump and d.new_jump_party altogether with party.is_party() instead

LuaFunc:
d.join(LuaNumber map_index)
Returns
nil

◆ dungeon_jump_all()

int32_t quest::dungeon_jump_all ( lua_State *  L)

it will warp you and every party member of yours in the current dungeon at [world_x] [world_y] coordinates (no uiloading refresh)

LuaFunc:
d.jump_all(LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ dungeon_kill_all()

int32_t quest::dungeon_kill_all ( lua_State *  L)

it will kill every monster in the current dungeon

LuaFunc:
d.kill_all()
Returns
nil

◆ dungeon_kill_area()

int32_t quest::dungeon_kill_area ( lua_State *  L)

it will kill all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY] (in the current dungeon)

LuaFunc:
d.kill_area(LuaNumber StartPosX, LuaNumber StartPosY, LuaNumber EndPosX, LuaNumber EndPosY)
NewStuff:
d.kill_area(LuaNumber StartPosX, LuaNumber StartPosY, LuaNumber EndPosX, LuaNumber EndPosY)
New LuaFunc:
d.kill_area(LuaNumber StartPosX, LuaNumber StartPosY, LuaNumber EndPosX, LuaNumber EndPosY)
Returns
nil

◆ dungeon_kill_unique()

int32_t quest::dungeon_kill_unique ( lua_State *  L)

it will kill the unique mob [unique_name] (in the current dungeon)

LuaFunc:
d.kill_unique(LuaString unique_name)
Returns
nil

◆ dungeon_new_jump()

int32_t quest::dungeon_new_jump ( lua_State *  L)

it will create a new dungeon instance from map [map_index] and warp yourself to the generated map at [world_x] [world_y] coordinates

LuaFunc:
d.new_jump(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ dungeon_new_jump_all()

int32_t quest::dungeon_new_jump_all ( lua_State *  L)

it will create a new dungeon instance from map [map_index] and warp you and everyone else of your current map to the generated map at [world_x] [world_y] coordinates

LuaFunc:
d.new_jump_all(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ dungeon_new_jump_guild()

int32_t quest::dungeon_new_jump_guild ( lua_State *  L)

it will create a new dungeon instance from map [map_index] and warp you and every guild member of yours of your current map to the generated map at [world_x] [world_y] coordinates

LuaFunc:
d.new_jump_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
NewStuff:
d.new_jump_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
New LuaFunc:
d.new_jump_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
LuaFunc:
d.new_jump_all_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
NewStuff:
d.new_jump_all_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
New LuaFunc:
d.new_jump_all_guild(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ dungeon_new_jump_party()

int32_t quest::dungeon_new_jump_party ( lua_State *  L)

it will create a new dungeon instance from map [map_index] and warp you and every party member of yours of your current map to the generated map at [world_x] [world_y] coordinates

LuaFunc:
d.new_jump_party(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ dungeon_notice()

int32_t quest::dungeon_notice ( lua_State *  L)

it will send a notice [text] inside the current dungeon

LuaFunc:
d.notice(LuaString text)
Returns
nil

◆ dungeon_purge()

int32_t quest::dungeon_purge ( lua_State *  L)

it will purge (destroy/make disappear) every monster in the current dungeon

LuaFunc:
d.purge()
Returns
nil

◆ dungeon_purge_area()

int32_t quest::dungeon_purge_area ( lua_State *  L)

it will purge (destroy/make disappear) all the monsters in the square range [StartPosX],[StartPosY] until [EndPosX],[EndPosY] (in the current dungeon)

LuaFunc:
d.purge_area(LuaNumber StartPosX, LuaNumber StartPosY, LuaNumber EndPosX, LuaNumber EndPosY)
Returns
nil

◆ dungeon_purge_unique()

int32_t quest::dungeon_purge_unique ( lua_State *  L)

it will purge (destroy/make disappear) the unique mob [unique_name] (in the current dungeon)

LuaFunc:
d.purge_unique(LuaString unique_name)
Returns
nil

◆ dungeon_regen_file()

int32_t quest::dungeon_regen_file ( lua_State *  L)

it will read and spawn ONCE the regen file [regen_filename], respawn event NOT included, in the current dungeon

LuaFunc:
d.regen_file(LuaString regen_filename)
Returns
nil

◆ dungeon_reset_damage_from_affect()

int32_t quest::dungeon_reset_damage_from_affect ( lua_State *  L)

it will remove all the DamageAffectFlag from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.reset_damage_from_affect(LuaNumber mob_vid)
NewStuff:
d.reset_damage_from_affect(LuaNumber mob_vid)
New LuaFunc:
d.reset_damage_from_affect(LuaNumber mob_vid)
Returns
nil

◆ dungeon_reset_damage_from_race()

int32_t quest::dungeon_reset_damage_from_race ( lua_State *  L)

it will remove all the DamageRaceFlag from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.reset_damage_from_race(LuaNumber mob_vid)
NewStuff:
d.reset_damage_from_race(LuaNumber mob_vid)
New LuaFunc:
d.reset_damage_from_race(LuaNumber mob_vid)
Returns
nil

◆ dungeon_revived()

int32_t quest::dungeon_revived ( lua_State *  L)

lua will return false if you cannot be revived in the current dungeon, true otherwise (don't use it for the contrary reason)
[unk1] and [unk2] are unused, but required, otherwise it will return true (two random numbers is enough)

LuaFunc:
d.revived(LuaNumber unk1, LuaNumber unk2)
Returns
[1] LuaBoolean: false if you cannot be revived in the current dungeon, true otherwise

◆ dungeon_say_diff_by_item_group()

int32_t quest::dungeon_say_diff_by_item_group ( lua_State *  L)

it will show to everyone in the current dungeon the [can_proceed_text] say if individually they have at least one of the items of the [item_group_name] item group
otherwise they will get the [cannot_proceed_text] say and will be warped out of the current dungeon

LuaFunc:
d.say_diff_by_item_group(LuaString item_group_name, LuaString can_proceed_text, LuaString cannot_proceed_text)
Returns
nil
Examples:
function d.check_item_list()
--[[its structure must be vnum1,count1,vnum2,count2]]
local item_list = {
27001,1, --[[1x red potion small]]
27004,3, --[[3x blue potion small]]
}
--[[set up the required item list]]
d.set_item_group("required_items", table.getn(item_list)/2, unpack(item_list))
--[[warn everyone that they don't match the requirements]]
d.say_diff_by_item_group("required_items", "You have all the items, so you proceed", "You don't have the items, so you will be warped out right now")
--[[exclude everyone that doesn't match the requirements]]
d.exit_all_by_item_group("required_items")
--[[delete the required items]]
d.delete_item_in_item_group_from_all("required_items")
end

◆ dungeon_select()

int32_t quest::dungeon_select ( lua_State *  L)

it will set the dungeon map [map_index] as the current dungeon

LuaFunc:
d.select(LuaNumber map_index)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ dungeon_set_damage_from_affect()

int32_t quest::dungeon_set_damage_from_affect ( lua_State *  L)

it will append the DamageAffectFlag [damage_affect_flag] to the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.set_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
NewStuff:
d.set_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
New LuaFunc:
d.set_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
Returns
nil

◆ dungeon_set_damage_from_race()

int32_t quest::dungeon_set_damage_from_race ( lua_State *  L)

it will append the DamageRaceFlag [damage_race_flag] to the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.set_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
NewStuff:
d.set_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
New LuaFunc:
d.set_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
Returns
nil

◆ dungeon_set_dest()

int32_t quest::dungeon_set_dest ( lua_State *  L)

it will move your current dungeon's party to the local [map_x] and [map_y] coordinates, no refresh (mostly client-side)

LuaFunc:
d.set_dest(LuaNumber map_x, LuaNumber map_y)
Returns
nil

◆ dungeon_set_exit_all_at_eliminate()

int32_t quest::dungeon_set_exit_all_at_eliminate ( lua_State *  L)

it will set an exit all condition after [seconds] in the current dungeon; it's triggered by d.check_eliminated and only if there is no monster left.

LuaFunc:
d.set_exit_all_at_eliminate(LuaNumber seconds)
Returns
nil

◆ dungeon_set_flag()

int32_t quest::dungeon_set_flag ( lua_State *  L)

it will change the current dungeon's flag [flag_name] to [flag_value]

LuaFunc:
d.setf(LuaString flag_name, LuaNumber flag_value)
Returns
nil

◆ dungeon_set_item_group()

int32_t quest::dungeon_set_item_group ( lua_State *  L)

it will set the item group [item_group_name] with [total_count] elements and for each of them two additional [item_vnum],[item_count] arguments

LuaFunc:
d.set_item_group(LuaString item_group_name, LuaNumber total_count, [LuaNumber item_vnum, LuaNumber item_count]...)
Returns
nil
See also
Some examples about its usage can be found in dungeon_say_diff_by_item_group()

◆ dungeon_set_quest_flag()

int32_t quest::dungeon_set_quest_flag ( lua_State *  L)

it will change the current quest's [flag_name] to [flag_value] from everyone inside the current dungeon

LuaFunc:
d.setqf(LuaString flag_name, LuaNumber flag_value)
Returns
nil

◆ dungeon_set_quest_flag2()

int32_t quest::dungeon_set_quest_flag2 ( lua_State *  L)

it will change the [quest_name]'s [flag_name] to [flag_value] from everyone inside the current dungeon

LuaFunc:
d.setqf2(LuaString quest_name, LuaString flag_name, LuaNumber flag_value)
Returns
nil

◆ dungeon_set_regen_file()

int32_t quest::dungeon_set_regen_file ( lua_State *  L)

it will read and spawn the regen file [regen_filename], respawn event included, in the current dungeon

LuaFunc:
d.regen_file(LuaString regen_filename)
Returns
nil

◆ dungeon_set_unique()

int32_t quest::dungeon_set_unique ( lua_State *  L)

it will set to the monster [mob_vid] the unique name [unique_name] (in the current dungeon)

LuaFunc:
d.set_unique(LuaString unique_name, LuaNumber mob_vid)
Returns
nil

◆ dungeon_set_warp_at_eliminate()

int32_t quest::dungeon_set_warp_at_eliminate ( lua_State *  L)

it will set a warp all condition after [seconds] to map [map_index] coordinates [map_x] [map_y], inside the current dungeon;
it's triggered either by d.check_eliminated when there is no monster left or if [regen_filename] has been cleared

LuaFunc:
d.set_warp_at_eliminate(LuaNumber seconds, LuaNumber map_index, LuaNumber map_x, LuaNumber map_y, [LuaString regen_filename=nullptr])
Returns
nil

◆ dungeon_set_warp_location()

int32_t quest::dungeon_set_warp_location ( lua_State *  L)

it will set the warp location to map [map_index] in the coordinates [map_x],[map_y]

LuaFunc:
d.set_warp_location(LuaNumber map_index, LuaNumber map_x, LuaNumber map_y)
Returns
nil

◆ dungeon_spawn()

int32_t quest::dungeon_spawn ( lua_State *  L)

it will spawn the monster [mob_vnum] in the area [area_name] (in the current dungeon)

LuaFunc:
d.spawn(LuaNumber mob_vnum, LuaString area_name)
Returns
nil

◆ dungeon_spawn_goto_mob()

int32_t quest::dungeon_spawn_goto_mob ( lua_State *  L)

it will spawn a mob (vnum 20039) in the square range from [from_x][from_y] to [to_x][to_y]

LuaFunc:
d.spawn_goto_mob(LuaNumber from_x, LuaNumber from_y, LuaNumber to_x, LuaNumber to_y)
Returns
nil

◆ dungeon_spawn_group()

int32_t quest::dungeon_spawn_group ( lua_State *  L)

it will spawn the mob group [group_vnum] in [map_x][map_y] with radius [radius] and the aggressive flag as [is_aggressive] for [count] times
the [radius] isn't fundamental, even 0 for it is enough

LuaFunc:
d.spawn_group(LuaNumber group_vnum, LuaNumber map_x, LuaNumber map_y, LuaNumber radius, LuaBoolean is_aggressive, LuaNumber count)
Returns
[1] LuaNumber: the vid of the first spawned monster, 0 if failed; nil if the function arguments are not specified

◆ dungeon_spawn_mob()

int32_t quest::dungeon_spawn_mob ( lua_State *  L)

it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] (in the current dungeon)
if [radius] is specified, the spawn coordinates will be affect by a little
if [count] is specified, there will be spawned a total of [count] mobs instead of one, and the returned vid will be the one of the first spawned one

LuaFunc:
d.spawn_mob(LuaNumber mob_vnum, LuaNumber map_x, LuaNumber map_y, [LuaNumber radius=0], [LuaNumber count=1])
Returns
[1] LuaNumber: the vid of the spawned monster, 0 if failed; nil if the function arguments are not specified

◆ dungeon_spawn_mob_ac_dir()

int32_t quest::dungeon_spawn_mob_ac_dir ( lua_State *  L)

it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] and in the direction of [direction] (in the current dungeon)
the spawned monster will have no spawn effect

LuaFunc:
d.spawn_mob_ac_dir(LuaNumber mob_vnum, LuaNumber map_x, LuaNumber map_y, LuaNumber direction)
Returns
[1] LuaNumber: the vid of the spawned monster, 0 if failed; nil if the function arguments are not specified

◆ dungeon_spawn_mob_dir()

int32_t quest::dungeon_spawn_mob_dir ( lua_State *  L)

it will spawn a mob [mob_vnum] in the coordinates [map_x][map_y] and in the direction of [direction] (in the current dungeon)

LuaFunc:
d.spawn_mob_dir(LuaNumber mob_vnum, LuaNumber map_x, LuaNumber map_y, LuaNumber direction)
Returns
[1] LuaNumber: the vid of the spawned monster, 0 if failed; nil if the function arguments are not specified

◆ dungeon_spawn_move_group()

int32_t quest::dungeon_spawn_move_group ( lua_State *  L)

it will spawn a monster group [group_id] in the area [pos_from],[pos_to] (in the current dungeon)

LuaFunc:
d.spawn_move_group(LuaNumber group_id, LuaString pos_from, LuaString pos_to)
Returns
nil

◆ dungeon_spawn_move_unique()

int32_t quest::dungeon_spawn_move_unique ( lua_State *  L)

it will spawn the monster [mob_vnum] with unique name [unique_name] in the area [pos_from],[pos_to] (in the current dungeon)

LuaFunc:
d.spawn_move_unique(LuaString unique_name, LuaNumber mob_vnum, LuaString pos_from, LuaString pos_to)
Returns
nil

◆ dungeon_spawn_name_mob()

int32_t quest::dungeon_spawn_name_mob ( lua_State *  L)

it will spawn a mob [mob_vnum] in [map_x][map_y] with the name [name] (mostly, for NPCs)

LuaFunc:
d.spawn_name_mob(LuaNumber mob_vnum, LuaNumber map_x, LuaNumber map_y, LuaString name)
Returns
nil

◆ dungeon_spawn_stone_door()

int32_t quest::dungeon_spawn_stone_door ( lua_State *  L)

it will spawn a stone door (vnum 13001) with the unique name [unique_name] in the area name [area_name] (in the current dungeon)

LuaFunc:
d.spawn_stone_door(LuaString unique_name, LuaString area_name)
Returns
nil

◆ dungeon_spawn_unique()

int32_t quest::dungeon_spawn_unique ( lua_State *  L)

it will spawn the monster [mob_vnum] with unique name [unique_name] in the area [area_name] (in the current dungeon)

LuaFunc:
d.spawn_unique(LuaString unique_name, LuaNumber mob_vnum, LuaString area_name)
Returns
nil

◆ dungeon_spawn_wooden_door()

int32_t quest::dungeon_spawn_wooden_door ( lua_State *  L)

it will spawn a wooden door (vnum 13000) with the unique name [unique_name] in the area name [area_name] (in the current dungeon)
its hp/max_hp are hardcoded to 10000, and def grade to 300 (unique bonus)

LuaFunc:
d.spawn_wooden_door(LuaString unique_name, LuaString area_name)
Returns
nil

◆ dungeon_unique_get_hp_perc()

int32_t quest::dungeon_unique_get_hp_perc ( lua_State *  L)

lua will return the unique mob [unique_name]'s hp percent (in the current dungeon)

LuaFunc:
d.unique_get_hp_perc(LuaString unique_name)
Returns
[1] LuaNumber: the unique mob [unique_name]'s hp percent

◆ dungeon_unique_set_def_grade()

int32_t quest::dungeon_unique_set_def_grade ( lua_State *  L)

it will set the unique mob [unique_name]'s def_grade to [def_grade] (in the current dungeon)

LuaFunc:
d.unique_set_def_grade(LuaString unique_name, LuaNumber def_grade)
Returns
nil

◆ dungeon_unique_set_hp()

int32_t quest::dungeon_unique_set_hp ( lua_State *  L)

it will set the unique mob [unique_name]'s hp to [hp] (in the current dungeon)

LuaFunc:
d.unique_set_hp(LuaString unique_name, LuaNumber hp)
Returns
nil

◆ dungeon_unique_set_maxhp()

int32_t quest::dungeon_unique_set_maxhp ( lua_State *  L)

it will set the unique mob [unique_name]'s max hp to [max_hp] (in the current dungeon)

LuaFunc:
d.unique_set_maxhp(LuaString unique_name, LuaNumber max_hp)
Returns
nil

◆ dungeon_unset_damage_from_affect()

int32_t quest::dungeon_unset_damage_from_affect ( lua_State *  L)

it will remove the DamageAffectFlag [damage_affect_flag] from the mob [mob_vid]

LuaFunc:
d.unset_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
NewStuff:
d.unset_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
New LuaFunc:
d.unset_damage_from_affect(LuaNumber mob_vid, LuaNumber damage_affect_flag)
Returns
nil

◆ dungeon_unset_damage_from_race()

int32_t quest::dungeon_unset_damage_from_race ( lua_State *  L)

it will remove the DamageRaceFlag [damage_race_flag] from the mob [mob_vid]
available even outside of dungeons, like with the return of the spawn_mob0 func

LuaFunc:
d.unset_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
NewStuff:
d.unset_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
New LuaFunc:
d.unset_damage_from_race(LuaNumber mob_vid, LuaNumber damage_race_flag)
Returns
nil

◆ dungeon_warp_all()

int32_t quest::dungeon_warp_all ( lua_State *  L)

it will warp you and every party member of yours in the current dungeon at [world_x] [world_y] coordinates (there will be a uiloading refresh)

LuaFunc:
d.warp_all(LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ empire_info()

int32_t quest::empire_info ( lua_State *  L)

if the current player is a monarch, it will print to him the relative empire's money

LuaFunc:
oh.info()
Returns
nil

◆ forked_get_dead_count()

int32_t quest::forked_get_dead_count ( lua_State *  L)

lua will return the current player's dead count (threeway event)

LuaFunc:
forked.getdeadcount()
Returns
[1] LuaNumber: the current player's dead count

◆ forked_get_kill_score0()

int32_t quest::forked_get_kill_score0 ( lua_State *  L)

lua will return the kill score of the specific [empire] (threeway event)

LuaFunc:
forked.get_kill_score0(LuaNumber empire)
NewStuff:
forked.get_kill_score0(LuaNumber empire)
New LuaFunc:
forked.get_kill_score0(LuaNumber empire)
LuaFunc:
forked.get_kill_score(LuaNumber empire)
NewStuff:
forked.get_kill_score(LuaNumber empire)
New LuaFunc:
forked.get_kill_score(LuaNumber empire)
Returns
[1] LuaBoolean: the kill score of the specific [empire]

◆ forked_get_pass_path_by_empire()

int32_t quest::forked_get_pass_path_by_empire ( lua_State *  L)

lua will return the map_index of the empire [empire]'s forked pass path map

LuaFunc:
forked.getpasspathbyempire(LuaNumber empire)
Returns
[1] LuaNumber: the map_index of the empire [empire]'s forked pass path map

◆ forked_get_pass_path_my_empire()

int32_t quest::forked_get_pass_path_my_empire ( lua_State *  L)

lua will return the map_index of the current player's forked pass path map

LuaFunc:
none
Returns
[1] LuaNumber: the map_index of the current player's forked pass path map

◆ forked_init()

int32_t quest::forked_init ( lua_State *  L)

it will initialize the threeway event and choose a random event map

LuaFunc:
forked.initforked()
Returns
nil

◆ forked_init_kill_count_per_empire()

int32_t quest::forked_init_kill_count_per_empire ( lua_State *  L)

it will set the current player's empire's score to 0 (threeway event)

LuaFunc:
forked.initkillcount()
Returns
nil

◆ forked_is_forked_mapindex()

int32_t quest::forked_is_forked_mapindex ( lua_State *  L)

lua will return true if [map_index] is a threeway war map, false otherwise

LuaFunc:
forked.isforkedmapindex(LuaNumber map_index)
Returns
[1] LuaBoolean: true if [map_index] is a threeway war map, false otherwise

◆ forked_is_registered_user()

int32_t quest::forked_is_registered_user ( lua_State *  L)

lua will return true if the current player is a registered threeway user, otherwise false

LuaFunc:
forked.is_registered_user()
Returns
[1] LuaBoolean: true if the current player is a registered threeway user, otherwise false

◆ forked_is_sungzi_mapindex()

int32_t quest::forked_is_sungzi_mapindex ( lua_State *  L)

lua will return true if [map_index] is a sungzi war map, false otherwise

LuaFunc:
forked.issungzimapindex(LuaNumber map_index)
Returns
[1] LuaBoolean: true if [map_index] is a sungzi war map, false otherwise

◆ forked_pass_mapindex_by_empire()

int32_t quest::forked_pass_mapindex_by_empire ( lua_State *  L)

lua will return the map_index of the empire [empire]'s forked pass map

LuaFunc:
forked.getpassmapindexbyempire(LuaNumber empire)
Returns
[1] LuaNumber: the map_index of the empire [empire]'s forked pass map

◆ forked_pass_start_pos()

int32_t quest::forked_pass_start_pos ( lua_State *  L)

lua will return the initial position of the current player's empire's forked pass map

LuaFunc:
forked.get_pass_start_pos()
Returns
[1] LuaNumber: the initial map_x position of the current player's empire's forked pass map
[2] LuaNumber: the initial map_y position of the current player's empire's forked pass map

◆ forked_purge_all_monsters()

int32_t quest::forked_purge_all_monsters ( lua_State *  L)

it will purge (destroy/make disappear) all the monsters in the threeway event

LuaFunc:
forked.purge_all_monsters()
Returns
nil

◆ forked_register_user()

int32_t quest::forked_register_user ( lua_State *  L)

it will register the current player as threeway user

LuaFunc:
forked.register_user()
Returns
nil

◆ forked_set_dead_count()

int32_t quest::forked_set_dead_count ( lua_State *  L)

it will set the current player's dead count to the event flag's "threeway_war_dead_count"

LuaFunc:
forked.setdeadcount()
Returns
nil

◆ forked_sungzi_mapindex()

int32_t quest::forked_sungzi_mapindex ( lua_State *  L)

lua will return the map_index of the current player's empire's forked sungzi map

LuaFunc:
forked.getsungzimapindex()
Returns
[1] LuaNumber: the map_index of the current player's empire's forked sungzi map

◆ forked_sungzi_start_pos()

int32_t quest::forked_sungzi_start_pos ( lua_State *  L)

lua will return the initial position of the current player's empire's forked sungzi map

LuaFunc:
forked.get_sungzi_start_pos()
Returns
[1] LuaNumber: the initial map_x position of the current player's empire's forked sungzi map
[2] LuaNumber: the initial map_y position of the current player's empire's forked sungzi map

◆ forked_warp_all_in_map()

int32_t quest::forked_warp_all_in_map ( lua_State *  L)

it will warp everyone from [from_map_index] to the (not necessarily threeway map) [to_map_index] in the coordinates [map_x][map_y] in [seconds] seconds

LuaFunc:
forked.warp_all_in_map(LuaNumber from_map_index, LuaNumber to_map_index, LuaNumber map_x, LuaNumber map_y, LuaNumber seconds)
Returns
nil

◆ frog_to_empire_money()

int32_t quest::frog_to_empire_money ( lua_State *  L)

if the current player is a monarch, it will spawn the castle frog (vnum 11505) in the relative empire castle for 100kk empire's money

LuaFunc:
oh.frog_to_empire_money()
Returns
nil

◆ game_drop_item()

int32_t quest::game_drop_item ( lua_State *  L)

it will create an item [item_vnum] with count [count] on the ground beside the current player

LuaFunc:
game.drop_item(LuaNumber item_vnum, LuaNumber count)
Returns
nil

◆ game_drop_item_with_ownership()

int32_t quest::game_drop_item_with_ownership ( lua_State *  L)

it will create an item [item_vnum] with count [count] on the ground beside the current player
it will have the ownership set to the current player for [ownership_duration] seconds (10 if not specified)

LuaFunc:
game.drop_item_with_ownership(LuaNumber item_vnum, LuaNumber count, [LuaNumber ownership_duration=10])
Returns
nil

◆ game_drop_item_with_ownership_and_dice()

int32_t quest::game_drop_item_with_ownership_and_dice ( lua_State *  L)

it will create an item [item_vnum] with count [count] on the ground beside the current player
it will have the ownership set to the current player for [ownership_duration] seconds (10 if not specified)
if the player has a party, the item will be rolled amongst them (check party.is_party() to be sure you're not giving it to the player alone)

LuaFunc:
game.drop_item_with_ownership_and_dice(LuaNumber item_vnum, LuaNumber count, [LuaNumber ownership_duration=10])
NewStuff:
game.drop_item_with_ownership_and_dice(LuaNumber item_vnum, LuaNumber count, [LuaNumber ownership_duration=10])
New LuaFunc:
game.drop_item_with_ownership_and_dice(LuaNumber item_vnum, LuaNumber count, [LuaNumber ownership_duration=10])
Returns
nil

◆ game_get_event_flag()

int32_t quest::game_get_event_flag ( lua_State *  L)

lua will return the event name [event_name]'s value

LuaFunc:
game.set_event_flag(LuaString event_name)
Returns
[1] LuaNumber: the event name [event_name]'s value

◆ game_get_safebox_level()

int32_t quest::game_get_safebox_level ( lua_State *  L)

lua will return the current player's safebox level

LuaFunc:
game.get_safebox_level()
Returns
[1] LuaNumber: the current player's safebox level

◆ game_open_mall()

int32_t quest::game_open_mall ( lua_State *  L)

it will open the current player's mall (itemshop) login window

LuaFunc:
game.open_mall()
Returns
nil

◆ game_open_safebox()

int32_t quest::game_open_safebox ( lua_State *  L)

it will open the current player's safebox login window

LuaFunc:
game.open_safebox()
Returns
nil

◆ game_request_make_guild()

int32_t quest::game_request_make_guild ( lua_State *  L)

it will open the client-side guild make window

LuaFunc:
game.request_make_guild()
Returns
nil

◆ game_set_event_flag()

int32_t quest::game_set_event_flag ( lua_State *  L)

it will set the event name [event_name] with the value [event_value]

LuaFunc:
game.set_event_flag(LuaString event_name, LuaString event_value)
Returns
nil

◆ game_set_safebox_level()

int32_t quest::game_set_safebox_level ( lua_State *  L)

it will set the current player's safebox level to [safebox_level

LuaFunc:
game.set_safebox_level(LuaNumber safebox_level)
Returns
nil

◆ game_web_mall()

int32_t quest::game_web_mall ( lua_State *  L)

it will open the current player's web mall (itemshop page) window

LuaFunc:
game.open_web_mall()
Returns
nil

◆ guild_add_comment0()

int32_t quest::guild_add_comment0 ( lua_State *  L)

it will add a comment [comment] in the current player's guild's board (the author is current player's name)

LuaFunc:
guild.add_comment0(LuaString comment)
NewStuff:
guild.add_comment0(LuaString comment)
New LuaFunc:
guild.add_comment0(LuaString comment)
LuaFunc:
guild.add_comment(LuaString comment)
NewStuff:
guild.add_comment(LuaString comment)
New LuaFunc:
guild.add_comment(LuaString comment)
Returns
nil

◆ guild_around_ranking_string()

int32_t quest::guild_around_ranking_string ( lua_State *  L)

lua will return a colored guild members' rank as say text of the current player's guild

LuaFunc:
guild.around_ranking_string()
Returns
[1] LuaString: a colored guild members' rank as say text of the current player's guild
Used in:
guild_ranking.quest

◆ guild_change_master()

int32_t quest::guild_change_master ( lua_State *  L)

it will change the current player's guild master to player [name]

LuaFunc:
guild.change_master(LuaString name)
Returns
[1] LuaNumber: 0 if wrong args, 1 if the current player is not the guild leader, 2 if it couldn't internally switch leader, 3 if succeeded, 4 if the current player has no guild

◆ guild_change_master_with_limit()

int32_t quest::guild_change_master_with_limit ( lua_State *  L)

it will change the current player's guild master to player [name].

LuaFunc:
guild.change_master_with_limit(LuaString name, LuaNumber min_level, LuaNumber resign_limit, LuaNumber be_other_leader, LuaNumber be_other_member, LuaBoolean skip_cooldown_check)
In details:
  • the player [name]'s level must be >= [min_level]
  • if [skip_cooldown_check] is true, it will skip to check the "be_other_leader" and "be_other_member" flags
  • the "change_guild_master.be_other_member" and "change_guild_master.resign_limit" quest flags have no usefulness in the source code, but they are only considered in the real quests
  • the flag "change_guild_master.resign_limit"=[resign_limit] will be assigned to the new guild master, and "change_guild_master.be_other_leader"=[be_other_leader] and "change_guild_master.be_other_member"=[be_other_member] to the previous guild master
  • the flag "change_guild_master.resign_limit"=0 will be assigned to the previous guild master, and "change_guild_master.be_other_leader"=0 and "change_guild_master.be_other_member"=0 to the new guild master
Returns
[1] LuaNumber:
     0 if wrong args,
     1 if the current player is not the guild leader,
     2 if it couldn't internally switch leader,
     3 if the leadership has been switched successfully,
     4 if the current player has no guild,
     5 if the new guild master doesn't exist,
     6 if the new guild's master's level is lower than [min_level]
     7 if the new guild's master's "change_guild_master.be_other_leader" quest flag is higher than the current machine time
Used in:
change_guild_master.quest

◆ guild_get_any_war()

int32_t quest::guild_get_any_war ( lua_State *  L)

lua will return the opponent guild's id of the current player's guild

LuaFunc:
guild.get_any_war()
Returns
[1] LuaNumber: the opponent guild's id

◆ guild_get_draw_count0()

int32_t quest::guild_get_draw_count0 ( lua_State *  L)

lua will return the current player's guild's draw count

LuaFunc:
guild.get_draw_count0()
NewStuff:
guild.get_draw_count0()
New LuaFunc:
guild.get_draw_count0()
LuaFunc:
guild.get_draw_count()
NewStuff:
guild.get_draw_count()
New LuaFunc:
guild.get_draw_count()
Returns
[1] LuaNumber: the current player's guild's draw count

◆ guild_get_exp_level0()

int32_t quest::guild_get_exp_level0 ( lua_State *  L)

lua will return the needed exp for levelling up a guild to level [level]

LuaFunc:
guild.get_exp_level0(LuaNumber level)
NewStuff:
guild.get_exp_level0(LuaNumber level)
New LuaFunc:
guild.get_exp_level0(LuaNumber level)
LuaFunc:
guild.get_exp_level(LuaNumber level)
NewStuff:
guild.get_exp_level(LuaNumber level)
New LuaFunc:
guild.get_exp_level(LuaNumber level)
Returns
[1] LuaNumber: the needed exp for levelling up a guild to level [level]

◆ guild_get_id0()

int32_t quest::guild_get_id0 ( lua_State *  L)

lua will return the current player's guild's id

LuaFunc:
guild.get_id0()
NewStuff:
guild.get_id0()
New LuaFunc:
guild.get_id0()
LuaFunc:
guild.get_id()
NewStuff:
guild.get_id()
New LuaFunc:
guild.get_id()
Returns
[1] LuaNumber: the current player's guild's id, 0 otherwise

◆ guild_get_ladder_point()

int32_t quest::guild_get_ladder_point ( lua_State *  L)

lua will return the current player's guild's ladder points (the guild rank points)

LuaFunc:
guild.get_ladder_point()
Returns
[1] LuaNumber: the current player's guild's ladder points

◆ guild_get_loss_count0()

int32_t quest::guild_get_loss_count0 ( lua_State *  L)

lua will return the current player's guild's loss count

LuaFunc:
guild.get_loss_count0()
NewStuff:
guild.get_loss_count0()
New LuaFunc:
guild.get_loss_count0()
LuaFunc:
guild.get_loss_count()
NewStuff:
guild.get_loss_count()
New LuaFunc:
guild.get_loss_count()
Returns
[1] LuaNumber: the current player's guild's loss count

◆ guild_get_max_member0()

int32_t quest::guild_get_max_member0 ( lua_State *  L)

lua will return the current player's guild's max allowed members

LuaFunc:
guild.get_max_member0()
NewStuff:
guild.get_max_member0()
New LuaFunc:
guild.get_max_member0()
LuaFunc:
guild.get_max_member()
NewStuff:
guild.get_max_member()
New LuaFunc:
guild.get_max_member()
Returns
[1] LuaNumber: the current player's guild's max allowed members, 0 otherwise

◆ guild_get_maxsp0()

int32_t quest::guild_get_maxsp0 ( lua_State *  L)

lua will return the current player's guild's max spirit points

LuaFunc:
guild.get_maxsp0()
NewStuff:
guild.get_maxsp0()
New LuaFunc:
guild.get_maxsp0()
LuaFunc:
guild.get_maxsp()
NewStuff:
guild.get_maxsp()
New LuaFunc:
guild.get_maxsp()
Returns
[1] LuaNumber: the current player's guild's max spirit points, 0 otherwise

◆ guild_get_member_count()

int32_t quest::guild_get_member_count ( lua_State *  L)

lua will return the count of how many people are present in the current player's guild

LuaFunc:
guild.get_member_count()
Returns
[1] LuaNumber: the count of how many people are present in the current player's guild, 0 otherwise

◆ guild_get_money0()

int32_t quest::guild_get_money0 ( lua_State *  L)

lua will return the current player's guild's money

LuaFunc:
guild.get_money0()
NewStuff:
guild.get_money0()
New LuaFunc:
guild.get_money0()
LuaFunc:
guild.get_money()
NewStuff:
guild.get_money()
New LuaFunc:
guild.get_money()
Returns
[1] LuaNumber: the current player's guild's money, 0 otherwise

◆ guild_get_name()

int32_t quest::guild_get_name ( lua_State *  L)

lua will return the guild [guild_id]'s name

LuaFunc:
guild.get_name(LuaNumber guild_id)
Returns
[1] LuaString: the guild [guild_id]'s name

◆ guild_get_rank()

int32_t quest::guild_get_rank ( lua_State *  L)

lua will return the current player's guild's rank of the server

LuaFunc:
guild.get_rank()
Returns
[1] LuaNumber: the current player's guild's rank of the server

◆ guild_get_reserve_war_table()

int32_t quest::guild_get_reserve_war_table ( lua_State *  L)

lua will return the table of the reserved guild wars

LuaFunc:
guild.get_reserve_war_table()
Returns
[1] LuaTable[LuaTable[LuaNumber, LuaNumber, LuaNumber, LuaNumber]]: war_list[war_elem[war_id, guild_id1, guild_id2, penalty]]

◆ guild_get_skill_level0()

int32_t quest::guild_get_skill_level0 ( lua_State *  L)

lua will return the current player's guild's skill [skill_id]'s level

LuaFunc:
guild.get_skill_level0(LuaNumber skill_id)
NewStuff:
guild.get_skill_level0(LuaNumber skill_id)
New LuaFunc:
guild.get_skill_level0(LuaNumber skill_id)
LuaFunc:
guild.get_skill_level(LuaNumber skill_id)
NewStuff:
guild.get_skill_level(LuaNumber skill_id)
New LuaFunc:
guild.get_skill_level(LuaNumber skill_id)
Returns
[1] LuaNumber: the current player's guild's skill [skill_id]'s level, 0 otherwise

◆ guild_get_skill_point0()

int32_t quest::guild_get_skill_point0 ( lua_State *  L)

lua will return the current player's guild's skill points

LuaFunc:
guild.get_skill_point0()
NewStuff:
guild.get_skill_point0()
New LuaFunc:
guild.get_skill_point0()
LuaFunc:
guild.get_skill_point()
NewStuff:
guild.get_skill_point()
New LuaFunc:
guild.get_skill_point()
Returns
[1] LuaNumber: the current player's guild's skill points, 0 otherwise

◆ guild_get_sp0()

int32_t quest::guild_get_sp0 ( lua_State *  L)

lua will return the current player's guild's spirit points

LuaFunc:
guild.get_sp0()
NewStuff:
guild.get_sp0()
New LuaFunc:
guild.get_sp0()
LuaFunc:
guild.get_sp()
NewStuff:
guild.get_sp()
New LuaFunc:
guild.get_sp()
Returns
[1] LuaNumber: the current player's guild's spirit points, 0 otherwise

◆ guild_get_total_member_level0()

int32_t quest::guild_get_total_member_level0 ( lua_State *  L)

lua will return the current player's guild's average member level

LuaFunc:
guild.get_total_member_level0()
NewStuff:
guild.get_total_member_level0()
New LuaFunc:
guild.get_total_member_level0()
LuaFunc:
guild.get_total_member_level()
NewStuff:
guild.get_total_member_level()
New LuaFunc:
guild.get_total_member_level()
Returns
[1] LuaNumber: the current player's guild's average member level, 0 otherwise

◆ guild_get_warp_war_list()

int32_t quest::guild_get_warp_war_list ( lua_State *  L)

lua will return the table of the available guild war lists

LuaFunc:
guild.get_warp_war_list()
Returns
[1] LuaTable[LuaTable[LuaNumber, LuaNumber]]: war_list[war_id[guild_id1, guild_id2]]
Used in:
guild_war_observer.quest

◆ guild_get_win_count0()

int32_t quest::guild_get_win_count0 ( lua_State *  L)

lua will return the current player's guild's win count

LuaFunc:
guild.get_win_count0()
NewStuff:
guild.get_win_count0()
New LuaFunc:
guild.get_win_count0()
LuaFunc:
guild.get_win_count()
NewStuff:
guild.get_win_count()
New LuaFunc:
guild.get_win_count()
Returns
[1] LuaNumber: the current player's guild's win count

◆ guild_give_exp0()

int32_t quest::guild_give_exp0 ( lua_State *  L)

it will give [exp] exp points to the current player's guild (it won't decrease the current player's exp)

LuaFunc:
guild.give_exp0(LuaNumber exp)
NewStuff:
guild.give_exp0(LuaNumber exp)
New LuaFunc:
guild.give_exp0(LuaNumber exp)
LuaFunc:
guild.give_exp(LuaNumber exp)
NewStuff:
guild.give_exp(LuaNumber exp)
New LuaFunc:
guild.give_exp(LuaNumber exp)
Returns
nil

◆ guild_has_land0()

int32_t quest::guild_has_land0 ( lua_State *  L)

lua will return whether or not the current player's guild has a land

LuaFunc:
guild.has_land0()
NewStuff:
guild.has_land0()
New LuaFunc:
guild.has_land0()
LuaFunc:
guild.has_land()
NewStuff:
guild.has_land()
New LuaFunc:
guild.has_land()
Returns
[1] LuaBoolean: true if the current player's guild's has a land, false otherwise

◆ guild_high_ranking_string()

int32_t quest::guild_high_ranking_string ( lua_State *  L)

lua will return a colored guild list' top rank as say text of the current player's guild

LuaFunc:
guild.high_ranking_string()
Returns
[1] LuaString: a colored guild list' top rank as say text of the current player's guild
Used in:
guild_ranking.quest

◆ guild_is_bet()

int32_t quest::guild_is_bet ( lua_State *  L)

lua will return whether or not the current player made a bet at the war [war_id]

LuaFunc:
guild.is_bet(LuaNumber war_id)
Returns
[1] LuaBoolean: true if true, false otherwise; also true if [war_id] isn't a number

◆ guild_is_war()

int32_t quest::guild_is_war ( lua_State *  L)

lua will return whether or not the current player's guild is in war against the guild [guild_id]

LuaFunc:
guild.is_war(LuaNumber guild_id)
Returns
[1] LuaBoolean: true if in war against the guild [guild_id], false otherwise

◆ guild_level()

int32_t quest::guild_level ( lua_State *  L)

lua will return the guild [guild_id]'s level

LuaFunc:
guild.level(LuaNumber guild_id)
Returns
[1] LuaNumber: the guild [guild_id]'s level

◆ guild_name()

int32_t quest::guild_name ( lua_State *  L)

lua will return the guild [guild_id]'s name

LuaFunc:
guild.name(LuaNumber guild_id)
Returns
[1] LuaString: the guild [guild_id]'s name; nil if [guild_id] isn't a number

◆ guild_offer_exp0()

int32_t quest::guild_offer_exp0 ( lua_State *  L)

the current player will offer [exp] exp points to his guild

LuaFunc:
guild.offer_exp0(LuaNumber exp)
NewStuff:
guild.offer_exp0(LuaNumber exp)
New LuaFunc:
guild.offer_exp0(LuaNumber exp)
LuaFunc:
guild.offer_exp(LuaNumber exp)
NewStuff:
guild.offer_exp(LuaNumber exp)
New LuaFunc:
guild.offer_exp(LuaNumber exp)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ guild_set_ladder_point0()

int32_t quest::guild_set_ladder_point0 ( lua_State *  L)

it will set the current player's guild's ladder points to [ladder_point]

LuaFunc:
guild.set_ladder_point0(LuaNumber ladder_point)
NewStuff:
guild.set_ladder_point0(LuaNumber ladder_point)
New LuaFunc:
guild.set_ladder_point0(LuaNumber ladder_point)
LuaFunc:
guild.set_ladder_point(LuaNumber ladder_point)
NewStuff:
guild.set_ladder_point(LuaNumber ladder_point)
New LuaFunc:
guild.set_ladder_point(LuaNumber ladder_point)
Returns
nil

◆ guild_set_skill_level0()

int32_t quest::guild_set_skill_level0 ( lua_State *  L)

it will set the current player's guild's skill [skill_id]'s value to [value]

LuaFunc:
guild.set_skill_level0(LuaNumber skill_id, LuaNumber value)
NewStuff:
guild.set_skill_level0(LuaNumber skill_id, LuaNumber value)
New LuaFunc:
guild.set_skill_level0(LuaNumber skill_id, LuaNumber value)
LuaFunc:
guild.set_skill_level(LuaNumber skill_id, LuaNumber value)
NewStuff:
guild.set_skill_level(LuaNumber skill_id, LuaNumber value)
New LuaFunc:
guild.set_skill_level(LuaNumber skill_id, LuaNumber value)
Returns
nil

◆ guild_set_skill_point0()

int32_t quest::guild_set_skill_point0 ( lua_State *  L)

it will set the current player's guild's skill points to [value]

LuaFunc:
guild.set_skill_point0(LuaNumber value)
NewStuff:
guild.set_skill_point0(LuaNumber value)
New LuaFunc:
guild.set_skill_point0(LuaNumber value)
LuaFunc:
guild.set_skill_point(LuaNumber value)
NewStuff:
guild.set_skill_point(LuaNumber value)
New LuaFunc:
guild.set_skill_point(LuaNumber value)
Returns
nil

◆ guild_war_bet()

int32_t quest::guild_war_bet ( lua_State *  L)

the current player will make a bet at the war [war_id] against the guild [guild_id] for [amount] yangs

LuaFunc:
guild.war_bet(LuaNumber war_id, LuaNumber guild_id, LuaNumber amount)
Returns
nil

◆ guild_war_enter()

int32_t quest::guild_war_enter ( lua_State *  L)

you will join the war against guild [guild_id]

LuaFunc:
guild.war_enter(LuaNumber guild_id)
Returns
nil

◆ highscore_register()

int32_t quest::highscore_register ( lua_State *  L)

it will insert inside player.register a row containing [board_name] [value] [order] (only 0-1 for [order])

LuaFunc:
highscore.register(LuaString board_name, LuaNumber value, LuaNumber order)
Returns
nil

◆ highscore_show()

int32_t quest::highscore_show ( lua_State *  L)

it will send an INFO chat packet to the current player about his registered highscore filtered by [board_name] and [order] (only 0-1 for [order])

LuaFunc:
highscore.register(LuaString board_name, LuaNumber order)
Returns
nil

◆ horse_advance()

int32_t quest::horse_advance ( lua_State *  L)

the current player's horse level will be increased by one

LuaFunc:
horse.advance()
Returns
nil

◆ horse_feed()

int32_t quest::horse_feed ( lua_State *  L)

the current player's horse will be fed

LuaFunc:
horse.feed()
Returns
nil

◆ horse_get_grade()

int32_t quest::horse_get_grade ( lua_State *  L)

lua will return the current player's horse grade

LuaFunc:
horse.get_grade()
Returns
[1] LuaNumber: the current player's horse grade (0 if level=0, 1 if level 1<>10, 2 if level 11<>20, 3 if level 21<>30)

◆ horse_get_health()

int32_t quest::horse_get_health ( lua_State *  L)

lua will return the current player's horse health, 0 otherwise

LuaFunc:
horse.get_health()
Returns
[1] LuaNumber: the current player's horse health, 0 otherwise

◆ horse_get_health_pct()

int32_t quest::horse_get_health_pct ( lua_State *  L)

lua will return the current player's horse health as percentage, 0 otherwise

LuaFunc:
horse.get_health_pct()
Returns
[1] LuaNumber: the current player's horse health as percentage, 0 otherwise

◆ horse_get_level()

int32_t quest::horse_get_level ( lua_State *  L)

lua will return the current player's horse level

LuaFunc:
horse.set_level(LuaNumber level)
Returns
[1] LuaNumber: the current player's horse level

◆ horse_get_name()

int32_t quest::horse_get_name ( lua_State *  L)

lua will return the current player's horse's name

LuaFunc:
horse.get_name()
Returns
[1] LuaString: the current player's horse's name

◆ horse_get_stamina()

int32_t quest::horse_get_stamina ( lua_State *  L)

lua will return the current player's horse stamina, 0 otherwise

LuaFunc:
horse.get_stamina()
Returns
[1] LuaNumber: the current player's horse stamina, 0 otherwise

◆ horse_get_stamina_pct()

int32_t quest::horse_get_stamina_pct ( lua_State *  L)

lua will return the current player's horse stamina as percentage, 0 otherwise

LuaFunc:
horse.get_stamina_pct()
Returns
[1] LuaNumber: the current player's horse stamina as percentage, 0 otherwise

◆ horse_is_dead()

int32_t quest::horse_is_dead ( lua_State *  L)

lua will return whether or not the current player's horse is dead (health<=0)

LuaFunc:
horse.is_dead()
Returns
[1] LuaBoolean: true if the current player's horse is dead, false otherwise

◆ horse_is_mine()

int32_t quest::horse_is_mine ( lua_State *  L)

lua will return true if the current npc is the current player's horse, false otherwise

LuaFunc:
horse.is_mine()
Returns
[1] LuaBoolean: true if the current npc is the current player's horse, false otherwise

◆ horse_is_riding()

int32_t quest::horse_is_riding ( lua_State *  L)

lua will return whether or not the current player is riding the horse

LuaFunc:
horse.is_riding()
Returns
[1] LuaBoolean: true if riding, false otherwise

◆ horse_is_summon()

int32_t quest::horse_is_summon ( lua_State *  L)

lua will return whether or not the current player's horse is summoned

LuaFunc:
horse.is_summon()
Returns
[1] LuaBoolean: true if the current player's horse is summoned, false otherwise

◆ horse_revive()

int32_t quest::horse_revive ( lua_State *  L)

the current player's horse will be revived

LuaFunc:
horse.revive()
Returns
nil

◆ horse_ride()

int32_t quest::horse_ride ( lua_State *  L)

the current player will ride the horse

LuaFunc:
horse.ride()
Returns
nil

◆ horse_set_level()

int32_t quest::horse_set_level ( lua_State *  L)

the current player's horse level will be set to [level]

LuaFunc:
horse.set_level(LuaNumber level)
Returns
nil

◆ horse_set_name()

int32_t quest::horse_set_name ( lua_State *  L)

the current player's horse's name will be set to [name]

LuaFunc:
horse.set_name(LuaString name)
Returns
[1] LuaNumber: 0 if the horse level is <=0, 1 if [name] is not valid, 2 if succeeded, nil if wrong arguments

◆ horse_set_stat0()

int32_t horse_set_stat0 ( lua_State *  L)

it will set the current player's horse health to [health] (max 50) and stamina to [stamina] (max 200)

LuaFunc:
horse.set_stat0(LuaNumber health, LuaNumber stamina)
NewStuff:
horse.set_stat0(LuaNumber health, LuaNumber stamina)
New LuaFunc:
horse.set_stat0(LuaNumber health, LuaNumber stamina)
LuaFunc:
horse.set_stat(LuaNumber health, LuaNumber stamina)
NewStuff:
horse.set_stat(LuaNumber health, LuaNumber stamina)
New LuaFunc:
horse.set_stat(LuaNumber health, LuaNumber stamina)
Returns
nil

◆ horse_summon()

int32_t quest::horse_summon ( lua_State *  L)

the current player will summon the horse
if [from_afar]=true, it will be spawned from afar;
if [horse_vnum] is specified, the spawned horse's vnum will be [horse_vnum];
if [horse_name] is specified, the spawned horse's name will be [horse_name];

LuaFunc:
horse.summon([LuaBoolean from_afar=false], [LuaNumber horse_vnum=0], [LuaString horse_name=""])
Returns
nil

◆ horse_unride()

int32_t quest::horse_unride ( lua_State *  L)

the current player will unride the horse

LuaFunc:
horse.unride()
Returns
nil

◆ horse_unsummon()

int32_t quest::horse_unsummon ( lua_State *  L)

the current player will unsummon the horse

LuaFunc:
horse.summon([LuaBoolean from_afar=false], [LuaNumber horse_vnum=0], [LuaString horse_name=""])
Returns
nil

◆ is_guild_master()

int32_t quest::is_guild_master ( lua_State *  L)

lua will return whether or not the current player is guild master (duplicate function)

LuaFunc:
oh.isguildmaster()
Returns
[1] LuaNumber: 1 if true, 0 otherwise

◆ is_monarch()

int32_t quest::is_monarch ( lua_State *  L)

lua will returh whether or not the current player is monarch

LuaFunc:
oh.is_monarch()
Returns
[1] LuaBoolean: true if the current player is monarch, false otherwise; nil if there's no current player

◆ item_add_attr0()

int32_t quest::item_add_attr0 ( lua_State *  L)

it will add a bonus to the current item based on the specific [mode]
if [mode]=0, it will add a normal and a rare bonus;
if [mode]=1, it will add a normal bonus;
if [mode]=2, it will add a rare bonus;

LuaFunc:
item.add_attr0(LuaNumber mode)
NewStuff:
item.add_attr0(LuaNumber mode)
New LuaFunc:
item.add_attr0(LuaNumber mode)
LuaFunc:
item.add_attr(LuaNumber mode)
NewStuff:
item.add_attr(LuaNumber mode)
New LuaFunc:
item.add_attr(LuaNumber mode)
Returns
nil

◆ item_can_over9refine()

int32_t quest::item_can_over9refine ( lua_State *  L)

lua will return whether or not the current item has been added by enable_over9refine

LuaFunc:
item.can_over9refine()
Returns
[1] LuaBoolean: true if the current item has been added by enable_over9refine; nil if there is no current item

◆ item_change_attr0()

int32_t quest::item_change_attr0 ( lua_State *  L)

it will change the bonuses to the current item based on the specific [mode]
if [mode]=0, it will switch both normal and rare bonuses;
if [mode]=1, it will switch the normal bonuses;
if [mode]=2, it will switch the rare bonuses;

LuaFunc:
item.change_attr0(LuaNumber mode)
NewStuff:
item.change_attr0(LuaNumber mode)
New LuaFunc:
item.change_attr0(LuaNumber mode)
LuaFunc:
item.change_attr(LuaNumber mode)
NewStuff:
item.change_attr(LuaNumber mode)
New LuaFunc:
item.change_attr(LuaNumber mode)
Returns
nil

◆ item_change_to_over9()

int32_t quest::item_change_to_over9 ( lua_State *  L)

it will refine the current item to its relative over9 refine, if present (by enable_over9refine)

LuaFunc:
item.change_to_over9()
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ item_clear_attr0()

int32_t quest::item_clear_attr0 ( lua_State *  L)

it will clear the bonuses to the current item based on the specific [mode]
if [mode]=0, it will clear both normal and rare bonuses;
if [mode]=1, it will clear the normal bonuses;
if [mode]=2, it will clear the rare bonuses;

LuaFunc:
item.clear_attr0(LuaNumber mode)
NewStuff:
item.clear_attr0(LuaNumber mode)
New LuaFunc:
item.clear_attr0(LuaNumber mode)
LuaFunc:
item.clear_attr(LuaNumber mode)
NewStuff:
item.clear_attr(LuaNumber mode)
New LuaFunc:
item.clear_attr(LuaNumber mode)
Returns
nil

◆ item_copy_and_give_before_remove()

int32_t quest::item_copy_and_give_before_remove ( lua_State *  L)

it will copy and replace the current item to a new one by vnum [vnum]

LuaFunc:
item.copy_and_give_before_remove(LuaNumber vnum)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ item_count_attr0()

int32_t quest::item_count_attr0 ( lua_State *  L)

lua will return the count of the bonuses to the current item based on the specific [mode]

LuaFunc:
item.count_attr0(LuaNumber mode)
NewStuff:
item.count_attr0(LuaNumber mode)
New LuaFunc:
item.count_attr0(LuaNumber mode)
LuaFunc:
item.count_attr(LuaNumber mode)
NewStuff:
item.count_attr(LuaNumber mode)
New LuaFunc:
item.count_attr(LuaNumber mode)
Returns
[1] LuaNumber: the count of the bonuses to the current item based on the specific [mode]
if [mode]=0, it will count both normal and rare bonuses;
if [mode]=1, it will count the normal bonuses;
if [mode]=2, it will count the rare bonuses;

◆ item_get_antiflag0()

int32_t quest::item_get_antiflag0 ( lua_State *  L)

lua will return the current item's anti flag

LuaFunc:
item.get_antiflag0()
NewStuff:
item.get_antiflag0()
New LuaFunc:
item.get_antiflag0()
LuaFunc:
item.get_antiflag()
NewStuff:
item.get_antiflag()
New LuaFunc:
item.get_antiflag()
Returns
[1] LuaNumber: the current item's anti flag, 0 otherwise

◆ item_get_attr0()

int32_t quest::item_get_attr0 ( lua_State *  L)

lua will return the list of all the bonuses of the current items

LuaFunc:
item.get_attr0()
NewStuff:
item.get_attr0()
New LuaFunc:
item.get_attr0()
LuaFunc:
item.get_attr()
NewStuff:
item.get_attr()
New LuaFunc:
item.get_attr()
Returns
[1] LuaTable[(LuaNumber bonus_id, LuaNumber bonus_value)*7]: the list of all the bonuses of the current items; 0.0 otherwise

◆ item_get_cell()

int32_t quest::item_get_cell ( lua_State *  L)

it will return the current item's cell

LuaFunc:
item.get_cell(LuaNumber cell)
Returns
[1] LuaNumber: the current item's cell

◆ item_get_count()

int32_t quest::item_get_count ( lua_State *  L)

lua will return the count of the current item

LuaFunc:
item.get_count()
Returns
[1] LuaNumber: the count of the current item, 0 otherwise

◆ item_get_id()

int32_t quest::item_get_id ( lua_State *  L)

lua will return the current item's id

LuaFunc:
item.get_id()
Returns
[1] LuaNumber: the current item's id, otherwise 0

◆ item_get_immuneflag0()

int32_t quest::item_get_immuneflag0 ( lua_State *  L)

lua will return the current item's immune flag

LuaFunc:
item.get_immuneflag0()
NewStuff:
item.get_immuneflag0()
New LuaFunc:
item.get_immuneflag0()
LuaFunc:
item.get_immuneflag()
NewStuff:
item.get_immuneflag()
New LuaFunc:
item.get_immuneflag()
Returns
[1] LuaNumber: the current item's immune flag, 0 otherwise

◆ item_get_level()

int32_t quest::item_get_level ( lua_State *  L)

lua will return the refine level of the current item

LuaFunc:
item.get_level()
Returns
[1] LuaNumber: the refine level of the current item, 0 otherwise

◆ item_get_level_limit()

int32_t quest::item_get_level_limit ( lua_State *  L)

lua will return the level limit of the current item

LuaFunc:
item.get_level_limit()
Returns
[1] LuaNumber: the level limit of the current item; nil if it's not a weapon or armor

◆ item_get_name()

int32_t quest::item_get_name ( lua_State *  L)

lua will return the name of the current item

LuaFunc:
item.get_name()
Returns
[1] LuaString: the name of the current item, "" otherwise

◆ item_get_over9_material_vnum()

int32_t quest::item_get_over9_material_vnum ( lua_State *  L)

lua will return the material vnum of the item [vnum]

LuaFunc:
item.get_over9_material_vnum(LuaNumber vnum)
Returns
[1] LuaNumber: the material vnum of the item [vnum]; nil if wrong argument

◆ item_get_refine_vnum()

int32_t quest::item_get_refine_vnum ( lua_State *  L)

lua will return the refine vnum of the current item

LuaFunc:
item.get_refine_vnum()
Returns
[1] LuaNumber: the refine vnum of the current item, 0 otherwise

◆ item_get_size()

int32_t quest::item_get_size ( lua_State *  L)

lua will return the size of the current item

LuaFunc:
item.get_size()
Returns
[1] LuaNumber: the size of the current item, 0 otherwise

◆ item_get_socket()

int32_t quest::item_get_socket ( lua_State *  L)

lua will return the value of the current item's socket [index] (from 0 to 2)

LuaFunc:
item.get_socket(LuaNumber index)
Returns
[1] LuaNumber: the value of the current item's socket [index]

◆ item_get_sub_type()

int32_t quest::item_get_sub_type ( lua_State *  L)

lua will return the subtype of the current item

LuaFunc:
item.get_sub_type()
Returns
[1] LuaNumber: the subtype of the current item, 0 otherwise

◆ item_get_type()

int32_t quest::item_get_type ( lua_State *  L)

lua will return the type of the current item

LuaFunc:
item.get_type()
Returns
[1] LuaNumber: the type of the current item, 0 otherwise

◆ item_get_value()

int32_t quest::item_get_value ( lua_State *  L)

lua will return the value in pos [index] of the current item

LuaFunc:
item.get_value(LuaNumber index)
Returns
[1] LuaNumber: the value in pos [index] of the current item, 0 otherwise

◆ item_get_vnum()

int32_t quest::item_get_vnum ( lua_State *  L)

lua will return the vnum of the current item

LuaFunc:
item.get_vnum()
Returns
[1] LuaNumber: the vnum of the current item

◆ item_get_wearflag0()

int32_t quest::item_get_wearflag0 ( lua_State *  L)

lua will return the current item's wear flag

LuaFunc:
item.get_wearflag0()
NewStuff:
item.get_wearflag0()
New LuaFunc:
item.get_wearflag0()
LuaFunc:
item.get_wearflag()
NewStuff:
item.get_wearflag()
New LuaFunc:
item.get_wearflag()
Returns
[1] LuaNumber: the current item's wear flag, 0 otherwise

◆ item_has_antiflag0()

int32_t quest::item_has_antiflag0 ( lua_State *  L)

lua will return whether or not the current item has the anti flag's value [value]

LuaFunc:
item.has_antiflag0()
NewStuff:
item.has_antiflag0()
New LuaFunc:
item.has_antiflag0()
LuaFunc:
item.has_antiflag()
NewStuff:
item.has_antiflag()
New LuaFunc:
item.has_antiflag()
Returns
[1] LuaBoolean: true if the current item has the anti flag's value [value], false otherwise

◆ item_has_flag()

int32_t quest::item_has_flag ( lua_State *  L)

lua will return whether or not the current item has the flag's value [value]

LuaFunc:
item.has_flag(LuaNumber value)
Returns
[1] LuaBoolean: true if the current item has the flag's value [value], false otherwise

◆ item_has_immuneflag0()

int32_t quest::item_has_immuneflag0 ( lua_State *  L)

lua will return whether or not the current item has the immune flag's value [value]

LuaFunc:
item.has_immuneflag0()
NewStuff:
item.has_immuneflag0()
New LuaFunc:
item.has_immuneflag0()
LuaFunc:
item.has_immuneflag()
NewStuff:
item.has_immuneflag()
New LuaFunc:
item.has_immuneflag()
Returns
[1] LuaBoolean: true if the current item has the immune flag's value [value], false otherwise

◆ item_has_wearflag0()

int32_t quest::item_has_wearflag0 ( lua_State *  L)

lua will return whether or not the current item has the wear flag's value [value]

LuaFunc:
item.has_wearflag0()
NewStuff:
item.has_wearflag0()
New LuaFunc:
item.has_wearflag0()
LuaFunc:
item.has_wearflag()
NewStuff:
item.has_wearflag()
New LuaFunc:
item.has_wearflag()
Returns
[1] LuaBoolean: true if the current item has the wear flag's value [value], false otherwise

◆ item_is_available0()

int32_t quest::item_is_available0 ( lua_State *  L)

lua will return whether or not there's a current item

LuaFunc:
item.is_available0()
NewStuff:
item.is_available0()
New LuaFunc:
item.is_available0()
LuaFunc:
item.is_available()
NewStuff:
item.is_available()
New LuaFunc:
item.is_available()
Returns
[1] LuaBoolean: true if there's a current item available, false otherwise

◆ item_next_refine_vnum()

int32_t quest::item_next_refine_vnum ( lua_State *  L)

lua will return the refine vnum of the item [vnum]

LuaFunc:
item.get_refine_vnum(LuaNumber vnum)
Returns
[1] LuaNumber: the refine vnum of the item [vnum], 0 otherwise

◆ item_over9refine()

int32_t quest::item_over9refine ( lua_State *  L)

it will refine the current item to its relative refine, if present (by enable_over9refine)

LuaFunc:
item.over9refine()
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ item_remove()

int32_t quest::item_remove ( lua_State *  L)

it will remove the current item

LuaFunc:
item.remove()
Returns
nil

◆ item_select()

int32_t quest::item_select ( lua_State *  L)

the current item's will be set to the item id [item_id]

LuaFunc:
item.select(LuaNumber item_id)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ item_select_cell()

int32_t quest::item_select_cell ( lua_State *  L)

the current item's will be set to the item in pos [cell] of the current player

LuaFunc:
item.select_cell(LuaNumber cell)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ item_set_attr0()

int32_t quest::item_set_attr0 ( lua_State *  L)

it will set the current item's attr bonuses with the list of parameters [id1~7] to [value1~7]

LuaFunc:
item.set_attr0(LuaNumber id1, LuaNumber value1, LuaNumber id2, LuaNumber value2, LuaNumber id3, LuaNumber value3, LuaNumber id4, LuaNumber value4, LuaNumber id5, LuaNumber value5, LuaNumber id6, LuaNumber value6, LuaNumber id7, LuaNumber value7)
NewStuff:
item.set_attr0(LuaNumber id1, LuaNumber value1, LuaNumber id2, LuaNumber value2, LuaNumber id3, LuaNumber value3, LuaNumber id4, LuaNumber value4, LuaNumber id5, LuaNumber value5, LuaNumber id6, LuaNumber value6, LuaNumber id7, LuaNumber value7)
New LuaFunc:
item.set_attr0(LuaNumber id1, LuaNumber value1, LuaNumber id2, LuaNumber value2, LuaNumber id3, LuaNumber value3, LuaNumber id4, LuaNumber value4, LuaNumber id5, LuaNumber value5, LuaNumber id6, LuaNumber value6, LuaNumber id7, LuaNumber value7)
LuaFunc:
item.set_attr0(unpack(LuaTable[(LuaNumber bonus_id, LuaNumber bonus_value)*7]))
NewStuff:
item.set_attr0(unpack(LuaTable[(LuaNumber bonus_id, LuaNumber bonus_value)*7]))
New LuaFunc:
item.set_attr0(unpack(LuaTable[(LuaNumber bonus_id, LuaNumber bonus_value)*7]))
LuaFunc:
item.set_attr
NewStuff:
item.set_attr
New LuaFunc:
item.set_attr
Returns
nil

◆ item_set_count0()

int32_t quest::item_set_count0 ( lua_State *  L)

it will set the current item's count to [count]

LuaFunc:
item.set_count0(LuaNumber count)
NewStuff:
item.set_count0(LuaNumber count)
New LuaFunc:
item.set_count0(LuaNumber count)
LuaFunc:
item.set_count(LuaNumber count)
NewStuff:
item.set_count(LuaNumber count)
New LuaFunc:
item.set_count(LuaNumber count)
Returns
nil

◆ item_set_socket()

int32_t quest::item_set_socket ( lua_State *  L)

il will set the value of the current item's socket [index] to [value]

LuaFunc:
item.set_socket(LuaNumber index, LuaNumber value)
Returns
nil

◆ item_set_value()

int32_t quest::item_set_value ( lua_State *  L)

it will set the value in pos [index] to [value] of the current item

LuaFunc:
item.get_value(LuaNumber index, LuaNumber value)
Returns
nil

◆ item_start_realtime_expire()

int32_t quest::item_start_realtime_expire ( lua_State *  L)

it will start the real time expire event for the current item (useless)

LuaFunc:
item.start_realtime_expire()
Returns
nil

◆ marriage_end_wedding()

int32_t quest::marriage_end_wedding ( lua_State *  L)

the current player's wedding will be terminated

LuaFunc:
marriage.end_wedding()
Returns
nil

◆ marriage_engage_to()

int32_t quest::marriage_engage_to ( lua_State *  L)

it will make an engagement request between the current player and the player [vid]

LuaFunc:
marriage.engage_to(LuaNumber vid)
Returns
nil

◆ marriage_find_married_vid()

int32_t quest::marriage_find_married_vid ( lua_State *  L)

lua will return the current player's married player's vid

LuaFunc:
marriage.find_married_vid()
Returns
[1] LuaNumber: the current player's married player's vid, 0 otherwise

◆ marriage_get_married_time()

int32_t quest::marriage_get_married_time ( lua_State *  L)

lua will return the timestamp of how long the current player is married

LuaFunc:
marriage.get_married_time()
Returns
[1] LuaBoolean: the timestamp of how long the current player is married, 0 otherwise

◆ marriage_get_wedding_list()

int32_t quest::marriage_get_wedding_list ( lua_State *  L)

lua will return the table of the available weddings

LuaFunc:
marriage.get_wedding_list()
Returns
[1] LuaTable[LuaTable[LuaNumber,LuaNumber,LuaString,LuaString]]: table[item[pid1, pid2, name1, name2]]
Used in:
marriage_manage.quest

◆ marriage_in_my_wedding()

int32_t quest::marriage_in_my_wedding ( lua_State *  L)

lua will return whether or not the current player is in his/her wedding map

LuaFunc:
marriage.in_my_wedding()
Returns
[1] LuaBoolean: true if the map index of the current player's wedding map, false otherwise

◆ marriage_join_wedding()

int32_t quest::marriage_join_wedding ( lua_State *  L)

the current player will join the wedding between player [pid1] and [pid2]

LuaFunc:
marriage.join_wedding(LuaNumber pid1, LuaNumber pid2)
Returns
nil

◆ marriage_remove()

int32_t quest::marriage_remove ( lua_State *  L)

it will remove the current player's engagement request

LuaFunc:
marriage.remove()
Returns
nil

◆ marriage_set_to_marriage()

int32_t quest::marriage_set_to_marriage ( lua_State *  L)

it will make the current player and the requested one engaged

LuaFunc:
marriage.set_to_marriage()
Returns
nil

◆ marriage_warp_to_my_marriage_map()

int32_t quest::marriage_warp_to_my_marriage_map ( lua_State *  L)

the current player will warp to his/her wedding map

LuaFunc:
marriage.warp_to_my_marriage_map()
Returns
nil

◆ marriage_wedding_client_command()

int32_t quest::marriage_wedding_client_command ( lua_State *  L)

everyone in the current player's wedding will get a COMMAND script packet [command]

LuaFunc:
marriage.wedding_client_command(LuaString command)
Returns
nil

◆ marriage_wedding_dark()

int32_t quest::marriage_wedding_dark ( lua_State *  L)

the current player's wedding's environment will be set to dark if [to_dark] is true, day otherwise

LuaFunc:
marriage.wedding_dark(LuaBoolean to_dark)
Returns
nil

◆ marriage_wedding_is_playing_music()

int32_t quest::marriage_wedding_is_playing_music ( lua_State *  L)

lua will return whether or not in the current player's wedding the wedding music is in play

LuaFunc:
marriage.wedding_is_playing_music()
Returns
[1] LuaBoolean: true if in play, false otherwise; nil if there's no wedding

◆ marriage_wedding_music()

int32_t quest::marriage_wedding_music ( lua_State *  L)

the current player's wedding's music [filename] will be set to play if [to_play] is true, stopped otherwise

LuaFunc:
marriage.wedding_music(LuaBoolean to_play, LuaString filename)
Returns
nil

◆ marriage_wedding_snow()

int32_t quest::marriage_wedding_snow ( lua_State *  L)

the current player's wedding's weather will be set to snow if [to_snow] is true, normal otherwise

LuaFunc:
marriage.wedding_snow(LuaBoolean to_snow)
Returns
nil

◆ member_chat()

int32_t quest::member_chat ( lua_State *  L)

it will send a TALKING chat packet containing [text] to the current player's party

LuaFunc:
member.clear_ready(LuaString text...)
Returns
nil

◆ member_clear_ready()

int32_t quest::member_clear_ready ( lua_State *  L)

it will remove the affect DUNGEON_READY from the whole current player's party (unused)

LuaFunc:
member.clear_ready()
Returns
nil

◆ member_set_ready()

int32_t quest::member_set_ready ( lua_State *  L)

it will set the affect DUNGEON_READY to the whole current player's party (unused)

LuaFunc:
member.set_ready()
Returns
nil

◆ mgmt_monarch_change_lord()

int32_t quest::mgmt_monarch_change_lord ( lua_State *  L)

it will change the empire [empire]'s monarch with player [pid]

LuaFunc:
mgmt.monarch_change_lord(LuaNumber empire, LuaNumber pid)
Returns
nil

◆ mgmt_monarch_state()

int32_t quest::mgmt_monarch_state ( lua_State *  L)

lua will return the info of the empire [empire]'s monarch

LuaFunc:
mgmt.monarch_state(LuaNumber empire)
Returns
[1] LuaString: empire [empire]'s monarch name
[2] LuaNumber: empire [empire]'s monarch pid
[3] LuaString: empire [empire]'s election date
[4] LuaNumber: empire [empire]'s money

◆ mob_spawn()

int32_t quest::mob_spawn ( lua_State *  L)

it will spawn a mob [vnum] in [map_index] coordinates [local_x],[local_y] for [count] times, and if [is_aggressive]=true it will be aggressive

LuaFunc:
mob.spawn(LuaNumber vnum, LuaNumber local_x, LuaNumber local_y, LuaNumber radius, LuaBoolean is_aggressive, LuaNumber count)
Returns
[1] LuaNumber: the vid of the spawned mob, 0 otherwise

◆ mob_spawn_group()

int32_t quest::mob_spawn_group ( lua_State *  L)

it will spawn a mob group [vnum] in [map_index] coordinates [local_x],[local_y] for [count] times, and if [is_aggressive]=true it will be aggressive

LuaFunc:
mob.spawn_group(LuaNumber vnum, LuaNumber local_x, LuaNumber local_y, LuaNumber radius, LuaBoolean is_aggressive, LuaNumber count)
Returns
[1] LuaNumber: the vid of the last spawned mob, 0 otherwise

◆ monarch_bless()

int32_t quest::monarch_bless ( lua_State *  L)

if the current player is monarch or gm, for 2kk empire's money he can full heal his own empire's players

LuaFunc:
oh.monarchbless()
Returns
nil

◆ monarch_defenseup()

int32_t quest::monarch_defenseup ( lua_State *  L)

if the current player is monarch or gm, for 5kk yangs he can defense up his own empire's players

LuaFunc:
oh.monarchdefenseup()
Returns
nil

◆ monarch_mob()

int32_t quest::monarch_mob ( lua_State *  L)

if the current player is a monarch, it will spawn the relative mob [mob_vnum] for 5kk empire's money

LuaFunc:
oh.monarch_mob(LuaString mob_vnum)
Returns
nil

◆ monarch_notice()

int32_t quest::monarch_notice ( lua_State *  L)

if the current player is a monarch, it will send a message [text] to the relative empire

LuaFunc:
oh.notice(LuaString text)
Returns
nil

◆ monarch_powerup()

int32_t quest::monarch_powerup ( lua_State *  L)

if the current player is monarch or gm, for 5kk empire's money he can power up his own empire's players

LuaFunc:
oh.monarchpowerup()
Returns
nil

◆ monarch_transfer()

int32_t quest::monarch_transfer ( lua_State *  L)

if the current player is a monarch, the player [name] will be warped to him for 10k empire's money, and only if of the same empire

LuaFunc:
oh.transfer(LuaString name)
Returns
nil

◆ monarch_transfer2()

int32_t quest::monarch_transfer2 ( lua_State *  L)

if the current player is a monarch, the player [name] will be warped to him for 10k empire's money, and only if of the same empire

LuaFunc:
oh.transfer2(LuaString name)
Returns
nil

◆ monarch_warp()

int32_t quest::monarch_warp ( lua_State *  L)

if the current player is a monarch, he will warp to the player [name] for 10k empire's money, and only if of the same empire

LuaFunc:
oh.warp(LuaString name)
Returns
nil

◆ npc_dec_remain_hairdye_count()

int32_t quest::npc_dec_remain_hairdye_count ( lua_State *  L)

if the npc is the santa (vnum 20031), the current npc's def grade bonus will be decreased by 1

LuaFunc:
npc.dec_remain_hairdye_count()
Returns
nil

◆ npc_dec_remain_skill_book_count()

int32_t quest::npc_dec_remain_skill_book_count ( lua_State *  L)

if the npc is the santa (vnum 20031), the current npc's att grade bonus will be decreased by 1

LuaFunc:
npc.dec_remain_skill_book_count()
Returns
nil

◆ npc_get_empire()

int32_t quest::npc_get_empire ( lua_State *  L)

lua will return the current npc's empire

LuaFunc:
npc.get_empire()
Returns
[1] LuaNumber: the current npc's empire, 0 otherwise

◆ npc_get_guild()

int32_t quest::npc_get_guild ( lua_State *  L)

lua will return the current npc's guild id

LuaFunc:
npc.get_guild()
Returns
[1] LuaNumber: the current npc's guild id, 0 otherwise

◆ npc_get_leader_vid()

int32_t quest::npc_get_leader_vid ( lua_State *  L)

lua will return the current npc's group's leader vid

LuaFunc:
npc.get_leader_vid()
Returns
[1] LuaNumber: the current npc's group's leader vid, 0 otherwise

◆ npc_get_level0()

int32_t quest::npc_get_level0 ( lua_State *  L)

lua will return the npc's level

LuaFunc:
npc.get_level0()
NewStuff:
npc.get_level0()
New LuaFunc:
npc.get_level0()
LuaFunc:
npc.get_level()
NewStuff:
npc.get_level()
New LuaFunc:
npc.get_level()
Returns
[1] LuaNumber: the npc's level

◆ npc_get_name0()

int32_t quest::npc_get_name0 ( lua_State *  L)

lua will return the npc's name

LuaFunc:
npc.get_name0()
NewStuff:
npc.get_name0()
New LuaFunc:
npc.get_name0()
LuaFunc:
npc.get_name()
NewStuff:
npc.get_name()
New LuaFunc:
npc.get_name()
Returns
[1] LuaString: the npc's name

◆ npc_get_pid0()

int32_t quest::npc_get_pid0 ( lua_State *  L)

lua will return the npc's pid

LuaFunc:
npc.get_pid0()
NewStuff:
npc.get_pid0()
New LuaFunc:
npc.get_pid0()
LuaFunc:
npc.get_pid()
NewStuff:
npc.get_pid()
New LuaFunc:
npc.get_pid()
Returns
[1] LuaNumber: the npc's pid

◆ npc_get_race()

int32_t quest::npc_get_race ( lua_State *  L)

lua will return the current npc's race

LuaFunc:

npc.getrace()

npc.get_race()

Returns
[1] LuaNumber: the current npc's race

◆ npc_get_remain_hairdye_count()

int32_t quest::npc_get_remain_hairdye_count ( lua_State *  L)

if the npc is the santa (vnum 20031), lua will return its relative def grade bonus

LuaFunc:
npc.get_remain_hairdye_count()
Returns
[1] LuaNumber: the current npc's def grade bonus if santa, 0 otherwise

◆ npc_get_remain_skill_book_count()

int32_t quest::npc_get_remain_skill_book_count ( lua_State *  L)

if the npc is the santa (vnum 20031), lua will return its relative att grade bonus

LuaFunc:
npc.get_remain_skill_book_count()
Returns
[1] LuaNumber: the current npc's att grade bonus if santa, 0 otherwise

◆ npc_get_vid()

int32_t quest::npc_get_vid ( lua_State *  L)

lua will return the current npc's vid

LuaFunc:
npc.get_vid()
Returns
[1] LuaNumber: the current npc's vid, 0 otherwise

◆ npc_get_vid_attack_mul()

int32_t quest::npc_get_vid_attack_mul ( lua_State *  L)

lua will return the npc [vid]'s attack multiply

LuaFunc:
npc.get_vid_attack_mul(LuaNumber vid)
Returns
[1] LuaNumber: the npc [vid]'s attack multiply, 0 otherwise

◆ npc_get_vid_damage_mul()

int32_t quest::npc_get_vid_damage_mul ( lua_State *  L)

lua will return the npc [vid]'s damage multiply

LuaFunc:
npc.get_vid_damage_mul(LuaNumber vid)
Returns
[1] LuaNumber: the npc [vid]'s damage multiply, 0 otherwise

◆ npc_get_vnum0()

int32_t quest::npc_get_vnum0 ( lua_State *  L)

lua will return the npc's vnum

LuaFunc:
npc.get_vnum0()
NewStuff:
npc.get_vnum0()
New LuaFunc:
npc.get_vnum0()
LuaFunc:
npc.get_vnum()
NewStuff:
npc.get_vnum()
New LuaFunc:
npc.get_vnum()
Returns
[1] LuaNumber: the npc's vnum

◆ npc_is_available0()

int32_t quest::npc_is_available0 ( lua_State *  L)

lua will return whether or not there is a current npc

LuaFunc:
npc.is_available0()
NewStuff:
npc.is_available0()
New LuaFunc:
npc.is_available0()
LuaFunc:
npc.is_available()
NewStuff:
npc.is_available()
New LuaFunc:
npc.is_available()
Returns
[1] LuaBoolean: true if there is a current npc, false otherwise

◆ npc_is_near()

int32_t quest::npc_is_near ( lua_State *  L)

lua will return whether or not the current npc is near the current pc

LuaFunc:
npc.is_near()
Returns
[1] LuaBoolean: true if the current npc is near the current pc, false otherwise

◆ npc_is_near_vid()

int32_t quest::npc_is_near_vid ( lua_State *  L)

lua will return whether or not the current npc is near the pc [vid]

LuaFunc:
npc.is_near_vid(LuaNumber vid)
Returns
[1] LuaBoolean: true if the current npc is near the pc [vid], false otherwise

◆ npc_is_pc()

int32_t quest::npc_is_pc ( lua_State *  L)

lua will return whether or not the current npc is a pc

LuaFunc:
npc.is_pc()
Returns
[1] LuaBoolean: true if the current npc is a pc, false otherwise

◆ npc_is_quest()

int32_t quest::npc_is_quest ( lua_State *  L)

lua will return whether or not the current npc is of the current quest

LuaFunc:
npc.is_quest()
Returns
[1] LuaBoolean: true if the current npc is of the current quest, false otherwise

◆ npc_kill()

int32_t quest::npc_kill ( lua_State *  L)

it will kill the current npc

LuaFunc:
npc.kill()
Returns
nil

◆ npc_lock()

int32_t quest::npc_lock ( lua_State *  L)

it will block the current npc making it unclickable until npc.unlock is used

LuaFunc:
npc.lock()
Returns
nil

◆ npc_open_shop()

int32_t quest::npc_open_shop ( lua_State *  L)

it will open the npc's shop id [shop_vnum]

LuaFunc:
npc.open_shop(LuaNumber shop_vnum)
Returns
nil

◆ npc_purge()

int32_t quest::npc_purge ( lua_State *  L)

it will purge (destroy/make disappear) the current npc

LuaFunc:
npc.purge()
Returns
nil

◆ npc_set_vid_attack_mul()

int32_t quest::npc_set_vid_attack_mul ( lua_State *  L)

it will set the npc [vid]'s attack multiply to [value]

LuaFunc:
npc.set_vid_attack_mul(LuaNumber vid, LuaNumber value)
Returns
nil

◆ npc_set_vid_damage_mul()

int32_t quest::npc_set_vid_damage_mul ( lua_State *  L)

it will set the npc [vid]'s damage multiply to [value]

LuaFunc:
npc.set_vid_damage_mul(LuaNumber vid, LuaNumber value)
Returns
nil

◆ npc_unlock()

int32_t quest::npc_unlock ( lua_State *  L)

it will unlock the current npc that was unclickable by npc.lock

LuaFunc:
npc.unlock()
Returns
nil

◆ oxevent_close()

int32_t quest::oxevent_close ( lua_State *  L)

it will set the oxevent status as OXEVENT_CLOSE

LuaFunc:
oxevent.close()
Returns
nil

◆ oxevent_end_event()

int32_t quest::oxevent_end_event ( lua_State *  L)

it will stop the oxevent within 5 seconds and set its status to OXEVENT_FINISH

LuaFunc:
oxevent.end_event()
Returns
nil

◆ oxevent_end_event_force()

int32_t quest::oxevent_end_event_force ( lua_State *  L)

it will stop the oxevent and set its status to OXEVENT_FINISH

LuaFunc:
oxevent.end_event_force()
Returns
nil

◆ oxevent_get_attender()

int32_t quest::oxevent_get_attender ( lua_State *  L)

lua will return the count of the remaining oxevent's partecipants (no observers)

LuaFunc:
oxevent.get_attender()
Returns
[1] LuaNumber: the count of the remaining oxevent's partecipants (no observers)

◆ oxevent_get_oxquiz_fn()

int32_t quest::oxevent_get_oxquiz_fn ( lua_State *  L)

lua will return the oxquiz file name (locale_path+"oxquiz.lua" by default)

LuaFunc:
oxevent.get_oxquiz_fn()
NewStuff:
oxevent.get_oxquiz_fn()
New LuaFunc:
oxevent.get_oxquiz_fn()
Returns
[1] LuaString: the oxquiz file name

◆ oxevent_get_status()

int32_t quest::oxevent_get_status ( lua_State *  L)

lua will return the oxevent status

LuaFunc:
oxevent.get_status()
Returns
[1] LuaNumber: the oxevent status

◆ oxevent_give_item()

int32_t quest::oxevent_give_item ( lua_State *  L)

it will give to every remaining oxevent's partecipants (no observers)

LuaFunc:
oxevent.give_item(LuaNumber item_vnum, LuaNumber count)
Returns
nil

◆ oxevent_open()

int32_t quest::oxevent_open ( lua_State *  L)

it will read the oxquiz file and set the oxevent status as OXEVENT_OPEN

LuaFunc:
oxevent.open()
Returns
[1] LuaNumber: 1 if the oxquiz file has been read successfully, 0 otherwise

◆ oxevent_quiz()

int32_t quest::oxevent_quiz ( lua_State *  L)

it will pick up an oxquiz question with level=[level] and make the announcement
the answer will be given after [timeout] seconds

LuaFunc:
oxevent.quiz(LuaNumber level, LuaNumber timeout)
Returns
[1] LuaNumber: 1 if no error occurred, 0 otherwise

◆ oxevent_set_oxquiz_fn()

int32_t quest::oxevent_set_oxquiz_fn ( lua_State *  L)

it will set the oxquiz file name as locale_path+[filename]

LuaFunc:
oxevent.set_oxquiz_fn(LuaString filename)
NewStuff:
oxevent.set_oxquiz_fn(LuaString filename)
New LuaFunc:
oxevent.set_oxquiz_fn(LuaString filename)
Returns
nil

◆ oxevent_set_oxquiz_fn0()

int32_t quest::oxevent_set_oxquiz_fn0 ( lua_State *  L)

it will set the oxquiz file name as [filename]

LuaFunc:
oxevent.set_oxquiz_fn0(LuaString filename)
NewStuff:
oxevent.set_oxquiz_fn0(LuaString filename)
New LuaFunc:
oxevent.set_oxquiz_fn0(LuaString filename)
LuaFunc:
oxevent.set_oxquiz_fn_ex(LuaString filename)
NewStuff:
oxevent.set_oxquiz_fn_ex(LuaString filename)
New LuaFunc:
oxevent.set_oxquiz_fn_ex(LuaString filename)
Returns
nil

◆ party_chat()

int32_t quest::party_chat ( lua_State *  L)

it will send a chat [s] message to any online member

LuaFunc:
party.chat(LuaString ...s)
Returns
nil

◆ party_clear_ready()

int32_t quest::party_clear_ready ( lua_State *  L)

it clears the AFFECT_DUNGEON_READY affect from each near member

LuaFunc:
party.clear_ready()
Returns
nil

◆ party_delete_party()

int32_t quest::party_delete_party ( lua_State *  L)

the current pc deletes the party if the current pc is leader, and lua will return whether it succeeded or not

LuaFunc:
party.delete_party()
NewStuff:
party.delete_party()
New LuaFunc:
party.delete_party()
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ party_get_flag()

int32_t quest::party_get_flag ( lua_State *  L)

lua will return the value of the party flag [flagname]

LuaFunc:
party.getf(LuaString flagname)
Returns
[1] LuaNumber: the value of the party flag [flagname]

◆ party_get_leader_pid()

int32_t quest::party_get_leader_pid ( lua_State *  L)

lua will return the pid of the party's leader, otherwise -1

LuaFunc:
party.get_leader_pid()
Returns
[1] LuaNumber: the pid of the party's leader, otherwise -1

◆ party_get_max_level()

int32_t quest::party_get_max_level ( lua_State *  L)

lua will return the higher level of the party

LuaFunc:
party.get_max_level()
Returns
[1] LuaNumber: the higher level of the party

◆ party_get_member_pids()

int32_t quest::party_get_member_pids ( lua_State *  L)

lua will return a list of every online party member's pid present in the same map of the current pc

LuaFunc:
party.get_member_pids()
Returns
[1] LuaTable[LuaNumber]: a list of every online party member's pid present in the same map of the current pc, otherwise nil

◆ party_get_min_level()

int32_t quest::party_get_min_level ( lua_State *  L)

lua will return the lower level of the party

LuaFunc:
party.get_min_level()
NewStuff:
party.get_min_level()
New LuaFunc:
party.get_min_level()
Returns
[1] LuaNumber: the lower level of the party

◆ party_get_near_count()

int32_t quest::party_get_near_count ( lua_State *  L)

lua will return the count of near members

LuaFunc:
party.get_near_count()
Returns
[1] LuaNumber: the count of near members

◆ party_give_buff()

int32_t quest::party_give_buff ( lua_State *  L)

it will give the relative buff to the every party member in the current pc map, and lua will return whether or not the buff has been given

LuaFunc:
party.give_buff(LuaNumber type, LuaNumber applyOn, LuaNumber applyValue, LuaNumber flag, LuaNumber duration, LuaNumber spCost, LuaBoolean override, LuaBoolean isCube)
Returns
[1] LuaBoolean: true if the buff has been given, otherwise false

◆ party_is_in_dungeon()

int32_t quest::party_is_in_dungeon ( lua_State *  L)

lua will return whether or not the party is in dungeon

LuaFunc:
party.is_in_dungeon()
Returns
[1] LuaBoolean: true if the party is in dungeon, otherwise false

◆ party_is_leader()

int32_t quest::party_is_leader ( lua_State *  L)

lua will return true if pc is the leader, otherwise false

LuaFunc:
party.is_leader()
Returns
[1] LuaBoolean: true if pc is the leader, otherwise false

◆ party_is_map_member_flag_lt()

int32_t quest::party_is_map_member_flag_lt ( lua_State *  L)

lua will return whether or not [value] is higher than the party flag [flagname] for each member

LuaFunc:
party.is_map_member_flag_lt(LuaString flagname, LuaNumber value)
Returns
[1] LuaBoolean: true if [value] is higher than the party flag [flagname] for each member, false otherwise

◆ party_is_party()

int32_t quest::party_is_party ( lua_State *  L)

lua will return true if pc is in a party, otherwise false

LuaFunc:
party.is_party()
Returns
[1] LuaBoolean: true if pc is in a party, otherwise false

◆ party_leave_party()

int32_t quest::party_leave_party ( lua_State *  L)

the current pc leaves the party, and lua will return whether it succeeded or not

LuaFunc:
party.leave_party()
NewStuff:
party.leave_party()
New LuaFunc:
party.leave_party()
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ party_run_cinematic()

int32_t quest::party_run_cinematic ( lua_State *  L)

it sends a RUN_CINEMA [str] script to all the near members

LuaFunc:
party.run_cinematic(LuaString str)
Returns
nil

◆ party_set_flag()

int32_t quest::party_set_flag ( lua_State *  L)

each party member will have the party flag [flagname] set as [value]

LuaFunc:
party.setf(LuaString flagname, LuaNumber value)
Returns
nil

◆ party_set_quest_flag()

int32_t quest::party_set_quest_flag ( lua_State *  L)

each party member will have the quest flag [flagname] set as [value]

LuaFunc:
party.setqf(LuaString flagname, LuaNumber value)
Returns
nil

◆ party_show_cinematic()

int32_t quest::party_show_cinematic ( lua_State *  L)

it sends a CINEMATIC [str] packet script to all the near members

LuaFunc:
party.show_cinematic(LuaString str)
Returns
nil

◆ party_syschat()

int32_t quest::party_syschat ( lua_State *  L)

it will send a syschat [s] message to any online member

LuaFunc:
party.syschat(LuaString ...s)
Returns
nil

◆ pc_aggregate_monster()

int32_t quest::pc_aggregate_monster ( lua_State *  L)

it will aggro against the current player all the monsters close

LuaFunc:
pc.aggregate_monster()
Returns
nil

◆ pc_attract_ranger()

int32_t quest::pc_attract_ranger ( lua_State *  L)

it will set the BOW_DISTANCE to 150 for 3 minutes to the monsters close to the current player

LuaFunc:
pc.attract_ranger()
Returns
nil

◆ pc_can_warp()

int32_t quest::pc_can_warp ( lua_State *  L)

lua will return whether or not the current player can warp

LuaFunc:
pc.can_warp()
Returns
[1] LuaBoolean: true if the current player can warp, false otherwise

◆ pc_change_alignment()

int32_t quest::pc_change_alignment ( lua_State *  L)

it will change the current player's alignment to [amount] (increase or decrease)

LuaFunc:

pc.changealignment(LuaNumber amount)

pc.change_alignment(LuaNumber amount)

Returns
nil

◆ pc_change_empire()

int32_t quest::pc_change_empire ( lua_State *  L)

it will change the current player's empire to [empire]

LuaFunc:
pc.change_empire(LuaNumber empire)
Returns
[1] LuaNumber: the internal return type of ChangeEmpire; 0 succeeded or no player's id in db, 1 if same empire of [empire], 2 if in guild, 3 if married/engaged, 999 if it failed switching empire;

◆ pc_change_money()

int32_t quest::pc_change_money ( lua_State *  L)

it will change the current player's yangs to [amount] (increase or decrease)

LuaFunc:

pc.changegold(LuaNumber amount)

pc.changemoney(LuaNumber amount)

pc.change_gold(LuaNumber amount)

pc.change_money(LuaNumber amount)

Returns
nil

◆ pc_change_name()

int32_t quest::pc_change_name ( lua_State *  L)

it will switch the current player's name to [name] deleting also the friend list of the old name from everyone

LuaFunc:
pc.change_name(LuaString name)
Returns
[1] LuaNumber: the error status
2 if the [name] is not a std::string;
2 if the [name] is not valid;
3 if the [name] is already used;
4 if all is fine;
5 if pc_change_name it's blocked in the current locale;

◆ pc_change_sex()

int32_t quest::pc_change_sex ( lua_State *  L)

it will switch the current player's sex

LuaFunc:
pc.change_sex()
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_change_sp()

int32_t quest::pc_change_sp ( lua_State *  L)

it will set the current player's sp to [amount]

LuaFunc:
pc.change_sp(LuaNumber amount)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_charge_cash()

int32_t quest::pc_charge_cash ( lua_State *  L)

lua will return whether or not the cash charge request of [amount] by type [charge_type] has been sent

LuaFunc:
pc.charge_cash(LuaNumber amount, LuaString charge_type)
Returns
[1] LuaBoolean: false if there is no current pc, or if [amount] <1 or >50000, otherwise true

◆ pc_clear_one_skill()

int32_t quest::pc_clear_one_skill ( lua_State *  L)

it will clear the current player's skill [vnum]

LuaFunc:
pc.clear_one_skill(LuaNumber vnum)
Returns
[1] LuaNumber: 0 if failed, nil otherwise

◆ pc_clear_skill()

int32_t quest::pc_clear_skill ( lua_State *  L)

it will clear the current player's skills

LuaFunc:
pc.clear_skill()
Returns
nil

◆ pc_clear_sub_skill()

int32_t quest::pc_clear_sub_skill ( lua_State *  L)

it will clear the current player's sub skills

LuaFunc:
pc.clear_sub_skill()
Returns
nil

◆ pc_count_item()

int32_t quest::pc_count_item ( lua_State *  L)

lua will return the count of the item by name|vnum [item_name] from the whole current player's inventory

LuaFunc:
pc.count_item(LuaNumber|LuaString item_name)
Returns
[1] LuaNumber: the count of the item by name|vnum [item_name] from the whole current player's inventory, 0 otherwise

◆ pc_dc_delayed0()

int32_t quest::pc_dc_delayed0 ( lua_State *  L)

it will disconnect the current player in [seconds] seconds (if you run twice, the second time, the second could fail since there's already a disconnect event)

LuaFunc:
pc.dc_delayed0(LuaNumber seconds)
NewStuff:
pc.dc_delayed0(LuaNumber seconds)
New LuaFunc:
pc.dc_delayed0(LuaNumber seconds)
LuaFunc:
pc.dc_delayed(LuaNumber seconds)
NewStuff:
pc.dc_delayed(LuaNumber seconds)
New LuaFunc:
pc.dc_delayed(LuaNumber seconds)
Returns
[1] LuaBoolean: true if disconnected, false otherwise

◆ pc_dc_direct0()

int32_t quest::pc_dc_direct0 ( lua_State *  L)

it will immediately disconnect the current player with the reason [reason]

LuaFunc:
pc.dc_direct0(LuaString reason)
NewStuff:
pc.dc_direct0(LuaString reason)
New LuaFunc:
pc.dc_direct0(LuaString reason)
LuaFunc:
pc.dc_direct(LuaString reason)
NewStuff:
pc.dc_direct(LuaString reason)
New LuaFunc:
pc.dc_direct(LuaString reason)
Returns
nil

◆ pc_dec_skill_point()

int32_t quest::pc_dec_skill_point ( lua_State *  L)

it will decrease the current player's skill points by one

LuaFunc:
pc.dec_skill_point()
Returns
nil

◆ pc_del_another_quest_flag()

int32_t quest::pc_del_another_quest_flag ( lua_State *  L)

it will delete the [questname].[flagname] quest flag from the current player

LuaFunc:
pc.delf(LuaString questname, LuaString flagname)
NewStuff:
pc.delf(LuaString questname, LuaString flagname)
New LuaFunc:
pc.delf(LuaString questname, LuaString flagname)
Returns
[1] LuaBoolean: true if succeeded, false otherwise; nil if wrong args

◆ pc_del_quest_flag()

int32_t quest::pc_del_quest_flag ( lua_State *  L)

it will delete from the current player the quest flag GetCurrentQuestName()".[flagname]"

LuaFunc:
pc.delqf(LuaString flagname)
Returns
nil

◆ pc_destroy_guild()

int32_t quest::pc_destroy_guild ( lua_State *  L)

it will destroy the current player's guild if guild master

LuaFunc:
pc.remove_from_guild()
Returns
nil

◆ pc_diamond_refine()

int32_t quest::pc_diamond_refine ( lua_State *  L)

it will refine the current player's current ore item (mineral) with the percentage [pct] of success, and with the cost of [cost] yangs

LuaFunc:
pc.diamond_refine(LuaNumber cost, LuaNumber pct)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_enough_inventory()

int32_t quest::pc_enough_inventory ( lua_State *  L)

lua will return whether or not the current player has enough space in the inventory to store the item [item_vnum]

LuaFunc:
pc.enough_inventory(LuaNumber item_vnum)
Returns
[1] LuaBoolean: true if the current player has enough space in the inventory to store the item [item_vnum], false otherwise

◆ pc_equip_slot0()

int32_t quest::pc_equip_slot0 ( lua_State *  L)

it will equip the item [slot] from the inventory

LuaFunc:
pc.equip_slot0(LuaNumber slot)
NewStuff:
pc.equip_slot0(LuaNumber slot)
New LuaFunc:
pc.equip_slot0(LuaNumber slot)
LuaFunc:
pc.equip_slot(LuaNumber slot)
NewStuff:
pc.equip_slot(LuaNumber slot)
New LuaFunc:
pc.equip_slot(LuaNumber slot)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_forget_my_attacker()

int32_t quest::pc_forget_my_attacker ( lua_State *  L)

it will let all the monsters forget about attacking the current player, and be in REVIVE_INVISIBLE for 5 seconds

LuaFunc:
pc.forget_my_attacker()
Returns
nil

◆ pc_get_account()

int32_t quest::pc_get_account ( lua_State *  L)

lua will return the current player's account name

LuaFunc:
pc.get_account()
Returns
[1] LuaString: the current player's account name

◆ pc_get_account_id()

int32_t quest::pc_get_account_id ( lua_State *  L)

lua will return the current player's account id

LuaFunc:
pc.get_account_id()
Returns
[1] LuaNumber: the current player's account id

◆ pc_get_alignment()

int32_t quest::pc_get_alignment ( lua_State *  L)

lua will return the current player's alignment

LuaFunc:
pc.get_alignment()
Returns
[1] LuaNumber: the current player's alignment

◆ pc_get_another_quest_flag()

int32_t quest::pc_get_another_quest_flag ( lua_State *  L)

lua will return the current player's quest [questname]'s flag [flagname]'s value

LuaFunc:
pc.getf(LuaString questname, LuaString flagname)
Returns
[1] LuaNumber: the current player's quest [questname]'s flag [flagname]

◆ pc_get_armor()

int32_t quest::pc_get_armor ( lua_State *  L)

lua will return the current player's wear armor's vnum

LuaFunc:

pc.getarmor(LuaNumber cell)

pc.get_armor(LuaNumber cell)

Returns
[1] LuaNumber: the current player's wear armor's vnum, nil otherwise

◆ pc_get_change_empire_count()

int32_t quest::pc_get_change_empire_count ( lua_State *  L)

lua will return the current player's change_empire count

LuaFunc:
pc.get_change_empire_count()
Returns
[1] LuaNumber: the current player's change_empire count

◆ pc_get_channel_id()

int32_t quest::pc_get_channel_id ( lua_State *  L)

lua will return the current game's channel id

LuaFunc:
pc.get_channel_id()
Returns
[1] LuaNumber: the current game's channel id

◆ pc_get_client_version0()

int32_t quest::pc_get_client_version0 ( lua_State *  L)

lua will return the current player's client version

LuaFunc:
pc.get_client_version0()
NewStuff:
pc.get_client_version0()
New LuaFunc:
pc.get_client_version0()
LuaFunc:
pc.get_client_version()
NewStuff:
pc.get_client_version()
New LuaFunc:
pc.get_client_version()
Returns
[1] LuaString: the current player's client version

◆ pc_get_current_map_index()

int32_t quest::pc_get_current_map_index ( lua_State *  L)

lua will return the current player's map index

LuaFunc:

pc.getcurrentmapindex()

pc.get_map_index()

Returns
[1] LuaNumber: the current player's map index

◆ pc_get_dx()

int32_t quest::pc_get_dx ( lua_State *  L)

lua will return the current player's dex points

LuaFunc:
pc.get_dx()
Returns
[1] LuaNumber: the current player's dex points

◆ pc_get_empire()

int32_t quest::pc_get_empire ( lua_State *  L)

lua will return the current player's empire

LuaFunc:
pc.get_part()
Returns
[1] LuaNumber: the current player's empire

◆ pc_get_empty_inventory_count()

int32_t quest::pc_get_empty_inventory_count ( lua_State *  L)

lua will return how many empty slots are present in the current player's inventory

LuaFunc:
pc.get_empty_inventory_count()
Returns
[1] LuaNumber: the count of the empty slots present in the current player's inventory

◆ pc_get_equip_refine_level()

int32_t quest::pc_get_equip_refine_level ( lua_State *  L)

lua will return the current player's wear item in pos [cell]'s refine level

LuaFunc:
pc.get_equip_refine_level(LuaNumber cell)
Returns
[1] LuaNumber: the current player's wear item in pos [cell]'s refine level, 0 otherwise

◆ pc_get_exp()

int32_t quest::pc_get_exp ( lua_State *  L)

lua will return the current player's exp

LuaFunc:
pc.get_exp()
Returns
[1] LuaNumber: the current player's exp

◆ pc_get_exp_level()

int32_t quest::pc_get_exp_level ( lua_State *  L)

lua will return the exp required for the level [level]

LuaFunc:
pc.get_exp_level(LuaNumber level)
NewStuff:
pc.get_exp_level(LuaNumber level)
New LuaFunc:
pc.get_exp_level(LuaNumber level)
Returns
[1] LuaNumber: the exp required for the level [level]

◆ pc_get_exp_level0()

int32_t quest::pc_get_exp_level0 ( lua_State *  L)

lua will return just [pct] percent of the exp required for the level [level]

LuaFunc:
pc.get_exp_level0(LuaNumber level, LuaNumber pct)
NewStuff:
pc.get_exp_level0(LuaNumber level, LuaNumber pct)
New LuaFunc:
pc.get_exp_level0(LuaNumber level, LuaNumber pct)
LuaFunc:
pc.get_exp_level_pct(LuaNumber level, LuaNumber pct)
NewStuff:
pc.get_exp_level_pct(LuaNumber level, LuaNumber pct)
New LuaFunc:
pc.get_exp_level_pct(LuaNumber level, LuaNumber pct)
Returns
[1] LuaNumber: the exp required for the level [level]

◆ pc_get_flag()

int32_t quest::pc_get_flag ( lua_State *  L)

lua will return the current player's quest flag [questandflag]'s value (it must be as "quest.flag")

LuaFunc:
pc.getf2(LuaString questandflag)
NewStuff:
pc.getf2(LuaString questandflag)
New LuaFunc:
pc.getf2(LuaString questandflag)
Returns
[1] LuaNumber: the current player's quest flag [questandflag]'s value, nil if wrong args

◆ pc_get_gm_level()

int32_t quest::pc_get_gm_level ( lua_State *  L)

lua will return the current player's gm level (normal players are 0)

LuaFunc:
pc.get_gm_level()
Returns
[1] LuaNumber: the current player's gm level

◆ pc_get_horse_hp()

int32_t quest::pc_get_horse_hp ( lua_State *  L)

lua will return the current player's horse's health

LuaFunc:
pc.get_horse_hp()
Returns
[1] LuaNumber: the current player's horse's health, 0 otherwise

◆ pc_get_horse_level()

int32_t quest::pc_get_horse_level ( lua_State *  L)

lua will return the current player's horse's level

LuaFunc:
pc.get_horse_level()
Returns
[1] LuaNumber: the current player's horse's level

◆ pc_get_horse_stamina()

int32_t quest::pc_get_horse_stamina ( lua_State *  L)

lua will return the current player's horse's stamina

LuaFunc:
pc.get_horse_stamina()
Returns
[1] LuaNumber: the current player's horse's stamina, 0 otherwise

◆ pc_get_hp()

int32_t quest::pc_get_hp ( lua_State *  L)

lua will return the current player's hp

LuaFunc:

pc.gethp()

pc.get_hp()

Returns
[1] LuaNumber: the current player's hp

◆ pc_get_ht()

int32_t quest::pc_get_ht ( lua_State *  L)

lua will return the current player's vit points

LuaFunc:
pc.get_ht()
Returns
[1] LuaNumber: the current player's vit points

◆ pc_get_informer_item()

int32_t quest::pc_get_informer_item ( lua_State *  L)

lua will return the current item award's vnum for the current pc (available only in the quest event item_informer)

LuaFunc:
pc.get_informer_item()
Returns
[1] LuaNumber: the current item award's vnum for the current pc

◆ pc_get_informer_type()

int32_t quest::pc_get_informer_type ( lua_State *  L)

lua will return the current item award's cmd for the current pc (available only in the quest event item_informer)

LuaFunc:
pc.get_informer_type()
Returns
[1] LuaString: the current item award's cmd for the current pc

◆ pc_get_ip0()

int32_t quest::pc_get_ip0 ( lua_State *  L)

lua will return the current player's ip

LuaFunc:
pc.get_ip0()
NewStuff:
pc.get_ip0()
New LuaFunc:
pc.get_ip0()
LuaFunc:
pc.get_ip()
NewStuff:
pc.get_ip()
New LuaFunc:
pc.get_ip()
Returns
[1] LuaString: the current player's ip

◆ pc_get_iq()

int32_t quest::pc_get_iq ( lua_State *  L)

lua will return the current player's int points

LuaFunc:
pc.get_iq()
Returns
[1] LuaNumber: the current player's int points

◆ pc_get_job()

int32_t quest::pc_get_job ( lua_State *  L)

lua will return the current player's job

LuaFunc:
pc.get_job()
Returns
[1] LuaNumber: the current player's job

◆ pc_get_killee_drop_pct()

int32_t quest::pc_get_killee_drop_pct ( lua_State *  L)

lua will return the current npc's kill drop pct for the current pc

LuaFunc:
pc.get_killee_drop_pct()
Returns
[1] LuaNumber: the current npc's kill drop's delta percent for the current pc
[2] LuaNumber: the current npc's kill drop's rand range for the current pc

◆ pc_get_leadership()

int32_t quest::pc_get_leadership ( lua_State *  L)

lua will return the current player's leadership subskill's level

LuaFunc:

pc.getleadership()

pc.get_leadership()

Returns
[1] LuaBoolean: the current player's leadership subskill's level

◆ pc_get_level()

int32_t quest::pc_get_level ( lua_State *  L)

lua will return the current player's level

LuaFunc:
pc.get_level()
Returns
[1] LuaNumber: the current player's level

◆ pc_get_local_x()

int32_t quest::pc_get_local_x ( lua_State *  L)

lua will return the current player's local map x

LuaFunc:
pc.get_local_x()
Returns
[1] LuaNumber: the current player's local map x

◆ pc_get_local_y()

int32_t quest::pc_get_local_y ( lua_State *  L)

lua will return the current player's local map y

LuaFunc:
pc.get_local_y()
Returns
[1] LuaNumber: the current player's local map y

◆ pc_get_logoff_interval()

int32_t quest::pc_get_logoff_interval ( lua_State *  L)

lua will return the current player's logoff interval
the logoff interval is a variable set at login and it's the result of NOW()-last_play (so the time passed before the last login)

LuaFunc:
pc.get_logoff_interval()
Returns
[1] LuaNumber: the current player's logoff interval, 0 otherwise

◆ pc_get_max_hp()

int32_t quest::pc_get_max_hp ( lua_State *  L)

lua will return the current player's max hp

LuaFunc:

pc.getmaxhp()

pc.get_max_hp()

Returns
[1] LuaNumber: the current player's max hp

◆ pc_get_max_sp()

int32_t quest::pc_get_max_sp ( lua_State *  L)

lua will return the current player's max sp

LuaFunc:

pc.getmaxsp()

pc.get_max_sp()

Returns
[1] LuaNumber: the current player's max sp

◆ pc_get_money()

int32_t quest::pc_get_money ( lua_State *  L)

lua will return the current player's yangs

LuaFunc:

pc.getmoney()

pc.getgold()

pc.get_money()

pc.get_gold()

Returns
[1] LuaNumber: the current player's yangs

◆ pc_get_name()

int32_t quest::pc_get_name ( lua_State *  L)

lua will return the current player's name

LuaFunc:

pc.getname()

pc.get_name()

Returns
[1] LuaString: the current player's name

◆ pc_get_next_exp()

int32_t quest::pc_get_next_exp ( lua_State *  L)

lua will return the current player's next exp

LuaFunc:
pc.get_next_exp()
Returns
[1] LuaNumber: the current player's next exp

◆ pc_get_part()

int32_t quest::pc_get_part ( lua_State *  L)

lua will return the current player's part [part_id]

LuaFunc:
pc.get_part(LuaNumber part_id)
Returns
[1] LuaNumber: the current player's part [part_id]

◆ pc_get_player_id()

int32_t quest::pc_get_player_id ( lua_State *  L)

lua will return the current player's pid

LuaFunc:
pc.get_player_id()
Returns
[1] LuaNumber: the current player's pid

◆ pc_get_playtime()

int32_t quest::pc_get_playtime ( lua_State *  L)

lua will return the current player's playtime

LuaFunc:

pc.getplaytime()

pc.get_playtime()

Returns
[1] LuaNumber: the current player's playtime

◆ pc_get_premium_remain_sec()

int32_t quest::pc_get_premium_remain_sec ( lua_State *  L)

lua will return the current player's premium [index]'s value; if [index]==0 exp, 1 item, 2 safebox, 3 autoloot, 4 fish_mind, 5 marriage_fast, 6 gold

LuaFunc:
pc.get_premium_remain_sec(LuaNumber index)
Returns
[1] LuaNumber: the current player's premium [index]'s value; nil if wrong arg

◆ pc_get_quest_flag()

int32_t quest::pc_get_quest_flag ( lua_State *  L)

lua will return the current player's quest flag GetCurrentQuestName()".[flagname]"'s value

LuaFunc:
pc.getqf(LuaString flag)
Returns
[1] LuaNumber: the current player's quest flag GetCurrentQuestName()".[flagname]"'s value, nil if wrong args

◆ pc_get_race()

int32_t quest::pc_get_race ( lua_State *  L)

lua will return the current player's race

LuaFunc:
pc.get_race()
Returns
[1] LuaNumber: the current player's race

◆ pc_get_real_alignment()

int32_t quest::pc_get_real_alignment ( lua_State *  L)

lua will return the current player's real_alignment

LuaFunc:
pc.get_real_alignment()
Returns
[1] LuaNumber: the current player's real_alignment

◆ pc_get_sex()

int32_t quest::pc_get_sex ( lua_State *  L)

lua will return the current player's sex (0 male, 1 female)

LuaFunc:
pc.get_sex()
Returns
[1] LuaNumber: the current player's sex

◆ pc_get_sig_items()

int32_t quest::pc_get_sig_items ( lua_State *  L)

lua will return the list of every mount seal item's vnum by id [group_vnum]

LuaFunc:
pc.get_sig_items(LuaNumber group_vnum)
Returns
[1] LuaTable[LuaNumber]: the list of every mount seal item's vnum

◆ pc_get_skill_level()

int32_t quest::pc_get_skill_level ( lua_State *  L)

lua will return the current player's skill [vnum]'s level

LuaFunc:
pc.get_skill_level(LuaNumber vnum)
Returns
[1] LuaNumber: the current player's skill [vnum]'s level

◆ pc_get_skill_point()

int32_t quest::pc_get_skill_point ( lua_State *  L)

lua will return the current player's skill points

LuaFunc:
pc.get_skill_point()
Returns
[1] LuaNumber: the current player's skill points

◆ pc_get_skillgroup()

int32_t quest::pc_get_skillgroup ( lua_State *  L)

lua will return the current player's skill group

LuaFunc:
pc.get_skill_group()
Returns
[1] LuaNumber: the current player's skill group

◆ pc_get_socket_items()

int32_t quest::pc_get_socket_items ( lua_State *  L)

lua will return the table of any items containing stone sockets

LuaFunc:
pc.get_socket_items()
Returns
[1] LuaTable[LuaTable[LuaString, LuaNumber]: item's name, item's inventory's pos

◆ pc_get_sp()

int32_t quest::pc_get_sp ( lua_State *  L)

lua will return the current player's sp

LuaFunc:

pc.getsp()

pc.get_sp()

Returns
[1] LuaNumber: the current player's sp

◆ pc_get_special_ride_vnum()

int32_t quest::pc_get_special_ride_vnum ( lua_State *  L)

lua will return the current player's mount seal's vnum and left time

LuaFunc:
pc.get_special_ride_vnum()
Returns
[1] LuaNumber: the current player's mount seal's vnum, 0 otherwise
[2] LuaNumber: the current player's mount seal's left time, 0 otherwise

◆ pc_get_st()

int32_t quest::pc_get_st ( lua_State *  L)

lua will return the current player's str points

LuaFunc:
pc.get_st()
Returns
[1] LuaNumber: the current player's str points

◆ pc_get_start_location()

int32_t quest::pc_get_start_location ( lua_State *  L)

lua will return the start location of the current player's empire

LuaFunc:
pc.get_start_location()
Returns
[1] LuaNumber: the start location's map index
[2] LuaNumber: the start location's map x
[3] LuaNumber: the start location's map y

◆ pc_get_vid()

int32_t quest::pc_get_vid ( lua_State *  L)

lua will return the current player's vid

LuaFunc:
pc.get_vid()
Returns
[1] LuaNumber: the current player's vid

◆ pc_get_war_map()

int32_t quest::pc_get_war_map ( lua_State *  L)

lua will return the current player's guild war map's index

LuaFunc:
pc.get_war_map()
Returns
[1] LuaNumber: the current player's guild war map's index, 0 otherwise

◆ pc_get_weapon()

int32_t quest::pc_get_weapon ( lua_State *  L)

lua will return the current player's wear weapon's vnum

LuaFunc:

pc.getweapon(LuaNumber cell)

pc.get_weapon(LuaNumber cell)

Returns
[1] LuaNumber: the current player's wear weapon's vnum, nil otherwise

◆ pc_get_wear()

int32_t quest::pc_get_wear ( lua_State *  L)

lua will return the current player's wear in pos [cell]'s vnum

LuaFunc:
pc.get_wear(LuaNumber cell)
Returns
[1] LuaNumber: the current player's wear in pos [cell]'s vnum, nil otherwise

◆ pc_get_x()

int32_t quest::pc_get_x ( lua_State *  L)

lua will return the current player's world map x

LuaFunc:

pc.getx()

pc.get_x()

Returns
[1] LuaNumber: the current player's world map x

◆ pc_get_y()

int32_t quest::pc_get_y ( lua_State *  L)

lua will return the current player's world map y

LuaFunc:

pc.gety()

pc.get_y()

Returns
[1] LuaNumber: the current player's world map y

◆ pc_getguild()

int32_t quest::pc_getguild ( lua_State *  L)

lua will return the current player's guild id

LuaFunc:

pc.getguild()

pc.get_guild()

Returns
[1] LuaNumber: the current player's guild id, 0 otherwise

◆ pc_give_award()

int32_t quest::pc_give_award ( lua_State *  L)

it will create the item [vnum], count [count] with reason [why] to the current pc

LuaFunc:
pc.give_award(LuaNumber vnum, LuaNumber count, LuaString why)
Returns
[1] LuaNumber: 0

◆ pc_give_award_socket()

int32_t quest::pc_give_award_socket ( lua_State *  L)

it will create the item [vnum], count [count] and sockets [socket1~3] with reason [why] to the current pc

LuaFunc:
pc.give_award_socket(LuaNumber vnum, LuaNumber count, LuaString socket1, LuaString socket2, LuaString socket3, LuaString why)
Returns
[1] LuaNumber: 0

◆ pc_give_exp()

int32_t quest::pc_give_exp ( lua_State *  L)

it will give to player [name] [exp] exp points

LuaFunc:
pc.give_exp(LuaString name, LuaNumber exp)
Returns
nil

◆ pc_give_exp2()

int32_t quest::pc_give_exp2 ( lua_State *  L)

it will give to player [name] [exp] exp points (via point change)

LuaFunc:
pc.give_exp(LuaString name, LuaNumber exp)
Returns
nil

◆ pc_give_exp_perc()

int32_t quest::pc_give_exp_perc ( lua_State *  L)

it will give to player [name] just [perc] percent of the exp required for the level [level]

LuaFunc:
pc.give_exp_perc(LuaString name, LuaNumber level, LuaNumber perc)
Returns
nil

◆ pc_give_gold()

int32_t quest::pc_give_gold ( lua_State *  L)

it will give to the current player [amount] yangs

LuaFunc:
pc.give_gold(LuaNumber amount)
Returns
nil

◆ pc_give_item()

int32_t quest::pc_give_item ( lua_State *  L)

it will give to the current player the item by name|vnum [item_name] with count [count] only if the current quest's flag [flag_name] is NOT set (probably, to prevent duplicated rewards)
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it

LuaFunc:
pc.give_item(LuaString flag_name, LuaString|LuaNumber item_name, LuaNumber count)
Returns
nil

◆ pc_give_item_from_special_item_group()

int32_t quest::pc_give_item_from_special_item_group ( lua_State *  L)

it will give to the current player the item by special_item_group [special_item_group_id]
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it

LuaFunc:
pc.give_item_from_special_item_group(LuaNumber special_item_group_id)
Returns
nil

◆ pc_give_lotto()

int32_t quest::pc_give_lotto ( lua_State *  L)

it will insert a lotto ticket with player's pid in player.lotto_list, and will give to the current player a lotto item (vnum 50001, count 1, socket0 the lotto_list's insert id, socket1 event flag "lotto_round")

LuaFunc:
pc.give_lotto()
Returns
nil

◆ pc_give_or_drop_item()

int32_t quest::pc_give_or_drop_item ( lua_State *  L)

it will give to the current player the item by name|vnum [item_name] with count [count]
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it

LuaFunc:
pc.give_item2(LuaString|LuaNumber item_name, LuaNumber count)
Returns
[1] LuaNumber: the item's id, 0 otherwise

◆ pc_give_or_drop_item_and_select()

int32_t quest::pc_give_or_drop_item_and_select ( lua_State *  L)

it will give to the current player the item by name|vnum [item_name] with count [count], and, if succeeded, the item will become the new current item
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it

LuaFunc:
pc.give_item2_select(LuaString|LuaNumber item_name, LuaNumber count)
Returns
nil

◆ pc_give_or_drop_item_with_dice()

int32_t quest::pc_give_or_drop_item_with_dice ( lua_State *  L)

it will give to the current player the item by name|vnum [item_name] with count [count] in dice mode
if there is no space in the inventory, it will be thrown to the ground with a temporary current player's ownership on it
dice mode = it will be given to a random party member if the current player is in party, otherwise it will be given to the current player

LuaFunc:
pc.give_item2_with_dice(LuaString|LuaNumber item_name, LuaNumber count)
NewStuff:
pc.give_item2_with_dice(LuaString|LuaNumber item_name, LuaNumber count)
New LuaFunc:
pc.give_item2_with_dice(LuaString|LuaNumber item_name, LuaNumber count)
Returns
[1] LuaNumber: the item's id, 0 otherwise

◆ pc_give_poly_marble()

int32_t quest::pc_give_poly_marble ( lua_State *  L)

lua will return whether or not the polymorph marble of the mob [vnum] has been created and given to the current player

LuaFunc:
pc.give_poly_marble(LuaNumber vnum)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_give_polymorph_book()

int32_t quest::pc_give_polymorph_book ( lua_State *  L)

it will give to the current player the marble item (vnum 50322) with socket0 [vnum], socket1 [practice_count], socket2 [book_level]; the field [level_limit] is required but unused

LuaFunc:
pc.give_polymorph_book(LuaNumber vnum, LuaNumber practice_count, LuaNumber book_level, LuaNumber level_limit)
Returns
nil

◆ pc_give_random_book0()

int32_t quest::pc_give_random_book0 ( lua_State *  L)

lua will return whether or not it succedeed

LuaFunc:
pc.give_random_book0()
NewStuff:
pc.give_random_book0()
New LuaFunc:
pc.give_random_book0()
LuaFunc:
pc.give_random_book()
NewStuff:
pc.give_random_book()
New LuaFunc:
pc.give_random_book()
Returns
[1] LuaBoolean: true if the item has been created, false otherwise

◆ pc_has_master_skill()

int32_t quest::pc_has_master_skill ( lua_State *  L)

lua will return whether or not the current player's skill [skill_id] is at least master or higher (lvl 21 or above)

LuaFunc:
pc.has_master_skill(LuaNumber skill_id)
Returns
[1] LuaBoolean: true if the current player's skill [skill_id] is at least master or higher, false otherwise

◆ pc_hasguild()

int32_t quest::pc_hasguild ( lua_State *  L)

lua will return whether or not the current player is in a guild

LuaFunc:

pc.hasguild()

pc.has_guild()

Returns
[1] LuaBoolean: true if the current player is in a guild, false otherwise

◆ pc_have_map_scroll()

int32_t quest::pc_have_map_scroll ( lua_State *  L)

lua will return whether or not the current player has any location scroll for the map [map_name]

LuaFunc:
pc.have_map_scroll(LuaString map_name)
Returns
[1] LuaBoolean: true if found, false otherwise

◆ pc_have_pos_scroll()

int32_t quest::pc_have_pos_scroll ( lua_State *  L)

lua will return whether or not the current player has any location scroll for the coordinates [world_x][world_y] with range [range]

LuaFunc:
pc.have_pos_scroll(LuaNumber world_x, LuaNumber world_y, LuaNumber range)
Returns
[1] LuaBoolean: true if found, false otherwise

◆ pc_if_bleeding()

int32_t quest::pc_if_bleeding ( lua_State *  L)

lua will return whether or not the current player is bleeding

LuaFunc:
pc.is_flag_bleeding()
NewStuff:
pc.is_flag_bleeding()
New LuaFunc:
pc.is_flag_bleeding()
Returns
[1] LuaBoolean: true if the current player is bleeding, false otherwise

◆ pc_if_fire()

int32_t quest::pc_if_fire ( lua_State *  L)

lua will return whether or not the current player is on fire

LuaFunc:
pc.is_flag_fire()
NewStuff:
pc.is_flag_fire()
New LuaFunc:
pc.is_flag_fire()
Returns
[1] LuaBoolean: true if the current player is on fire, false otherwise

◆ pc_if_invisible()

int32_t quest::pc_if_invisible ( lua_State *  L)

lua will return whether or not the current player is invisible

LuaFunc:
pc.is_flag_stun()
NewStuff:
pc.is_flag_stun()
New LuaFunc:
pc.is_flag_stun()
Returns
[1] LuaBoolean: true if the current player is invisible, false otherwise

◆ pc_if_poison()

int32_t quest::pc_if_poison ( lua_State *  L)

lua will return whether or not the current player is poisoned

LuaFunc:
pc.is_flag_poison()
NewStuff:
pc.is_flag_poison()
New LuaFunc:
pc.is_flag_poison()
Returns
[1] LuaBoolean: true if the current player is poisoned, false otherwise

◆ pc_if_slow()

int32_t quest::pc_if_slow ( lua_State *  L)

lua will return whether or not the current player is slowed

LuaFunc:
pc.is_flag_slow()
NewStuff:
pc.is_flag_slow()
New LuaFunc:
pc.is_flag_slow()
Returns
[1] LuaBoolean: true if the current player is slowed, false otherwise

◆ pc_if_stun()

int32_t quest::pc_if_stun ( lua_State *  L)

lua will return whether or not the current player is stunned

LuaFunc:
pc.is_flag_stun()
NewStuff:
pc.is_flag_stun()
New LuaFunc:
pc.is_flag_stun()
Returns
[1] LuaBoolean: true if the current player is stunned, false otherwise

◆ pc_in_dungeon()

int32_t quest::pc_in_dungeon ( lua_State *  L)

lua will return whether or not the current player is in a dungeon

LuaFunc:
pc.in_dungeon()
Returns
[1] LuaBoolean: true if the current player is in a dungeon, false otherwise

◆ pc_is_arena0()

int32_t quest::pc_is_arena0 ( lua_State *  L)

lua will return whether or not the current pc is in the arena dueling

LuaFunc:
pc.is_arena0()
NewStuff:
pc.is_arena0()
New LuaFunc:
pc.is_arena0()
LuaFunc:
pc.is_arena()
NewStuff:
pc.is_arena()
New LuaFunc:
pc.is_arena()
Returns
[1] LuaBoolean: true if the current pc is in the arena dueling, false otherwise

◆ pc_is_arena_observer0()

int32_t quest::pc_is_arena_observer0 ( lua_State *  L)

lua will return whether or not the current pc is in arena observer mode

LuaFunc:
pc.is_arena_observer0()
NewStuff:
pc.is_arena_observer0()
New LuaFunc:
pc.is_arena_observer0()
LuaFunc:
pc.is_arena_observer()
NewStuff:
pc.is_arena_observer()
New LuaFunc:
pc.is_arena_observer()
Returns
[1] LuaBoolean: true if the current pc is in arena observer mode, false otherwise

◆ pc_is_available0()

int32_t quest::pc_is_available0 ( lua_State *  L)

lua will return whether or not there is a current pc

LuaFunc:
pc.is_available0()
NewStuff:
pc.is_available0()
New LuaFunc:
pc.is_available0()
LuaFunc:
pc.is_available()
NewStuff:
pc.is_available()
New LuaFunc:
pc.is_available()
Returns
[1] LuaBoolean: true if there is a current pc, false otherwise

◆ pc_is_busy0()

int32_t quest::pc_is_busy0 ( lua_State *  L)

lua will return whether or not the current pc is busy with exchange, myshop, shopowner, safebox/mall, cube windows

LuaFunc:
pc.is_busy0()
NewStuff:
pc.is_busy0()
New LuaFunc:
pc.is_busy0()
LuaFunc:
pc.is_busy()
NewStuff:
pc.is_busy()
New LuaFunc:
pc.is_busy()
Returns
[1] LuaBoolean: true if the current pc has at least one of exchange, myshop, shopowner, safebox/mall, cube windows open, false otherwise

◆ pc_is_clear_skill_group()

int32_t quest::pc_is_clear_skill_group ( lua_State *  L)

lua will return whether or not the current player's quest flag "skill_group_clear.clear" is 1

LuaFunc:
pc.is_clear_skill_group()
Returns
[1] LuaBoolean: true if the current player's quest flag "skill_group_clear.clear" is 1, false otherwise

◆ pc_is_dead()

int32_t quest::pc_is_dead ( lua_State *  L)

lua will return whether or not the current player is dead

LuaFunc:
pc.is_dead()
Returns
[1] LuaBoolean: true if the current player is dead, false otherwise

◆ pc_is_engaged()

int32_t quest::pc_is_engaged ( lua_State *  L)

lua will return whether or not the current player is engaged

LuaFunc:
pc.is_engaged()
Returns
[1] LuaBoolean: true if engaged, false otherwise

◆ pc_is_engaged_or_married()

int32_t quest::pc_is_engaged_or_married ( lua_State *  L)

lua will return whether or not the current player is married/engaged

LuaFunc:
pc.is_engaged_or_married()
Returns
[1] LuaBoolean: true if married/engaged, false otherwise

◆ pc_is_gm()

int32_t quest::pc_is_gm ( lua_State *  L)

lua will return whether or not the current player is gm

LuaFunc:
pc.is_gm()
Returns
[1] LuaBoolean: true if gm, false otherwise

◆ pc_is_horse_alive()

int32_t quest::pc_is_horse_alive ( lua_State *  L)

lua will return whether the current player's horse is alive (health > 0)

LuaFunc:
pc.is_horse_alive()
Returns
[1] LuaBoolean: true if the current player's horse is alive, false otherwise

◆ pc_is_married()

int32_t quest::pc_is_married ( lua_State *  L)

lua will return whether or not the current player is married

LuaFunc:
pc.is_married()
Returns
[1] LuaBoolean: true if married, false otherwise

◆ pc_is_mount()

int32_t quest::pc_is_mount ( lua_State *  L)

lua will return whether or not the current player is mounting

LuaFunc:
pc.is_mount()
Returns
[1] LuaBoolean: true if the current player is mounting, false otherwise

◆ pc_is_near_vid()

int32_t quest::pc_is_near_vid ( lua_State *  L)

lua will return whether or not the player [vid] has a distance at maximum of [distance] from the current player

LuaFunc:
pc.is_near_vid(LuaNumber vid, LuaNumber distance)
Returns
[1] LuaBoolean: true if the player [vid] has a distance at maximum of [distance] from the current player, false otherwise

◆ pc_is_polymorphed()

int32_t quest::pc_is_polymorphed ( lua_State *  L)

lua will return whether or not the current player is polymorphed

LuaFunc:
pc.is_polymorphed()
Returns
[1] LuaBoolean: true if the current player is polymorphed, false otherwise

◆ pc_is_pvp0()

int32_t quest::pc_is_pvp0 ( lua_State *  L)

lua will return whether or not the current pc is pvp fighting

LuaFunc:
pc.is_pvp0()
NewStuff:
pc.is_pvp0()
New LuaFunc:
pc.is_pvp0()
LuaFunc:
pc.is_pvp()
NewStuff:
pc.is_pvp()
New LuaFunc:
pc.is_pvp()
Returns
[1] LuaBoolean: true if the current pc is pvp fighting, false otherwise

◆ pc_is_riding()

int32_t quest::pc_is_riding ( lua_State *  L)

lua will return whether or not the current player is riding (either horse or mount)

LuaFunc:
pc.is_riding()
Returns
[1] LuaBoolean: true if the current player is riding, false otherwise

◆ pc_is_skill_book_no_delay()

int32_t quest::pc_is_skill_book_no_delay ( lua_State *  L)

lua will return whether or not the current player has the affect SKILL_NO_BOOK_DELAY

LuaFunc:
pc.is_skill_book_no_delay()
Returns
[1] LuaBoolean: true if found, false otherwise

◆ pc_is_trade0()

int32_t quest::pc_is_trade0 ( lua_State *  L)

lua will return whether or not the current pc is exchanging

LuaFunc:
pc.is_trade0()
NewStuff:
pc.is_trade0()
New LuaFunc:
pc.is_trade0()
LuaFunc:
pc.is_trade()
NewStuff:
pc.is_trade()
New LuaFunc:
pc.is_trade()
Returns
[1] LuaBoolean: true if the current pc is exchanging, false otherwise

◆ pc_isguildmaster()

int32_t quest::pc_isguildmaster ( lua_State *  L)

lua will return whether or not the current player is guild master

LuaFunc:

pc.isguildmaster()

pc.is_guild_master()

Returns
[1] LuaBoolean: true if the current player is guild master, false otherwise

◆ pc_learn_grand_master_skill()

int32_t quest::pc_learn_grand_master_skill ( lua_State *  L)

it will increase the grand master skill [skill_id] of the current player if learnable

LuaFunc:
pc.learn_grand_master_skill(LuaNumber skill_id)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_make_guild0()

int32_t quest::pc_make_guild0 ( lua_State *  L)

it will make the guild [guild_name], and the current pc will be its leader

LuaFunc:
pc.make_guild0(LuaString guild_name)
NewStuff:
pc.make_guild0(LuaString guild_name)
New LuaFunc:
pc.make_guild0(LuaString guild_name)
LuaFunc:
pc.make_guild(LuaString guild_name)
NewStuff:
pc.make_guild(LuaString guild_name)
New LuaFunc:
pc.make_guild(LuaString guild_name)
Returns
[1] LuaNumber: the return value of the insource guild making function
-2 guild name is invalid (strlen <2 or >11!)
-1 guild name is invalid (special chars found!)
0 guild not created (guild name already present or already member of a guild)
1 guild created
2 player already part of a guild
3 player already guild master
Examples:
function pc.make_guild(guild_name, required_money, required_level)
--[[default values]]
if guild_name==nil then
say("Input the guild name:")
guild_name = input()
end
if required_money==nil then
required_money = 0
end
if required_level==nil then
required_level = 40
end
--[[to clean non alphanumeric characters]]
local guild_name = string.gsub(guild_name, "[^A-Za-z0-9]", "")
local guild_len_name = string.len(guild_name)
--[[to check wrong sized names]]
if not ((2 < guild_len_name) and (guild_len_name < 12)) then
say_reward("The name should not have special characters and its length should be between 3-11 characters!")
return false
end
--[[to check required level]]
if not (pc.get_level() >= required_level) then
say_reward(string.format("Level too low. Needed: %d", required_level))
return false
end
--[[to check required money]]
if not (pc.get_gold() >= required_money) then
say_reward(string.format("Not enough money. Needed: %d", required_money))
return false
end
--[[to check already guilded people]]
if (pc.hasguild() or pc.isguildmaster()) then
say_reward("You're already inside a guild.")
return false
end
--[[to add a user-validation check]]
say(string.format("Are you sure you wanna create such guild?[ENTER]%s", guild_name))
if select("Yes", "No")==2 then
return false
end
--[[create the guild and process the return value]]
local ret = pc.make_guild0(guild_name)
if ret==-2 then
say_reward("[NO] guild name is invalid (strlen <2 or >11!)")
elseif ret==-1 then
say_reward("[NO] guild name is invalid (special chars found!)")
elseif ret==0 then
say_reward("[NO] guild not created (guild name already present or already member of a guild)")
elseif ret==1 then
pc.change_gold(-required_money)
say_reward("[YES] guild created")
return true
elseif ret==2 then
say_reward("[NO] player already part of a guild")
elseif ret==3 then
say_reward("[NO] player already guild master")
end
return false
end
game.request_make_guild = pc.make_guild

◆ pc_make_item0()

int32_t quest::pc_make_item0 ( lua_State *  L)

it will make the item [vnumcount][1] by count [vnumcount][2], sockets [sockets], attrs [attrs] in the mode [mode]
if [mode] is 0, it will give it directly in the inventory;
if [mode] is 1, it will put it in the ground, beside the current player without ownership;
if [mode] is 2, it will put it in the ground, beside the current player with current player's ownership;

LuaFunc:
pc.make_item0(LuaTable vnumcount, LuaTable sockets, LuaTable attrs, LuaNumber mode)
NewStuff:
pc.make_item0(LuaTable vnumcount, LuaTable sockets, LuaTable attrs, LuaNumber mode)
New LuaFunc:
pc.make_item0(LuaTable vnumcount, LuaTable sockets, LuaTable attrs, LuaNumber mode)
Returns
[1] LuaBoolean: true if succeeded, false otherwise; nil if wrong args
Examples:
function pc.make_item_full(vnum)
--[[item count]]
local count = 1
--[[its structure must be vnum, count]]
local vnumcount = {vnum, count}
--[[its structure must be socket1,socket2,socket3]]
local sockets = {
28430, --[[Pietra della Perforaz.+4]]
28431, --[[Pietra del Colpo Mort.+4]]
28432, --[[Pietra della Ripetiz.+4]]
}
--[[its structure must be type1,value1,type2,value2,type3,value3,type4,value4,type5,value5,type6,value6,type7,value7]]
local attrs = {
attr["HP_MAX"], 1000,
attr["ATT_SPEED"], 50,
attr["MOV_SPEED"], 60,
attr["ATTBONUS_HUMAN"], 100,
attr["POISON_PCT"], 90,
attr["RESIST_MAGIC"], 80,
attr["POISON_REDUCE"], 70,
}
--[[spawn mode]]
local gstate = 0 --[[directly in the inventory]]
--[[spawn the item and return if succeeded]]
return pc.make_item0(vnumcount, sockets, attrs, gstate)
end

◆ pc_mining()

int32_t quest::pc_mining ( lua_State *  L)

it will start the mining event for the current player (available only for ore_npc.click quest events)

LuaFunc:
pc.mining()
Returns
nil

◆ pc_mount()

int32_t quest::pc_mount ( lua_State *  L)

the current player will mount [mount_vnum] (as affect MOUNT) until [duration] timestamp

LuaFunc:
pc.mount(LuaNumber mount_vnum, LuaNumber duration)
Returns
nil

◆ pc_mount_bonus()

int32_t quest::pc_mount_bonus ( lua_State *  L)

it will add the affect MOUNT_BONUS to the current player with apply bonus [apply_id] set to [value] until [duration] timestamp

LuaFunc:
pc.mount_bonus(LuaNumber apply_id, LuaNumber value, LuaNumber duration)
Returns
nil

◆ pc_ore_refine()

int32_t quest::pc_ore_refine ( lua_State *  L)

it will refine the current player's ore item (mineral) in inventory position [cell] with the percentage [pct] of success, and with the cost of [cost] yangs

LuaFunc:
pc.ore_refine(LuaNumber cost, LuaNumber pct, Lua cell)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_pointchange()

int32_t quest::pc_pointchange ( lua_State *  L)

it will temporary (until relogin) add to the current player the [point_type] with amount [amount];
if [client_refresh]=true, it will send the changed amount in the update client packet as well
if [is_around]=true, it will send the update client packet to everyone close to the current player; if false, only to the current player

LuaFunc:
pc.pointchange(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
NewStuff:
pc.pointchange(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
New LuaFunc:
pc.pointchange(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
LuaFunc:
pc.point_change(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
NewStuff:
pc.point_change(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
New LuaFunc:
pc.point_change(LuaNumber point_type, LuaNumber amount, LuaBoolean client_refresh, LuaBoolean is_around)
Returns
nil

◆ pc_polymorph()

int32_t quest::pc_polymorph ( lua_State *  L)

it will polymorph the current player into [vnum] for [duration] seconds

LuaFunc:
pc.polymorph(LuaNumber vnum, LuaNumber duration)
Returns
nil

◆ pc_pullmob()

int32_t quest::pc_pullmob ( lua_State *  L)

it will all the mobs close to the current player (such as /pull)

LuaFunc:
pc.pullmob()
NewStuff:
pc.pullmob()
New LuaFunc:
pc.pullmob()
LuaFunc:
pc.pull_mob()
NewStuff:
pc.pull_mob()
New LuaFunc:
pc.pull_mob()
Returns
nil

◆ pc_refine_equip()

int32_t quest::pc_refine_equip ( lua_State *  L)

it will refine the current player's wear item in pos [cell] if its refine level is below [level_limit] with the percent of success of [pct] to the relative item's refined vnum

LuaFunc:
pc.refine_equip(LuaNumber cell, LuaNumber level_limit, LuaNumber pct)
Returns
[1] LuaNumber: true if succeeded, false otherwise

◆ pc_remove_from_guild()

int32_t quest::pc_remove_from_guild ( lua_State *  L)

it will remove the current player from the guild

LuaFunc:
pc.remove_from_guild()
Returns
nil

◆ pc_remove_item()

int32_t quest::pc_remove_item ( lua_State *  L)

it will remove the first item found by name|vnum [item_name], and, if [count] is specified, it will remove only [count] unities instead of all

LuaFunc:

pc.removeitem(LuaNumber|LuaString item_name, [LuaNumber count])

pc.remove_item(LuaNumber|LuaString item_name, [LuaNumber count])

Returns
nil

◆ pc_remove_polymorph()

int32_t quest::pc_remove_polymorph ( lua_State *  L)

it will remove the polymorph from current player

LuaFunc:
pc.remove_polymorph(LuaNumber vnum, LuaNumber duration)
Returns
nil

◆ pc_remove_skill_book_no_delay()

int32_t quest::pc_remove_skill_book_no_delay ( lua_State *  L)

it will remove the affect SKILL_NO_BOOK_DELAY from the current player

LuaFunc:
pc.remove_skill_book_no_delay()
Returns
nil

◆ pc_reset_point()

int32_t quest::pc_reset_point ( lua_State *  L)

it will reset the current player's status points

LuaFunc:
pc.reset_point()
Returns
nil

◆ pc_reset_status()

int32_t quest::pc_reset_status ( lua_State *  L)

it will reset the specific status [type] to 1; [type]=0 vit, [type]=1 int, [type]=2 str, [type]=3 dex;

LuaFunc:
pc.reset_status(LuaNumber type)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_revive_horse()

int32_t quest::pc_revive_horse ( lua_State *  L)

it will revive the current player's horse

LuaFunc:
pc.revive_horse()
Returns
nil

◆ pc_save_exit_location()

int32_t quest::pc_save_exit_location ( lua_State *  L)

it will save the current position as exit location for the current player

LuaFunc:
pc.save_exit_location()
Returns
nil

◆ pc_select_pid()

int32_t quest::pc_select_pid ( lua_State *  L)

it will select the current player to player [pid]

LuaFunc:
pc.select_pid(LuaNumber pid)
Returns
[1] LuaNumber: the previous current player's pid, 0 otherwise

◆ pc_select_vid()

int32_t quest::pc_select_vid ( lua_State *  L)

it will select the current player to player [vid]

LuaFunc:

pc.select(LuaNumber vid)

pc.select_vid(LuaNumber vid)

Returns
[1] LuaNumber: the previous current player's vid, 0 otherwise

◆ pc_send_block_mode()

int32_t quest::pc_send_block_mode ( lua_State *  L)

it will set the current player's block mode to [mode]

LuaFunc:
pc.send_block_mode(LuaNumber mode)
Returns
nil

◆ pc_set_another_quest_flag()

int32_t quest::pc_set_another_quest_flag ( lua_State *  L)

it will set the current player's quest [questname]'s flag [flagname]'s value to [value]

LuaFunc:
pc.getf(LuaString questname, LuaString flagname, LuaNumber value)
Returns
nil

◆ pc_set_change_empire_count()

int32_t quest::pc_set_change_empire_count ( lua_State *  L)

it will increase the current player's change_empire count by one

LuaFunc:
pc.set_change_empire_count()
Returns
nil

◆ pc_set_dx()

int32_t quest::pc_set_dx ( lua_State *  L)

it will set the dex points to [value] for the current player

LuaFunc:
pc.set_dx(LuaNumber value)
Returns
nil

◆ pc_set_flag()

int32_t quest::pc_set_flag ( lua_State *  L)

it will set the current player's quest flag [questandflag]'s value (it must be as "quest.flag") to [value]

LuaFunc:
pc.setf2(LuaString questandflag, LuaNumber value)
Returns
nil

◆ pc_set_gm_level()

int32_t quest::pc_set_gm_level ( lua_State *  L)

it will reset the current player's gm level to [level] (it's safe: it's based on gmlist/gmhost)

LuaFunc:
pc.set_gm_level()
NewStuff:
pc.set_gm_level()
New LuaFunc:
pc.set_gm_level()
Returns
nil

◆ pc_set_ht()

int32_t quest::pc_set_ht ( lua_State *  L)

it will set the vit points to [value] for the current player

LuaFunc:
pc.set_ht(LuaNumber value)
Returns
nil

◆ pc_set_iq()

int32_t quest::pc_set_iq ( lua_State *  L)

it will set the int points to [value] for the current player

LuaFunc:
pc.set_iq(LuaNumber value)
Returns
nil

◆ pc_set_level()

int32_t quest::pc_set_level ( lua_State *  L)

it will set the current player's level to [level]

LuaFunc:
pc.set_level(LuaNumber level)
Returns
nil

◆ pc_set_level0()

int32_t quest::pc_set_level0 ( lua_State *  L)

it will set the current player's level to [level]; it will reset points, skills and subskills as well (such as /level)

LuaFunc:
pc.set_level0(LuaNumber level)
NewStuff:
pc.set_level0(LuaNumber level)
New LuaFunc:
pc.set_level0(LuaNumber level)
LuaFunc:
pc.set_level_ex(LuaNumber level)
NewStuff:
pc.set_level_ex(LuaNumber level)
New LuaFunc:
pc.set_level_ex(LuaNumber level)
Returns
nil

◆ pc_set_part()

int32_t quest::pc_set_part ( lua_State *  L)

it will set the current player's part [part_id] to [value]

LuaFunc:
pc.set_part(LuaNumber part_id, LuaNumber value)
Returns
nil

◆ pc_set_quest_flag()

int32_t quest::pc_set_quest_flag ( lua_State *  L)

it will set the current player's quest flag GetCurrentQuestName()".[flagname]"'s value to [value]

LuaFunc:
pc.setqf(LuaString flagname, LuaNumber value)
Returns
nil

◆ pc_set_race0()

int32_t quest::pc_set_race0 ( lua_State *  L)

it will set the current player's race to [race]; sex will be kept (lycan is only male)
0: warrior, 1: ninja, 2: sura, 3: shaman, 4: lycan

LuaFunc:
pc.set_race0(LuaNumber race)
NewStuff:
pc.set_race0(LuaNumber race)
New LuaFunc:
pc.set_race0(LuaNumber race)
LuaFunc:
pc.set_race(LuaNumber race)
NewStuff:
pc.set_race(LuaNumber race)
New LuaFunc:
pc.set_race(LuaNumber race)
Returns
[1] LuaBoolean: true if succeeded, false otherwise; nil if wrong args

◆ pc_set_skill_level()

int32_t quest::pc_set_skill_level ( lua_State *  L)

it will set the skill [vnum] to [level] for the current player

LuaFunc:
pc.set_skill_level(LuaNumber vnum, LuaNumber level)
Returns
nil

◆ pc_set_skill_point()

int32_t quest::pc_set_skill_point ( lua_State *  L)

it will set the current player's skill points to [amount]

LuaFunc:
pc.set_skill_point(LuaNumber amount)
Returns
nil

◆ pc_set_skillgroup()

int32_t quest::pc_set_skillgroup ( lua_State *  L)

it will set the current player's skill group to [skillgroup_id] (0: none, 1: first, 2: second)

LuaFunc:
pc.set_skill_group(LuaNumber skillgroup_id)
Returns
nil

◆ pc_set_st()

int32_t quest::pc_set_st ( lua_State *  L)

it will set the str points to [value] for the current player

LuaFunc:
pc.set_st(LuaNumber value)
Returns
nil

◆ pc_set_warp_location()

int32_t quest::pc_set_warp_location ( lua_State *  L)

it will set the warp location of the current player to map [map_index] in the coordinates [world_x] and [world_y]

LuaFunc:
pc.set_warp_location(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
nil

◆ pc_set_warp_location_local()

int32_t quest::pc_set_warp_location_local ( lua_State *  L)

it will set the warp location of the current player to map [map_index] in the coordinates [local_x] and [local_y]

LuaFunc:
pc.set_warp_location_local(LuaNumber map_index, LuaNumber local_x, LuaNumber local_y)
Returns
nil

◆ pc_sf_bleeding()

int32_t quest::pc_sf_bleeding ( lua_State *  L)

it will bleed the current player if [mode] is true, debleed otherwise

LuaFunc:
pc.set_flag_bleeding(LuaBoolean mode)
NewStuff:
pc.set_flag_bleeding(LuaBoolean mode)
New LuaFunc:
pc.set_flag_bleeding(LuaBoolean mode)
Returns
nil

◆ pc_sf_dead()

int32_t quest::pc_sf_dead ( lua_State *  L)

it will kill the current player

LuaFunc:
pc.set_flag_dead()
NewStuff:
pc.set_flag_dead()
New LuaFunc:
pc.set_flag_dead()
Returns
nil

◆ pc_sf_fire()

int32_t quest::pc_sf_fire ( lua_State *  L)

it will turn on fire the current player if [mode] is true, unturn the fire otherwise

LuaFunc:
pc.set_flag_fire(LuaBoolean mode)
NewStuff:
pc.set_flag_fire(LuaBoolean mode)
New LuaFunc:
pc.set_flag_fire(LuaBoolean mode)
Returns
nil

◆ pc_sf_invisible()

int32_t quest::pc_sf_invisible ( lua_State *  L)

it will turn (gm) invisible the current player if [mode] is true, unturn invisibility otherwise otherwise

LuaFunc:
pc.set_flag_invisible(LuaBoolean mode)
NewStuff:
pc.set_flag_invisible(LuaBoolean mode)
New LuaFunc:
pc.set_flag_invisible(LuaBoolean mode)
Returns
nil

◆ pc_sf_kill()

int32_t quest::pc_sf_kill ( lua_State *  L)

it will kill the player [name]

LuaFunc:
pc.set_flag_kill(LuaString name)
NewStuff:
pc.set_flag_kill(LuaString name)
New LuaFunc:
pc.set_flag_kill(LuaString name)
Returns
nil

◆ pc_sf_poison()

int32_t quest::pc_sf_poison ( lua_State *  L)

it will poison the current player if [mode] is true, depoison otherwise

LuaFunc:
pc.set_flag_poison(LuaBoolean mode)
NewStuff:
pc.set_flag_poison(LuaBoolean mode)
New LuaFunc:
pc.set_flag_poison(LuaBoolean mode)
Returns
nil

◆ pc_sf_slow()

int32_t quest::pc_sf_slow ( lua_State *  L)

it will slow the current player if [mode] is true, deslow otherwise

LuaFunc:
pc.set_flag_slow(LuaBoolean mode)
NewStuff:
pc.set_flag_slow(LuaBoolean mode)
New LuaFunc:
pc.set_flag_slow(LuaBoolean mode)
Returns
nil

◆ pc_sf_stun()

int32_t quest::pc_sf_stun ( lua_State *  L)

it will stun the current player if [mode] is true, destun otherwise

LuaFunc:
pc.set_flag_stun(LuaBoolean mode)
NewStuff:
pc.set_flag_stun(LuaBoolean mode)
New LuaFunc:
pc.set_flag_stun(LuaBoolean mode)
Returns
nil

◆ pc_teleport()

int32_t quest::pc_teleport ( lua_State *  L)

if the first arg is a number, it will warp the current player to a hardcoded town id [town_id] (only values between 0~9 are available)
if the first arg is a std::string, it will warp the current player to the player [player_name]

LuaFunc:

pc.teleport(LuaString player_name)

pc.teleport(LuaNumber town_id)

Returns
[1] LuaNumber: 1 if succeeded, 0 otherwise

◆ pc_unequip_slot0()

int32_t quest::pc_unequip_slot0 ( lua_State *  L)

it will unequip the equipped item [slot]

LuaFunc:
pc.unequip_slot0(LuaNumber slot)
NewStuff:
pc.unequip_slot0(LuaNumber slot)
New LuaFunc:
pc.unequip_slot0(LuaNumber slot)
LuaFunc:
pc.unequip_slot(LuaNumber slot)
NewStuff:
pc.unequip_slot(LuaNumber slot)
New LuaFunc:
pc.unequip_slot(LuaNumber slot)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_unmount()

int32_t quest::pc_unmount ( lua_State *  L)

it will unride the current player's horse

LuaFunc:
pc.get_horse_level()
Returns
nil

◆ pc_upgrade_polymorph_book()

int32_t quest::pc_upgrade_polymorph_book ( lua_State *  L)

it will upgrade the current item of the current player (for marble poly items, but not checked). It will increase socket1 per 50, and socket2 by one

LuaFunc:
pc.upgrade_polymorph_book()
Returns
[1] LuaNumber: true if succeeded, false otherwise

◆ pc_warp()

int32_t quest::pc_warp ( lua_State *  L)

it will warp the current player to map [map_index] in the coordinates [world_x] and [world_y]

LuaFunc:
pc.warp_local(LuaNumber map_index, LuaNumber world_x, LuaNumber world_y)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ pc_warp_exit()

int32_t quest::pc_warp_exit ( lua_State *  L)

it will warp the current player to the previous saved location (like by pc.save_exit_location)

LuaFunc:
pc.warp_exit()
Returns
nil

◆ pc_warp_local()

int32_t quest::pc_warp_local ( lua_State *  L)

it will warp the current player to map [map_index] in the coordinates [local_x] and [local_y]

LuaFunc:
pc.warp_local(LuaNumber map_index, LuaNumber local_x, LuaNumber local_y)
Returns
nil

◆ pc_warp_to_guild_war_observer_position()

int32_t quest::pc_warp_to_guild_war_observer_position ( lua_State *  L)

it will warp the current player in the guild war between [guild_id1] and [guild_id2] as observer

LuaFunc:
pc.warp_to_guild_war_observer_position(LuaNumber guild_id1, LuaNumber guild_id2)
Returns
nil

◆ pet_count_summoned()

int32_t quest::pet_count_summoned ( lua_State *  L)

lua will return the count of the current pc's summoned pets

LuaFunc:
pet.count_summoned()
Returns
[1] LuaNumber: the count of the current pc's summoned pets

◆ pet_is_summon()

int32_t quest::pet_is_summon ( lua_State *  L)

lua will return whether or not the current pc has a pet [mob_vnum] spawned

LuaFunc:
pet.is_summon(LuaNumber mob_vnum)
Returns
[1] LuaNumber: true if the current pc has a pet [mob_vnum] spawned, otherwise false

◆ pet_spawn_effect()

int32_t quest::pet_spawn_effect ( lua_State *  L)

it will append to the current pc's spawned pet [mob_vnum] the effect [effect_pathfile] (full client's path)

LuaFunc:
pet.spawn_effect(LuaNumber mob_vnum, LuaString effect_pathfile)
Returns
nil

◆ pet_summon()

int32_t quest::pet_summon ( lua_State *  L)

it will summon a pet [mob_vnum] with the name [pet_name] for the current pc
if [from_afar] is specified and true, the pet will be spawned afar, otherwise it will be close to the current pc

LuaFunc:
pet.summon(LuaNumber mob_vnum, LuaString pet_name, [LuaBoolean from_far=false])
Returns
[1] LuaNumber: the spawned pet's vid, 0 otherwise

◆ pet_unsummon()

int32_t quest::pet_unsummon ( lua_State *  L)

it will unsummon a pet [mob_vnum] from the current pc

NewStuff:
added return value (true if succeeded, false otherwise)
LuaFunc:
pet.unsummon(LuaNumber mob_vnum)
Returns
[1] LuaBoolean: true if succeeded, false otherwise

◆ quest_begin_other_pc_block()

int32_t quest::quest_begin_other_pc_block ( lua_State *  L)

it will ignore the current pc and will switch control to the player [pid]'s quests instead (usually used for each element of the party.get_member_pids() result)

LuaFunc:
q.begin_other_pc_block(LuaNumber pid)
Returns
nil
Examples:
--[[true if at least one of the party has {count}x {vnum}]]
function party.has_item(vnum, count)
if count==nil then --[[if count is not specified, set it to 1]]
count = 1
end
local pids = {party.get_member_pids()} --[[get the list of the party members' pids]]
local is_found = false
for i,v in ipairs(pids) begin --[[iter each pid]]
q.begin_other_pc_block(v) --[[switch the current pc with pid]]
if pc.countitem(vnum) >= count then --[[check if pid has vnum]]
is_found = true
end
q.end_other_pc_block() --[[switch back to the current pc]]
if is_found then --[[leave the loop]]
break
end
end
return is_found
end
--[[true if everyone in the party has {count}x {vnum}]]
function party.all_has_item(vnum, count)
if count==nil then --[[if count is not specified, set it to 1]]
count = 1
end
local pids = {party.get_member_pids()} --[[get the list of the party members' pids]]
local is_found = true
for i,v in ipairs(pids) begin --[[iter each pid]]
q.begin_other_pc_block(v) --[[switch the current pc with pid]]
if pc.countitem(vnum) < count then --[[check if pid has vnum]]
is_found = false
end
q.end_other_pc_block() --[[switch back to the current pc]]
if not is_found then --[[leave the loop]]
break
end
end
return is_found
end
syschat(party.has_item(27001, 10) and "yes" or "no")
syschat(party.all_has_item(27001, 10) and "yes" or "no")

◆ quest_coroutine_yield()

int32_t quest::quest_coroutine_yield ( lua_State *  L)

it will set the current quest to be yielded, in few words, it will be paused and other quests will be processed in meantime (hardcoded in questlib.lua: select, select_table, wait, input, confirm, select_item)

LuaFunc:
q.yield(...)
Returns
[1] LuaNumber: the result of the internal game processing of the yield contenute (it usually requires some kind of return packet from the client)
it is different from the different internal game types 'select', 'wait', 'input', 'confirm', 'select_item'

◆ quest_done()

int32_t quest::quest_done ( lua_State *  L)

it will stop the quest and clear the current quest's letter (hardcoded in questlib.lua: clear_letter)

LuaFunc:
q.done()
Returns
nil

◆ quest_end_other_pc_block()

int32_t quest::quest_end_other_pc_block ( lua_State *  L)

it will switch control to the current pc after having used q.begin_other_pc_block

LuaFunc:
q.end_other_pc_block()
Returns
nil
See also
Some examples about its usage can be found in quest_begin_other_pc_block()

◆ quest_get_current_quest_index()

int32_t quest::quest_get_current_quest_index ( lua_State *  L)

lua will return the index of the current quest

LuaFunc:
q.getcurrentquestindex()
Returns
[1] LuaNumber: the index of the current quest

◆ quest_get_current_quest_name()

int32_t quest::quest_get_current_quest_name ( lua_State *  L)

lua will return the name of the current quest

LuaFunc:
q.getcurrentquestname()
NewStuff:
q.getcurrentquestname()
New LuaFunc:
q.getcurrentquestname()
Returns
[1] LuaString: the name of the current quest

◆ quest_no_send()

int32_t quest::quest_no_send ( lua_State *  L)

it will set a global NoSend flag and all the quests of everyone won't ever send any GC_SCRIPT packet to the players' clients

LuaFunc:
q.no_send()
Returns
nil

◆ quest_set_another_title()

int32_t quest::quest_set_another_title ( lua_State *  L)

it will set the title of the quest [quest_name]'s letter to [quest_title]

LuaFunc:
q.set_title2(LuaString quest_name, LuaString quest_title)
Returns
nil

◆ quest_set_clock_name()

int32_t quest::quest_set_clock_name ( lua_State *  L)

it will set the title of the current quest's clock to clock_name

LuaFunc:
q.set_clock_name(LuaString clock_name)
Returns
nil

◆ quest_set_clock_value()

int32_t quest::quest_set_clock_value ( lua_State *  L)

it will set the value of the current quest's clock clock_value

LuaFunc:
q.set_clock_value(LuaNumber clock_value)
Returns
nil

◆ quest_set_counter_name()

int32_t quest::quest_set_counter_name ( lua_State *  L)

it will set the title of the current quest's counter to counter_name

LuaFunc:
q.set_counter_name(LuaString counter_name)
Returns
nil

◆ quest_set_counter_value()

int32_t quest::quest_set_counter_value ( lua_State *  L)

it will set the value of the current quest's counter counter_value

LuaFunc:
q.set_counter_value(LuaNumber counter_value)
Returns
nil

◆ quest_set_icon_file()

int32_t quest::quest_set_icon_file ( lua_State *  L)

it will set the icon of the current quest's letter to [icon_name] that will be sent with q.start() (hardcoded in questlib.lua: send_letter_ex)
the path starts from "D:/ymir work/ui/game/quest/questicon/"+[icon_name] and it is clearly client-side related

LuaFunc:
q.set_icon(LuaString icon_name)
Returns
nil

◆ quest_set_title()

int32_t quest::quest_set_title ( lua_State *  L)

it will set the title of the current quest's letter to [quest_title] that will be sent with q.start() (hardcoded in questlib.lua: send_letter)

LuaFunc:
q.set_title(LuaString quest_title)
Returns
nil

◆ quest_setstate()

int32_t quest::quest_setstate ( lua_State *  L)

it will set the state of the current quest to state_name

LuaFunc:

q.setstate(LuaString state_name)

q.set_state(LuaString state_name)

Returns
nil

◆ quest_start()

int32_t quest::quest_start ( lua_State *  L)

it will start the quest and send the current quest's letter (hardcoded in questlib.lua: send_letter)

LuaFunc:
q.start()
Returns
nil

◆ spawn_guard()

int32_t quest::spawn_guard ( lua_State *  L)

if the current player is a monarch, it will spawn the mob group [group_vnum] for 10~100kk empire's money
the cost is based on the [group_vnum] range: 9501~2,9511~2,9521~2=10kk; 9503~4,9513~4,9523~4=30kk; 9505~6,9515~6,9525~6=100kk;
the [region_index] is 0 north, 1 east, 2 west, 3 south

LuaFunc:
oh.spawnguard(LuaNumber group_vnum, LuaNumber region_index)
Returns
nil

◆ spawn_mob()

int32_t quest::spawn_mob ( lua_State *  L)

if the current player is a monarch, it will spawn the mob [mob_vnum]
in the commented code: if the spawned mob would have been the castle frog (vnum 11505), it will have been spawned in the relative empire castle for 100kk empire's money

LuaFunc:
oh.spawnmob(LuaNumber mob_vnum)
Returns
[1] LuaNumber: the vnum of the spawned mob, nil otherwise

◆ speedserver_get_current_exp_priv()

int32_t quest::speedserver_get_current_exp_priv ( lua_State *  L)

lua will return the exp table's information of the empire [empire]

LuaFunc:
speedserver.get_current_exp_priv(LuaNumber empire)
Returns
[1] LuaNumber: the end_hour
[2] LuaNumber: the end_minute
[3] LuaNumber: the exp_percent
[4] LuaNumber: the duration
[5] LuaBoolean: true if duration doesn't match the current day replacing internally current_hme, false otherwise
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_get_holiday()

int32_t quest::speedserver_get_holiday ( lua_State *  L)

lua will return the exp table of the specific [empire] for the date [year]/[month]/[day]

LuaFunc:
speedserver.get_holiday(LuaNumber empire, LuaNumber year, LuaNumber month, LuaNumber day)
Returns
[1] LuaTable[LuaNumber]: the exp table of the specific [empire] for the date [year]/[month]/[day], otherwise nil
each element is composted by other three: "hours", "minutes", "exp";
it indicates that it will keep giving "exp"% for further "hour":"minutes" for that specific date [year]/[month]/[day] for that specific [empire]
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_get_wday()

int32_t quest::speedserver_get_wday ( lua_State *  L)

lua will return the exp table of the specific [empire] and [wday]

LuaFunc:
speedserver.get_wday(LuaNumber empire, LuaNumber wday)
Returns
[1] LuaTable[LuaNumber]: the exp table of the specific [empire] and [wday], otherwise nil
each element is composted by other three: "hours", "minutes", "exp";
it indicates that it will keep giving "exp"% for further "hour":"minutes" for that specific [wday] for that specific [empire]
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_init_holiday()

int32_t quest::speedserver_init_holiday ( lua_State *  L)

it will initialize the exp table for the empire [empire] for the [year]/[month]/[day] date

LuaFunc:
speedserver.init_holiday(LuaNumber empire, LuaNumber year, LuaNumber month, LuaNumber day)
Returns
nil
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_init_wday()

int32_t quest::speedserver_init_wday ( lua_State *  L)

it will initialize the exp table for the empire [empire] in the [wday] day

LuaFunc:
speedserver.init_wday(LuaNumber empire, LuaNumber wday)
Returns
nil
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_set_holiday()

int32_t quest::speedserver_set_holiday ( lua_State *  L)

it will set for the empire [empire] until [year]/[month]/[day] [end_hour]:[end_minute], the [exp_percent] exp%

LuaFunc:
speedserver.set_holiday(LuaNumber empire, LuaNumber year, LuaNumber month, LuaNumber day, LuaNumber end_hour, LuaNumber end_minute, LuaNumber exp_percent)
Returns
nil
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ speedserver_set_wday()

int32_t quest::speedserver_set_wday ( lua_State *  L)

it will set for the empire [empire] in the [wday] day, the [exp_percent] exp% until [end_hour]:[end_minute]

LuaFunc:
speedserver.set_wday(LuaNumber empire, LuaNumber wday, LuaNumber end_hour, LuaNumber end_minute, LuaNumber exp_percent)
Returns
nil
SpeedServer Only:
It can be used only if SPEED_SERVER is active (game CONFIG option)

◆ takemonarchmoney()

int32_t quest::takemonarchmoney ( lua_State *  L)

if the current player is monarch, it will make the player retrieve the relative empire's money by [money]

LuaFunc:
oh.takemonarchmoney(LuaNumber money)
Returns
nil

◆ target_clear()

int32_t quest::target_clear ( lua_State *  L)

it will delete all the targets from the current pc's target list

LuaFunc:
target.clear()
Returns
nil

◆ target_delete()

int32_t quest::target_delete ( lua_State *  L)

it will delete the target [target_name] from the current pc's target list; it is common to use "__TARGET__" for the [target_name]

LuaFunc:
target.delete(LuaString target_name)
Returns
nil

◆ target_id()

int32_t quest::target_id ( lua_State *  L)

lua will return the vid of the the current pc's [target_name], or 0 if not found

LuaFunc:
target.id(LuaString target_name)
Returns
[1] LuaNumber: the vid of the the current pc's [target_name], or 0 if not found

◆ target_pos()

int32_t quest::target_pos ( lua_State *  L)

it will create a target circle in the map [map_index], coordinates [map_x] and [map_y] with the name [target_name] (only the current pc can see it);
the minimap will display the relative [target_desc] description if present, and it will be shown to the client if [send_to_client]=1 (if not present, it's still 1 by default)
to trigger the event via quest when the player reach the relative target, you can use "when [target_name].target.arrive begin"; it is common to use "__TARGET__" for the [target_name]

LuaFunc:
target.pos(LuaString target_name, LuaNumber map_x, LuaNumber map_y, LuaNumber map_index, [LuaString target_desc=""], [LuaNumber send_to_client=1])
Returns
nil

◆ target_vid()

int32_t quest::target_vid ( lua_State *  L)

it will create a target circle on the player/npc [vid]'s head with the name [target_name] (only the current pc can see it);
the minimap will display the relative [target_desc] description if present, and it will be shown to the client if [send_to_client]=1 (if not present, it's still 1 by default)
to trigger the event via quest when the player clicks on the relative target, you can use "when [target_name].target.click begin"; it is common to use "__TARGET__" for the [target_name]

LuaFunc:

target.vid(LuaString target_name, LuaNumber vid, [LuaString target_desc=""], [LuaNumber send_to_client=1])

target.npc(LuaString target_name, LuaNumber vid, [LuaString target_desc=""], [LuaNumber send_to_client=1])

target.pc(LuaString target_name, LuaNumber vid, [LuaString target_desc=""], [LuaNumber send_to_client=1])

Returns
nil