1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032
|
Specials Functions
Index
1. Communications Functions
2. Flow Control Functions
3. Functions for All Objects
4. Functions for Item Objects
5. Functions for Individual Objects
6. Functions for Players
7. Functions for Merger Objects
8. Functions for Door Objects
9. Functions for Location Objects
10. Functions to Read and Manipulate Specials Attributes
11. Functions to Manipulate Numbers
12. Functions for Random Numbers
13. Miscellaneous Functions
1. Communications Functions
These are functions that can be used to send messages to single players
or to all players in a room or a variation
send_actor
Format: send_actor({phrase});
Desc: Used to send a message to the player who is using the special.
Example:
send_actor("The ogre takes your ", get_name("primary"), "from you!\n");
send_room
Format: send_room({phrase});
Desc: Used to send a message to all players in a particular room.
Example:
send_room("The ceiling gives way and collapses upon all in the room!\n");
send_room_except
Format: send_room_except({phrase});
Desc: Used to send a message to all players in a particular room except
the actor.
Example:
send_room(get_name("actor"), " pulls the sword from the stone!\n");
send_room_except_dual
Format: send_room_except_dual({param}, {param}, {phrase});
Desc: Used to send a message to all players in a particular room except
the two indicated by the two params. The two params must be
individuals or this will raise an error.
Example:
send_room_except_dual("actor", "primary", get_name</A>("actor"),
" knocks ", get_name("primary"), " over the head with a rock!\n");
send_obj_room
Format: send_obj_room({param}, {phrase});
Desc: Used to send a message all players in a room where a particular
object exists. If the object is contained by something, it sends
the message to the location that contains the object.
Example:
send_obj_room("this", "The ", get_name("this"),
" glows with an eerie yellow light!\n");
send_all
Format: send_all({phrase});
Desc: Used to send a message all players in the mud.
Example:
send_all("An earthquake ravages the ground beneath your feet!\n");
send_all_except
Format: send_all_except({param}, {phrase});
Desc: Used to send a message all players in the mud except the indicated
player.
Example:
send_all_except("actor",
"A soul-wrenching scream echoes throughout the land\n");
send_to
Format: send_all_except({param}, {phrase});
Desc: Sends a message to an indicated player. If it is sent to a mobile,
it just does nothing.
Example:
send_to("primary", get_name("actor"),
" tosses something at you. Your skin starts to itch!\n");
send_holder
Format: send_holder({param}, {phrase});
Desc: Sends a message to either the person holding the object indicated or
if not held, the room it is lying in.
Example:
send_holder("this", "The ", get_name("this"),
" starts to glow red-hot!\n");
tell_ind
Format: tell_ind({param}, {phrase});
Desc: Performs a tell from the first parameter individual to the second
parameter player. If the second parameter is a mobile, it just
does nothing.
Example:
tell_ind("primary", "actor",
"Could you spare a coin for a poor old man?\n");
2. Flow Control Functions
These are functions that can be used to jump around in the code.
goto
Format: goto({codemarker});
Desc: Jumps to the indicated code marker in the code stack.
Example:
goto_if_less("weak", get_strength("actor"), 15);
send_actor("You lift the warhammer with ease!\n");
goto("end");
weak:
send_actor("It is way too heavy to lift by one so weak.\n");
return_invalid_criteria();
end:
goto_if_eq
Format: goto_if_eq({codemarker}, {value1}, {value2});
Desc: Jumps to the indicated code marker in the code stack if the number
or string value1 is equal to the number or string value2
Example:
goto_if_eq("nearly", get_counter(), 1);
send_actor("You are running out of time!\n");
goto("end");
nearly:
send_actor("You have one second left!.\n");
end:
goto_if_neq
Format: goto_if_neq({codemarker}, {value1}, {value2});
Desc: Jumps to the indicated code marker in the code stack if the number
or string value1 is not equal to the number or string value2
Example:
goto_if_neq("timeleft", get_counter(), 1);
send_actor("You have one second left!\n");
goto("end");
timeleft:
send_actor("You are rapidly running out of time!.\n");
end:
goto_if_less
Format: goto_if_less({codemarker}, {value1}, {value2});
Desc: Jumps to the indicated code marker in the code stack if the number
in value1 is less than the number in value2
Example:
goto_if_less("weak", get_strength("actor"), 15);
send_actor("You lift the warhammer with ease!\n");
goto("end");
weak:
send_actor("It is way too heavy to lift by one so weak.\n");
return_invalid_criteria();
end:
return_invalid_criteria
Format: return_invalid_criteria();
Desc: Exits the special with results that cause the command running the
special to terminate. For instance, if the command get causes your
special to be run and you return_invalid_criteria, it will stop
running the get command.
Example:
goto_if_less("weak", get_strength("actor"), 15);
send_actor("You lift the warhammer with ease!\n");
goto("end");
weak:
send_actor("It is way too heavy to lift by one so weak.\n");
return_invalid_criteria();
end:
force_termination
Format: force_termination();
Desc: Exits the special with results that cause the ability to stop
executing.
Example:
goto_if_less("end", 15, get_strength("actor"));
send_actor("You strain but can't seem to pry the stone free!\n");
force_termination();
end:
force_success
Format: force_success();
Desc: Exits the special with results that cause the ability to succeed
Example:
goto_if_neq("end", 1, ind_holds("actor", "orboffire@lavacave"));
force_success();
end:
force_failure
Format: force_failure();
Desc: Exits the special with results that cause the ability to fail
Example:
goto_if_neq("end", 1, ind_holds("actor", "cursedlocket@castle"));
force_failure();
end:
3. Functions for All Objects
These are functions that manipulate values for all objects
get
Format: get({param}, {attribute});
Desc: Gets the attribute listed from the parameter given
Possible Attributes:
name - the name of the object in {name}@{area} format
title - the title of the object
strength - strength of an individual
dexterity - dexterity of an individual
intelligence - how smart an individual is
health - current health of an individual
maxhealth - The top health a player can be
constitution - The constitution of the player (tied to maxhealth)
experience - Total global experience for this individual
location - gets the current location string
Example:
send_actor(get("actor", "title"), " stoops down to pick up the amulet.\n");
set
Format: set({param}, {attribute}, {value});
Desc: Sets the attribute listed for the parameter given to the value indicated
Possible Attributes:
name - the name of the object in {name}@{area} format
title - the title of the object
strength - strength of an individual
dexterity - dexterity of an individual
intelligence - how smart an individual is
health - current health of an individual
constitution - The constitution of the player (tied to maxhealth)
experience - Total global experience for this individual
Example:
goto_if_less("end", 15, get("actor", "strength"));
send_actor(
"The gods take pity on your and raise your strength slightly.\n");
set("actor", "strength", 20);
end:
force_success
Format: destroy_this_obj();
Desc: Destroys the object that the special is attached to, breaking out
of the special
Example:
send_actor("The ", get("this", "title"),
" crumbles away in your hands!\n");
destroy_this_obj();
get_parent_name
Format: get_parent_name();
Desc: Returns the name of the parent of this clone. If not a clone,
returns nothing.
Example:
goto_if_eq("fill", get_parent_name("primary"), "brasslantern@global");
goto_if_neq("end", get_parent_name("primary"), "brasslamp@global");
fill:
send_holder("You fill the ", get_title("primary"), " with the ",
get("this", "title"), ".\n");
set_a_counter("primary", "eachsecond", 10800);
destroy_this_obj();
goto("end");
end:
is_individual
Format: is_individual({param});
Desc: Detects if the MudObject in question is an individual object.
Returns a 1 if individual, 0 if not
Example:
goto_if_eq("ind", 1, is_individual("primary"));
goto_if_eq("light", 1, is_itemflag_set("primary", "lightable"));
goto("end");
light:
set_itemflag("primary", "lit");
goto("end");
ind:
damage_individual("primary", 25);
fight_player("primary");
end:
clone_object
Format: clone_object({objname}, {this|primary|secondary|inloc|actor|none});
Desc: Creates a copy of the object and places it in the location specified
by the second parameter. Inloc refers to placing the object in
the room that the object the special is attached to resides in.
Example:
send_actor("As you grab the rod, it turns to gold in your hands!\n");
clone_object("goldrod@global", "actor");
destroy_this_obj();
add_status
Format: add_status({param}, {status_string);
Desc: Marks an object with a particular status that will stay until removed
or object reload.
Example:
goto_if_eq("remove", has_status("actor", "protection"), 1);
send_actor("You grip the shaft and feel protection surround you!\n");
add_status("actor", "protection");
goto("end");
remove:
send_actor("You grip the shaft and feel protection drain from you!\n");
remove_status("actor", "protection");
end:
move_object
Format: move_object({objname}, {param});
Desc: Moves an object from its current location to another one
Example:
goto_if_eq("notmove", has_status("actor", "enchanted"), 1);
send_actor("The orb flies into your hands from nowhere!\n");
move_object("glowingorb@global", "actor");
goto("end");
notmove:
send_actor("Nothing happens.");
end:
object_exists
Format: object_exists({param});
Desc: Checks to see if there is an object attached to a param or not
Example:
In the works
attach_special
Format: attach_special({param}, {specialname});
Desc: Attaches the special indicated by the second parameter to the
object indicated by the first parameter.
Example:
In the works
remove_special
Format: remove_special();
Desc: Removes the special that is currently running from
the object it is attached to
Example:
In the works
4. Functions for Item Objects
These are functions that manipulate values for item objects
is_itemflag_set
Format: is_itemflag_set({param}, {flagname});
Desc: Checks if the itemflag indicated by flagname is set or not.
Returns 1 for set, 0 for not.
Example:
In the works
set_itemflag
Format: set_itemflag_({param}, {flagname});
Desc: Sets the itemflag indicated in parameter two on the object
indicated in parameter one
Example:
In the works
clr_itemflag
Format: clr_itemflag_({param}, {flagname});
Desc: Clears the itemflag indicated in parameter two on the object
indicated in parameter one
Example:
In the works
5. Functions for Individual objects
These are functions that manipulate values for individual objects such
as mobiles and players
ambush_individual
Format: ambush_individual({mobilename}, {targetname});
Desc: Clones the mobile indicated in parameter one and places it in
the room with targetname, attacking targetname
Example:
In the works
damage_individual
Format: damage_individual({param}, {value});
Desc: Damages the individual indicated by parameter one the amount
indicated in parameter two. Kills them if they run out of health.
Example:
In the works
fight_player
Format: fight_player({param});
Desc: Causes the individual in parameter one to start fighting the
player running this special.
Example:
In the works
is_indflag_set
Format: is_indflag_set({param}, {flagname});
Desc: Checks to see if the individual flag is set on the object in
parameter one for the flag in parameter two. Returns 1 for set,
0 for cleared.
Example:
In the works
set_indflag
Format: set_indflag({param}, {flagname});
Desc: Sets the individual flag indicated in parameter two on the object
in parameter one.
Example:
In the works
clr_indflag
Format: clr_indflag({param}, {flagname});
Desc: Clears the individual flag indicated in parameter two on the object
in parameter one.
Example:
In the works
ind_holds
Format: ind_holds({param}, {object name|object type});
Desc: Indicates if a particular individual holds an object or certain
type of object, such as a lit object.
Example:
In the works
Possible Types:
fire - Anything that is burning
lit - Anything that is producing light, whether burning or glowing
6. Functions for Players
These are functions that manipulate values for players and perform
actions on players
trans_player
Format: trans_player({locationname});
Desc: Transports the player running this special to the location
indicated
Example:
In the works
add_ability
Format: add_ability({param}, {abilityname});
Desc: Adds an ability to the player indicated by the first parameter
Example:
In the works
remove_ability
Format: remove_ability({param}, {abilityname});
Desc: Removes an ability from the player indicated by the first parameter
Example:
In the works
has_ability
Format: has_ability({param}, {abilityname});
Desc: Determines if the player indicated in parameter one has the ability
indicated in parameter two. Returns 1 for the player has it, 0
for not
Example:
In the works
boot_off
Format: boot_off();
Desc: Kicks the player off of the game.
Example:
In the works
award_quest
Format: award_quest({questname});
Desc: Awards a quest indicated by questname to the player running the
special, or the actor.
Example:
In the works
advance_experience
Format: advance_experience({param}, {abilityname}, {success|failure},
{number});
Desc: Awards experience points to the player indicated in parameter one
to the ability listed in parameter two. The amount increased is
influenced by the difficulty, specified in parameter four. It
also is influenced by parameter three which awards higher
experience for successfully using the ability.
Example:
In the works
push_prompt
Format: push_prompt({param}, {promptname}, {promptstring});
Desc: Pushes a prompt onto the player's prompt stack. This means that
the player will see this prompt until you pop his prompt off the
stack, at which time it will revert back to the old prompt.
Promptname is what you will call it and can be any single-word
name you want. Promptstring is what the player will see as
their prompt. Don't forget to pop off the prompt or you will
annoy some players.
Example:
In the works
pop_prompt
Format: pop_prompt({param}, {promptname});
Desc: Pops a prompt off the player's prompt stack. This means that the
prompt will be destroyed and the old prompt will once again be in
place. Promptname is what you called the prompt when you pushed
it on.
Example:
In the works
start_busy
Format: start_busy({param});
Desc: Marks a player as busy until stop_busy is called. This means the
player can't perform many actions as they are busy tying a knot,
loading a bow, etc.
Example:
In the works
stop_busy
Format: stop_busy({param});
Desc: Clears a player so they are not marked as busy anymore and can
resume normal actions.
Example:
In the works
7. Functions for Merger Objects
These are functions that manipulate values for merger objects, from
food to money.
decrement_number_of
Format: decrement_number_of({param}, {number});
Desc: Decreases the number of the merger indicated by the first
parameter by the amount indicated in the second parameter.
Example:
In the works
increment_number_of
Format: increment_number_of({param}, {number});
Desc: Increases the number of the merger indicated by the first
parameter by the amount indicated in the second parameter.
Example:
In the works
get_number_of
Format: get_number_of({param});
Desc: Gets the number of the merger indicated by the first parameter.
Example:
In the works
8. Functions for Door Objects
These are functions that manipulate values for door objects.
get_door_state
Format: get_door_state({param});
Desc: Gets the door state as a string, either open, closed, locked, or
mlocked.
Example:
In the works
set_door_state
Format: set_door_state({param}, {open|closed|locked|mlocked});
Desc: Sets the door state as a string, either open, closed, locked, or
mlocked. Only with open can players traverse the door.
Example:
In the works
9. Functions for Location Objects
These are functions that manipulate values for location objects.
get_loc_by_dir
Format: get_loc_by_dir({currentlocname@area}, {the_direction});
Desc: Gets the location from the location in parameter one to the
direction in parameter two.
Example:
In the works
display_loc
Format: display_loc({param}, {locname@area});
Desc: Displays the location in parameter two to the player in parameter
one.
Example:
In the works
10. Functions to Read and Manipulate Specials Attributes
These are functions that manipulate specials and their attributes.
decrement_counter
Format: decrement_counter();
Desc: Decreases the counter value by one. The counter is a value that
remains attached to that special on that object even after the
special is done executing.
Example:
In the works
increment_counter
Format: increment_counter();
Desc: Increases the counter value by one. The counter is a value that
remains attached to that special on that object even after the
special is done executing.
Example:
In the works
get_counter
Format: get_counter({param}, {specialname|this});
Desc: Gets the counter value from the special indicated in
parameter two attached to the object in parameter one. If "this"
is passed as parameter two, it uses the special that is running
the code for the counter.
Example:
In the works
set_counter
Format: get_counter({param}, {specialname|this}, {value});
Desc: Gets the counter value from the special indicated in
parameter two attached to the object in parameter one. If "this"
is passed as parameter two, it uses the special that is running
the code for the counter. It sets the counter to the number in
parameter three.
Example:
In the works
set_param
Format: set_param({primary|secondary|this}, {name@area});
Desc: Replaces the default setting of the passed in parameters (this,
primary, secondary) indicated in parameter one with the object
in parameter two.
Example:
In the works
get_store_int
Format: get_store_int();
Desc: Returns the storage integer which can be used to pass numbers out
of this special execution for future executions. Much like the
counter variable.
Example:
In the works
set_store_int
Format: set_store_int({value});
Desc: Sets the storage integer which can be used to pass numbers out of
this special execution for future executions. Much like the
counter variable.
Example:
In the works
get_target_str
Format: get_target_str({value});
Desc: Gets whatever is in the target string slot. Usually this is the
player's input.
Example:
In the works
11. Functions to Manipulate Numbers
These are functions that manipulate numbers and often return results
increment_number
Format: increment_number({value}, {offset});
Desc: Adds the value in offset to the value in the first parameter and
returns the result.
Example:
In the works
decrement_number
Format: decrement_number({value}, {offset});
Desc: Subtracts the value in offset to the value in the first parameter
and returns the result.
Example:
In the works
12. Functions for Random Numbers
These are functions that get and use random numbers
get_random
Format: get_random({maxnumber});
Desc: Gets a random number between 0 and the maxnumber passed in.
Returns the results.
Example:
In the works
select_rand_param
Format: select_rand_param({param}, {param}, {param}, ...);
Desc: Selects from an unlimited number of parameters one at random
and returns it.
Example:
In the works
13. Miscellaneous Functions
is_string_eq
Format: is_string_eq({string}, {string}, {string}, ...);
Desc: Is the first string equal to any of the unlimited number of
following strings passed in. Returns 1 for equal, 0 for not
equal.
Example:
In the works
test_for_success
Format: test_for_success({abilityname}, {difficulty});
Desc: Given an ability and the difficulty of the maneuver, returns a
value between 0 and 100 on the measure of success the player had
in performing the ability.
Example:
In the works
exit_tutorial
Format: exit_tutorial();
Desc: Exits a tutorial and places the player back into the tutorial
chain, asking if they would like to use the next tutorial. Only
works if the player is marked as being in a tutorial. This
function will cause the special to exit.
Example:
send_actor("The tutorial will be listed here soon!\n");
exit_tutorial();
|