summaryrefslogtreecommitdiffstats
path: root/example/scripts/npcs
Commit message (Collapse)AuthorAgeFilesLines
* Made member function tables available as a globalsThorbjørn Lindeijer2013-05-032-9/+9
| | | | | | | | | | | | This way the scripts can add or replace existing member functions, which can be useful. As demonstration chr_money and chr_money_change are now added as Entity.money and Entity.change_money. Also fixed the banker to use ask_number instead of ask_integer (I had decided to rename this and apparently forgot the banker). Mantis-issue: 503 Reviewed-by: Ablu
* Moved functions to entity members where appropriateThorbjørn Lindeijer2013-04-157-40/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions were skipped for now because they may need a new name or change of behavior. Changes: chr_warp entity:warp chr_get_inventory entity:inventory chr_inv_change entity:inv_change chr_inv_count entity:inv_count chr_get_equipment entity:equipment chr_equip_slot entity:equip_slot chr_equip_item entity:equip_item chr_unequip_slot entity:unequip_slot chr_unequip_item entity:unequip_item chr_get_level entity:level chr_get_exp entity:xp chr_give_exp entity:give_xp chr_get_rights entity:rights chr_set_hair_style entity:set_hair_style chr_get_hair_style entity:hair_style chr_set_hair_color entity:set_hair_color chr_get_hair_color entity:hair_color chr_get_kill_count entity:kill_count chr_give_special entity:give_special chr_has_special entity:has_special chr_take_special entity:take_special chr_set_special_recharge_speed entity:set_special_recharge_speed chr_get_special_recharge_speed entity:special_recharge_speed chr_set_special_mana entity:set_special_mana chr_get_special_mana entity:special_mana chr_kick entity:kick exp_for_level xp_for_level monster_get_id entity:monster_id monster_change_anger entity:change_anger monster_drop_anger entity:drop_anger monster_get_angerlist entity:angerlist being_apply_status entity:apply_status being_remove_status entity:remove_status being_has_status entity:has_status being_set_status_time entity:set_status_time being_get_status_time entity:status_time being_get_gender entity:gender being_set_gender entity:set_gender being_type entity:type being_walk entity:walk being_say entity:say being_damage entity:damage being_heal entity:heal being_get_name entity:name being_get_action entity:action being_set_action entity:set_action being_get_direction entity:direction being_set_direction entity:set_direction being_apply_attribute_modifier entity:apply_attribute_modifier being_remove_attribute_modifier entity:remove_attribute_modifier being_set_base_attribute entity:set_base_attribute being_get_modified_attribute entity:modified_attribute being_get_base_attribute entity:base_attribute being_set_walkmask entity:set_walkmask being_get_walkmask entity:walkmask being_get_mapid entity:mapid chat_message entity:message being_register entity:register chr_shake_screen entity:shake_screen chr_create_text_particle entity:show_text_particle - entity:position posX entity:x posY entity:y monster_get_name monsterclass:name item_get_name itemclass:name
* Simplified some script function namesThorbjørn Lindeijer2013-04-147-64/+62
| | | | | | | | npc_message -> say npc_choice -> ask npc_ask_integer -> ask_number npc_ask_string -> ask_string npc_trade -> trade
* Removed NPC and character parameters from NPC functionsThorbjørn Lindeijer2013-04-147-66/+63
| | | | | | | | These functions can only be used in the context of a character talking to an NPC, so these parameters can be deduced from that context rather than passing them explicitly all the time. Simplifies NPC scripting.
* Converted two Lua scripts from DOS to UNIX line endingsThorbjørn Lindeijer2012-03-111-44/+44
|
* Register Lua script API functions into the global namespaceThorbjørn Lindeijer2012-03-118-107/+107
| | | | | | | | Scripts mostly execute the Mana script API, and it seems like just unnecessary verbosity to refer to the 'mana' table all the time. This table no longer exists now. Reviewed-by: Erik Schilling
* Removed deprecated NPC helper functionsThorbjørn Lindeijer2012-03-117-59/+59
| | | | Reviewed-by: Erik Schilling
* Moved the managing of NPC script coroutines into C++Thorbjørn Lindeijer2012-03-101-2/+0
| | | | | | | | | | | | Rather than wrapping NPC functions up in coroutines in the Lua side, they are now managed on the C++ side as "script threads", which are essentially the same thing. The main purpose is that the server can now know whether any of these long running script interactions are still active, which will probably be useful when adding the ability to reload scripts. Reviewed-by: Erik Schilling
* A bunch of cleanups to example Lua scriptsThorbjørn Lindeijer2012-03-022-22/+12
| | | | | | | Mostly removed bulky copyright headers and fixed indentation and line length. Reviewed-by: Yohann Ferreira Reviewed-by: Erik Schilling
* Merged the example client and server dataThorbjørn Lindeijer2012-02-258-0/+576
It's easier to just talk about world data and to modify it as a whole. If there is really a need to separate it, a project can still choose to do that (and in whatever suitable way). There is no need to enforce this separation or to do it in our example. Reviewed-by: Erik Schilling