jjohn
06-20-2003, 02:54 AM
Here's an event designed to knock the wind out of players with very high luck. *For players with luck higher than 75, a visit from the black cat means losing a third of their luck.
Here's the code (minus the glue code needed in script_events.c).
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// file: script/events/black_cat.c
void OnCreate()
{
}
// If player has a luck score greater than 75, reduce it by a third.
void Main()
{
*LogMsg("Running black_cat event for $st_my_name$.");
*string p;
*string msg;
*string name = GetNameFromID(i_my_id);
*int amount = 0;
*int c_luck = GetLuck(i_my_id);
*int luck_threshold = 75;
*msg = *"`yA fat, black cat saunters into the parlor. *";
*msg += "Did you leave the front door open?\n\n";
*if (c_luck > luck_threshold)
*{
* * c_luck /= 3;
* * amount -= c_luck;
* * ModLuck(i_my_id, amount);
* * msg += "The cat's bad luck rubs off on you!\n";
* * msg += "You lose `w$c_luck$`y luck.";
* * LogMsg("$name$ lost $c_luck$ luck from black cat");
*}
*p = AddCustom(p, "st_main", msg);
*p = AddCustom(p, "st_url", "flash\\background\\background_2.swf");
*// p = AddCustom(p, "st_url", "flash\\people\\");
main_menu:
*p = AddButtonHome(p, 1, "Ok");
*SendPacketAndWait(p);
*goto main_menu;
}
void OnKill()
{
}
[/QUOTE]
What do you think? *Is this too harsh?
Here's the code (minus the glue code needed in script_events.c).
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// file: script/events/black_cat.c
void OnCreate()
{
}
// If player has a luck score greater than 75, reduce it by a third.
void Main()
{
*LogMsg("Running black_cat event for $st_my_name$.");
*string p;
*string msg;
*string name = GetNameFromID(i_my_id);
*int amount = 0;
*int c_luck = GetLuck(i_my_id);
*int luck_threshold = 75;
*msg = *"`yA fat, black cat saunters into the parlor. *";
*msg += "Did you leave the front door open?\n\n";
*if (c_luck > luck_threshold)
*{
* * c_luck /= 3;
* * amount -= c_luck;
* * ModLuck(i_my_id, amount);
* * msg += "The cat's bad luck rubs off on you!\n";
* * msg += "You lose `w$c_luck$`y luck.";
* * LogMsg("$name$ lost $c_luck$ luck from black cat");
*}
*p = AddCustom(p, "st_main", msg);
*p = AddCustom(p, "st_url", "flash\\background\\background_2.swf");
*// p = AddCustom(p, "st_url", "flash\\people\\");
main_menu:
*p = AddButtonHome(p, 1, "Ok");
*SendPacketAndWait(p);
*goto main_menu;
}
void OnKill()
{
}
[/QUOTE]
What do you think? *Is this too harsh?