diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 21:24:55 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 21:24:55 +0200 |
commit | ef4175cdfae6a6981738e15cb0009d8e47ed7c80 (patch) | |
tree | 5237140b62274b63b9a98ef65aec92df804eb1f6 /example/scripts/npcs/debugger.lua | |
parent | 0f1449567d5a2ccab9ff6fdc9975150299482834 (diff) | |
download | manaserv-ef4175cdfae6a6981738e15cb0009d8e47ed7c80.tar.gz manaserv-ef4175cdfae6a6981738e15cb0009d8e47ed7c80.tar.bz2 manaserv-ef4175cdfae6a6981738e15cb0009d8e47ed7c80.tar.xz manaserv-ef4175cdfae6a6981738e15cb0009d8e47ed7c80.zip |
Moved functions to entity members where appropriate
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
Diffstat (limited to 'example/scripts/npcs/debugger.lua')
-rw-r--r-- | example/scripts/npcs/debugger.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/example/scripts/npcs/debugger.lua b/example/scripts/npcs/debugger.lua index 669964ee..390f8f29 100644 --- a/example/scripts/npcs/debugger.lua +++ b/example/scripts/npcs/debugger.lua @@ -13,7 +13,7 @@ function npc1_talk(npc, ch) on_remove(ch, function() print "Player has left the map." end); say("Hello! I am the testing NPC.") - local rights = chr_get_rights(ch); + local rights = ch:rights(); if (rights >= 128) then say("Oh mighty server administrator, how can I avoid your wrath?") @@ -38,14 +38,14 @@ function npc1_talk(npc, ch) say("Sorry, this is a heroic-fantasy game, I do not have any gun.") elseif v == 2 then - local n1, n2 = chr_inv_count(ch, 524, 511) + local n1, n2 = ch:inv_count(524, 511) if n1 == 0 or n2 ~= 0 then say("Yeah right...") else say("I can't help you with the party. But I see you have a fancy hat. I could change it into Santa's hat. Not much of a party, but it would get you going.") v = ask("Please do.", "No way! Fancy hats are classier.") if v == 1 then - chr_inv_change(ch, 524, -1, 511, 1) + ch:inv_change(524, -1, 511, 1) end end @@ -62,17 +62,17 @@ function npc1_talk(npc, ch) end elseif v == 4 then - being_say(npc, "As you wish...") - schedule_in(2, function() being_say(npc, "One") end) - schedule_in(4, function() being_say(npc, "Two") end) - schedule_in(6, function() being_say(npc, "Three") end) - schedule_in(8, function() being_say(npc, "Four") end) - schedule_in(10, function() being_say(npc, "Five") end) - schedule_in(12, function() being_say(npc, "Six") end) - schedule_in(14, function() being_say(npc, "Seven") end) - schedule_in(16, function() being_say(npc, "Eight") end) - schedule_in(18, function() being_say(npc, "Nine") end) - schedule_in(20, function() being_say(npc, "Ten") end) + npc:say("As you wish...") + schedule_in(2, function() npc:say("One") end) + schedule_in(4, function() npc:say("Two") end) + schedule_in(6, function() npc:say("Three") end) + schedule_in(8, function() npc:say("Four") end) + schedule_in(10, function() npc:say("Five") end) + schedule_in(12, function() npc:say("Six") end) + schedule_in(14, function() npc:say("Seven") end) + schedule_in(16, function() npc:say("Eight") end) + schedule_in(18, function() npc:say("Nine") end) + schedule_in(20, function() npc:say("Ten") end) elseif v == 5 then function printTable (t) |