Initial commit
Update char.cpp
This commit is contained in:
7
how-to/LocaleSrv-Quest/example/receive_item_test.quest
Normal file
7
how-to/LocaleSrv-Quest/example/receive_item_test.quest
Normal file
@ -0,0 +1,7 @@
|
||||
quest receive_item_test begin
|
||||
state start begin
|
||||
when 70001.receive begin
|
||||
syschat(string.format("(TEST) -> Count Item: %d", pc.count_item(70001)))
|
||||
end
|
||||
end
|
||||
end
|
||||
24
how-to/LocaleSrv-Quest/example/swap_item_example.quest
Normal file
24
how-to/LocaleSrv-Quest/example/swap_item_example.quest
Normal file
@ -0,0 +1,24 @@
|
||||
quest swap_item begin
|
||||
state start begin
|
||||
when 70001.receive begin
|
||||
|
||||
local item_to_change = 70001
|
||||
local count_needed = 10
|
||||
|
||||
local reward_vnum = 19
|
||||
local reward_count = 1
|
||||
|
||||
while(pc.count_item(item_to_change) >= count_needed) do
|
||||
if not pc.enough_inventory(reward_vnum) then
|
||||
syschat("You don't have enough space to receive the item, free up space.")
|
||||
syschat("After freeing up space, you will have to receive it again.")
|
||||
break
|
||||
end
|
||||
pc.remove_item(item_to_change, count_needed)
|
||||
pc.give_item2(reward_vnum, reward_count)
|
||||
syschat(string.format("Congratulations! You have collected %s x %d! In return you will receive: %s x %d", item.get_name(item_to_change), count_needed, item.get_name(reward_vnum), reward_count ))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user