- messages an regionen versenden

Eressea:
- Besucher von Muschelplateau kriegen ein Spezialgimmick
- Diverse magische Items im Gewicht auf 0 reduziert.
This commit is contained in:
Enno Rehling 2005-12-11 11:43:18 +00:00
parent 4635c46ec2
commit 28be52c1b2
8 changed files with 115 additions and 59 deletions

View File

@ -140,6 +140,15 @@ public:
return E_OK; return E_OK;
} }
int send_region(region& r) {
if (mtype==0) return E_INVALID_MESSAGE;
if (msg==NULL) {
msg = msg_create(mtype, args);
}
add_message(&r.msgs, msg);
return E_OK;
}
protected: protected:
int get_param(const char * param) { int get_param(const char * param) {
for (int i=0;i!=mtype->nparameters;++i) { for (int i=0;i!=mtype->nparameters;++i) {
@ -177,5 +186,6 @@ bind_message(lua_State * L)
.def("set_int", &lua_message::set_int) .def("set_int", &lua_message::set_int)
.def("set_string", &lua_message::set_string) .def("set_string", &lua_message::set_string)
.def("send_faction", &lua_message::send_faction) .def("send_faction", &lua_message::send_faction)
.def("send_region", &lua_message::send_region)
]; ];
} }

View File

@ -1605,54 +1605,6 @@
<text locale="de">Saphirne Schlüssel</text> <text locale="de">Saphirne Schlüssel</text>
<text locale="en">sapphire keys</text> <text locale="en">sapphire keys</text>
</string> </string>
<string name="hornofdancing">
<text locale="de">Horn des Tanzes</text>
<text locale="en">horn of dancing</text>
</string>
<string name="hornofdancing_p">
<text locale="de">Hörner des Tanzes</text>
<text locale="en">horns of dancing</text>
</string>
<string name="instantartacademy">
<text locale="de">Miniatur einer Akademie der Künste</text>
<text locale="en">academy of arts in a box</text>
</string>
<string name="instantartacademy_p">
<text locale="de">Miniaturen einer Akademie der Künste</text>
<text locale="en">academies of arts in a box</text>
</string>
<string name="instantartsculpture">
<text locale="de">Miniatur einer Skulptur</text>
<text locale="en">art sculpture in a box</text>
</string>
<string name="instantartsculpture_p">
<text locale="de">Miniaturen einer Skulptur</text>
<text locale="en">art sculptures in a box</text>
</string>
<string name="trappedairelemental">
<text locale="de">Gefangener Windgeist</text>
<text locale="en">trapped air elemental</text>
</string>
<string name="trappedairelemental_p">
<text locale="de">Gefangene Windgeister</text>
<text locale="en">trapped air elementals</text>
</string>
<string name="aurapotion50">
<text locale="de">Auratrank</text>
<text locale="en">aura potion</text>
</string>
<string name="aurapotion50_p">
<text locale="de">Auratränke</text>
<text locale="en">aura potions</text>
</string>
<string name="bagpipeoffear">
<text locale="de">Dudelsack der Furcht</text>
<text locale="en">bagpipe of fear</text>
</string>
<string name="bagpipeoffear_p">
<text locale="de">Dudelsäcke der Furcht</text>
<text locale="en">bagpipes of fear</text>
</string>
<!--herb singular --> <!--herb singular -->
<string name="h0"> <string name="h0">

View File

@ -3,28 +3,28 @@
<resource name="instantartsculpture"> <resource name="instantartsculpture">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="1"> <item weight="0">
<function name="use" value="use_instantartsculpture"/> <function name="use" value="use_instantartsculpture"/>
</item> </item>
</resource> </resource>
<resource name="instantartacademy"> <resource name="instantartacademy">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="1"> <item weight="0">
<function name="use" value="use_instantartacademy"/> <function name="use" value="use_instantartacademy"/>
</item> </item>
</resource> </resource>
<resource name="aurapotion50"> <resource name="aurapotion50">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="1"> <item weight="0">
<function name="use" value="use_aurapotion50"/> <function name="use" value="use_aurapotion50"/>
</item> </item>
</resource> </resource>
<resource name="bagpipeoffear"> <resource name="bagpipeoffear">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="1"> <item weight="0">
<function name="use" value="use_bagpipeoffear"/> <function name="use" value="use_bagpipeoffear"/>
</item> </item>
</resource> </resource>

View File

@ -1,5 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1" ?> <?xml version="1.0" encoding="iso-8859-1" ?>
<strings> <strings>
<string name="seashell">
<text locale="de">Muschel</text>
<text locale="en">seashell</text>
</string>
<string name="seashell_p">
<text locale="de">Muscheln</text>
<text locale="en">seashells</text>
</string>
<string name="newbie_info_2"> <string name="newbie_info_2">
<text locale="de">Die ersten beiden Züge mußt du abgeben, sonst wird deine Partei sofort wieder gelöscht, um Karteileichen zu vermeiden.</text> <text locale="de">Die ersten beiden Züge mußt du abgeben, sonst wird deine Partei sofort wieder gelöscht, um Karteileichen zu vermeiden.</text>
</string> </string>
@ -82,4 +91,55 @@
</string> </string>
<!-- ending here: Wildente and Jadee's wedding --> <!-- ending here: Wildente and Jadee's wedding -->
<!-- art rewards begin -->
<string name="hornofdancing">
<text locale="de">Horn des Tanzes</text>
<text locale="en">horn of dancing</text>
</string>
<string name="hornofdancing_p">
<text locale="de">Hörner des Tanzes</text>
<text locale="en">horns of dancing</text>
</string>
<string name="instantartacademy">
<text locale="de">Miniatur einer Akademie der Künste</text>
<text locale="en">academy of arts in a box</text>
</string>
<string name="instantartacademy_p">
<text locale="de">Miniaturen einer Akademie der Künste</text>
<text locale="en">academies of arts in a box</text>
</string>
<string name="instantartsculpture">
<text locale="de">Miniatur einer Skulptur</text>
<text locale="en">art sculpture in a box</text>
</string>
<string name="instantartsculpture_p">
<text locale="de">Miniaturen einer Skulptur</text>
<text locale="en">art sculptures in a box</text>
</string>
<string name="trappedairelemental">
<text locale="de">Gefangener Windgeist</text>
<text locale="en">trapped air elemental</text>
</string>
<string name="trappedairelemental_p">
<text locale="de">Gefangene Windgeister</text>
<text locale="en">trapped air elementals</text>
</string>
<string name="aurapotion50">
<text locale="de">Auratrank</text>
<text locale="en">aura potion</text>
</string>
<string name="aurapotion50_p">
<text locale="de">Auratränke</text>
<text locale="en">aura potions</text>
</string>
<string name="bagpipeoffear">
<text locale="de">Dudelsack der Furcht</text>
<text locale="en">bagpipe of fear</text>
</string>
<string name="bagpipeoffear_p">
<text locale="de">Dudelsäcke der Furcht</text>
<text locale="en">bagpipes of fear</text>
</string>
<!-- art rewards end -->
</strings> </strings>

View File

@ -1,15 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<resources> <resources>
<!-- ambassador rewards -->
<resource name="seashell">
<item cursed="true" weight="0">
<function name="use" value="lua_useitem"/>
</item>
</resource>
<!-- art rewards --> <!-- art rewards -->
<resource name="trappedairelemental"> <resource name="trappedairelemental">
<item weight="1"> <item weight="0">
<function name="use" value="use_trappedairelemental"/> <function name="use" value="use_trappedairelemental"/>
</item> </item>
</resource> </resource>
<resource name="hornofdancing"> <resource name="hornofdancing">
<item weight="1"> <item weight="0">
<function name="use" value="use_hornofdancing"/> <function name="use" value="use_hornofdancing"/>
</item> </item>
</resource> </resource>
@ -32,7 +39,7 @@
<!-- gimmicks, etc. --> <!-- gimmicks, etc. -->
<resource name="aog"> <resource name="aog">
<!-- Amulett des Treffens --> <!-- Amulett des Treffens -->
<item notlost="yes" weight="0"/> <item notlost="yes" cursed="true" weight="0"/>
</resource> </resource>
<resource name="ao_daemon"> <resource name="ao_daemon">
@ -60,12 +67,12 @@
<resource name="questkey1" appearance="key"> <resource name="questkey1" appearance="key">
<!-- Key for an old quest. placeholder item --> <!-- Key for an old quest. placeholder item -->
<item notlost="yes" weight="1" /> <item notlost="yes" weight="0" />
</resource> </resource>
<resource name="questkey2" appearance="key"> <resource name="questkey2" appearance="key">
<!-- Key for an old quest. placeholder item --> <!-- Key for an old quest. placeholder item -->
<item notlost="yes" weight="1" /> <item notlost="yes" weight="0" />
</resource> </resource>
<resource name="jadee_ring" appearance="ring"> <resource name="jadee_ring" appearance="ring">

View File

@ -85,7 +85,7 @@
</resource> </resource>
<resource name="wand_of_tears"> <resource name="wand_of_tears">
<item notlost="yes" weight="1"> <item notlost="yes" weight="0">
<function name="use" value="use_wand_of_tears"/> <function name="use" value="use_wand_of_tears"/>
</item> </item>
</resource> </resource>

View File

@ -91,7 +91,7 @@
<resources> <resources>
<resource name="phoenixfeather"> <resource name="phoenixfeather">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="1"/> <item weight="0"/>
</resource> </resource>
</resources> </resources>

View File

@ -35,6 +35,32 @@ function run_scripts()
end end
end end
function use_seashell(u, amount)
-- Muschelplateau...
local visit = u.faction.objects["muschel"]
if visit~=nil then
local turns = get_turn() - visit
local msg = message("msg_event")
msg:set_string("string", tostring(u) .. " erzählt den Bewohnern von " .. r.name .. " von Muschelplateau, das seine Partei vor " .. turns .. " Wochen besucht hat." )
msg:send_region(u.region)
end
end
function update_special()
-- Muschelplateau
local r = get_region(165,30)
if r~=nil then
local u
for u in r.units do
if u.faction.objects["muschel"]~=nil then
if (u.faction.add_item("muschel", 1)>0) then
u.faction.objects["seashell"] = get_turn()
end
end
end
end
end
function process(orders) function process(orders)
-- initialize starting equipment for new players -- initialize starting equipment for new players
equipment_setitem("new_faction", "conquesttoken", "1"); equipment_setitem("new_faction", "conquesttoken", "1");
@ -68,6 +94,7 @@ function process(orders)
process_orders() process_orders()
-- post-turn updates: -- post-turn updates:
update_special()
update_guards() update_guards()
update_scores() update_scores()