Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #6:@icjoin any none none
- if (!args)
- player:tell("Usage: @icjoin <player/npc>");
- return;
- endif
- target = $string_utils:match_actor(args[1]);
- if (target == #-2)
- player:tell(args[1], " could be a few different people. Be more specific.");
- return;
- elseif (target == #-3)
- player:tell(args[1], " isn't a player or NPC.");
- return;
- endif
- rooms = {};
- loc = target.location;
- if (is_player(target) && !(target in connected_players()))
- player:tell(target:title(), " isn't logged on, thus you can't @icjoin ", target.po, ".");
- return;
- elseif (player.location == target.location)
- player:tell("You're already in the room with ", target:title(), ".");
- return;
- elseif (!$object_utils:isa(player.location, $room))
- player:tell("Sorry, your current location doesn't support this feature.");
- return;
- elseif (target.location.ooc)
- player:tell("There's no need to @icjoin someone in an OOC area.");
- return;
- elseif (parent(target.location) == $fp_room)
- player:tell("You can't @icjoin someone in the Fantasy Game.");
- return;
- elseif (parent(player.location) == $fp_room)
- player:tell("You can't @icjoin someone from within the Fantasy Game.");
- return;
- elseif (parent(target.location) == $battleroom)
- player:tell("Moving you to ", loc.exita[2].name, ".");
- player.location:announce(player:title(), " leaves.");
- suspend(2);
- player:moveto(loc.exita[2]);
- player.location:announce(player:title(), " has arrived.");
- return;
- elseif (target.location == #2315 && $ansi_utils:delete(#2315.name) == "Battleroom 4")
- player:tell("Moving you to ", loc.exita.name, ".");
- player.location:announce(player:title(), " leaves.");
- suspend(2);
- player:moveto(loc.exita);
- player.location:announce(player:title(), " has arrived.");
- return;
- elseif (!$object_utils:has_property(target.location, "ventrances"))
- "if the commented-out if below is used instead, this should ask for vexits insead of ventrances";
- player:tell(target:title(), "'s current location doesn't support this command.");
- return;
- "elseif (target.location.vexits == {})";
- elseif (target.location.ventrances == {} && target.location.entrances == {})
- "even if you can't get out, if you can get in you should be able to @icjoin";
- player:tell(target:title(), "'s current location doesn't support this command.");
- return;
- elseif ($exit_utils:map_exit_path(player.location, target.location) == {})
- player:tell("You cannot @icjoin someone at that location since you cannot `path` to it from here.");
- return;
- endif
- if (target.location.ventrances != {})
- for a in (target.location.ventrances)
- "as before, if vexits are the way to go, change this if";
- "..If its an obvious entrance and the room isn't a barracks and the room isn't a Commander's Quarters..";
- "if you're using ventrances, a[4], if you're using vexits, a[3]";
- "if (a[5]) means 'if the exit is not hidden'";
- if (!valid(a[3]) || !valid(a[4]))
- continue;
- elseif (a[5] && isa(a[4], $vroom) && parent(a[4]) != $vbarracks && a[4].owner.home != a[4])
- rooms = setadd(rooms, a[4]);
- endif
- endfor
- endif
- if (target.location.entrances != {})
- for b in (target.location.entrances)
- "if vexits are the way to go, change entrances to exits and source to dest";
- if (b.obvious && parent(b.source) != $vbarracks && b.source.owner.home != b)
- rooms = setadd(rooms, b.source);
- endif
- endfor
- endif
- if (player.location in rooms)
- player:tell("You are already in a room connected to ", target:title(), "'s location. (", target.location.name, ")");
- return;
- elseif (rooms == {})
- player:tell(target:title(), "'s current location doesn't support this command.");
- return;
- endif
- halls = {};
- for b in (rooms)
- if (parent(b) == $battleroom || (b == #2315 && $ansi_utils:delete(#2315.name) == "Battleroom 4"))
- rooms = setremove(rooms, b);
- elseif ($object_utils:has_property(b, "vexits"))
- for c in (b.vexits)
- "..This tries to figure out if the room is a hallway..I think every hallway has these kinds of exits..";
- if (c[1] in {"port", "starboard", "(P)ort", "(S)tarboard"})
- halls = setadd(halls, b);
- endif
- endfor
- endif
- endfor
- player:tell("Moving you to a location close to ", target.location.name, ".");
- suspend(2);
- if (target.location != loc)
- player:tell(target:title(), " has moved. Please try again.");
- return;
- endif
- player.location:announce(player:title(), " leaves.");
- "..Better to deposit someone in a hallway than in the middle of a classroom..";
- if (halls != {})
- player:moveto(halls[random(length(halls))]);
- else
- player:moveto(rooms[random(length(rooms))]);
- endif
- player.location:announce(player:title(), " has arrived.");
- if ($object_utils:has_property(player.location, "vexits"))
- for zot in (player.location.vexits)
- if (zot[3] == target.location)
- player:tell(target:title(), " is located through ", zot[2][1]);
- return;
- endif
- endfor
- for toz in (player.location.exits)
- if (toz.dest == target.location)
- player:tell(target:title(), " is located through ", toz.listname);
- return;
- endif
- endfor
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement