'; $slave = $_GET['npc']; $slaveName = getInfo(username,users,"WHERE id='$slave'"); $master = getInfo(NPC,users,"WHERE id='$slave'"); $leader = getInfo(leader,npcs,"WHERE name='$slave'"); if (($master == $userId) || (admin($user_name)) || ($leader == $userId)) { if ($_POST['mode'] == "name") { $name = $_POST['name']; if (!$name) $failure = "You did not enter a name."; if (getInfo(id,users,"WHERE username='$name'")) $failure = "Another character already has this name."; if (!$failure) { $query = "UPDATE users SET username='$name' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE npcs SET named='$name' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully chosen a name for your animal.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "block") { $door = $_POST['destination']; if ($door != "out") { $doorplace = getInfo(place,rooms,"WHERE id='$door'"); $doorname = getInfo(name,rooms,"WHERE id='$door'").', '.getInfo(name,places,"WHERE id='$doorplace'"); } else { $doorname = "outside"; } $place_type = getInfo(type,places,"WHERE id='$buildingId'"); if (($doorname == "outside") && ((getInfo(label,buildings,"WHERE id='$place_type'") == "ship") || (getInfo(label,buildings,"WHERE id='$place_type'") == "caravan"))) $failure = "You may not block the door to the outside of a ship or a caravan."; $room = getInfo(room,users,"WHERE id='$slave'"); if (!inArray($door,destinations($room))) $failure = "This door cannot be blocked from where your NPC is currently."; if (getInfo(id,doors,"WHERE block='$userId' or block2='$userId'")) $failure = "Your NPC is already blocking a door."; $door = getInfo(id,doors,"WHERE (room='$room' and room2='$door') or (room='$door' and room2='$room')"); if (!$door) $failure = "You must create a passage between this room and the other in order to be able to block it."; if (getInfo(room,doors,"WHERE id='$door'") == $room) { if (getInfo(block,doors,"WHERE id='$door'")) $failure = "This door is already blocked."; } else { if (getInfo(block2,doors,"WHERE id='$door'")) $failure = "This door is already blocked."; } if (!$failure) { if (getInfo(room,doors,"WHERE id='$door'") == $room) { $query = "UPDATE doors SET block='$slave' WHERE id='$door'"; } else { $query = "UPDATE doors SET block2='$slave' WHERE id='$door'"; } mysql_query($query); $query = "UPDATE npcs SET movement='' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully set your NPC to block this door. If you wish, you may set up a response that will allow the NPC to escort a user through this door when asked a particular question.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "unblock") { $query = "UPDATE doors SET block='' WHERE block='$slave'"; mysql_query($query); $query = "UPDATE doors SET block2='' wHERE block2='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
Your NPC is no longer blocking a door.
'; echo '
'; echo '
'; } if ((admin($user_name)) || ($user_name == "God")) { if ($_POST['mode'] == "citizen") { $cost = $_POST['cost']; $resistance = $_POST['resistance']; $job = $_POST['job']; $home = $_POST['home']; if (!$home) $failure = "Please select a home."; if (!$failure) { if (!getInfo(id,npc_citizens,"WHERE npc='$slave'")) { $query = "INSERT INTO npc_citizens VALUES('','$slave','$cost','$home','$resistance','$job','','','','','','','')"; mysql_query($query); $money = getInfo(money,users,"WHERE id='$slave'"); $money += rand(0,100); $query = "UPDATE users SET money='$money' WHERE id='$slave'"; mysql_query($query); } else { $query = "UPDATE npc_citizens SET cost='$cost' WHERE npc='$slave'"; mysql_query($query); $query = "UPDATE npc_citizens SET resistance='$resistance' WHERE npc='$slave'"; mysql_query($query); $query = "UPDATE npc_citizens SET job='$job' WHERE npc='$slave'"; mysql_query($query); $query = "UPDATE npc_citizens SET home='$home' WHERE npc='$slave'"; mysql_query($query); } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have updated that NPC\'s citizen information.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } } if ($_POST['mode'] == "muzzle") { if (!getInfo(muzzled,npcs,"WHERE name='$slave'")) { $query = "UPDATE npcs SET muzzled='muzzled' WHERE name='$slave'"; mysql_query($query); $success = "You have successfully muzzled and chained your animal. It cannot attack anything."; } else { $query = "UPDATE npcs SET muzzled='' WHERE name='$slave'"; mysql_query($query); $success = "You have set your animal free. It can, and will attack anything who is not in its NPC group and is not its master or leader."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'; echo $success; echo '
'; echo '
'; echo '
'; } if ($_POST['mode'] == "eat") { if (!getInfo(eat,npcs,"WHERE name='$slave'")) { $query = "UPDATE npcs SET eat='no' WHERE name='$slave'"; mysql_query($query); $success = "Your NPC will no longer eat the food in its inventory."; } else { $query = "UPDATE npcs SET eat='' WHERE name='$slave'"; mysql_query($query); $success = "Your NPC will now automatically eat any food put into its inventory."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'; echo $success; echo '
'; echo '
'; echo '
'; } if ($_POST['mode'] == "hidehair") { $hair = getInfo(hair,users,"WHERE id='$slave'"); if (!$hair) { $hair = getInfo(hairhide,users,"WHERE id='$slave'"); $hide_hair = true; } else { $hide_hair = false; } if (!$hair) $failure = "You do not have any hair."; if (!$failure) { if ($hide_hair) { $query = "UPDATE users SET hair='$hair' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET hairhide='' WHERE id='$slave'"; mysql_query($query); } else { $query = "UPDATE users SET hair='' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET hairhide='$hair' WHERE id='$slave'"; mysql_query($query); } } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'; if (!$failure) echo 'Success'; else echo 'Error'; echo '
'; echo '
'; echo '
'; if (!$failure) { if ($hide_hair) echo "The NPC's hair is now being displayed."; else echo "The NPC's hair is now hidden."; } else echo $failure; echo '
'; echo '
'; echo '
'; } if ($_POST['mode'] == "remove") { $remOverhead = $_POST['remOverhead']; $remClothes = $_POST['remClothes']; $remBehind = $_POST['remBehind']; $conditions = "WHERE id='$slave'"; $inventory = getInfo(inventory,users,$conditions); $max = count($remOverhead); if ($max > 0) { $overhead = explode('.',getInfo(overhead,users,"WHERE id='$slave'")); for ($i = 0;$i < $max;$i++) { $rem = $remOverhead[$i]; if (inArray($rem,$overhead)) { $overhead = implode('.',$overhead); $overhead = removeElement($rem,$overhead,"."); $overhead = explode('.',$overhead); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; } else { $failure = "The NPC is not wearing one or more of the items you are trying to remove."; } } } $max = count($remBehind); if ($max > 0) { $behind = explode('.',getInfo(behind,users,"WHERE id='$slave'")); for ($i = 0;$i < $max;$i++) { $rem = $remBehind[$i]; if (inArray($rem,$behind)) { $behind = implode('.',$behind); $behind = removeElement($rem,$behind,"."); $behind = explode('.',$behind); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; } else { $failure = "The NPC is not wearing one or more of the items you are trying to remove."; } } } $max = count($remClothes); if ($max > 0) { $clothes = explode('.',getInfo(clothes,users,"WHERE id='$slave'")); for ($i = 0;$i < $max;$i++) { $rem = $remClothes[$i]; if (inArray($rem,$clothes)) { $clothes = implode('.',$clothes); $clothes = removeElement($rem,$clothes,"."); $clothes = explode('.',$clothes); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; } else { $failure = "The NPC is not wearing one or more of the items you are trying to remove."; } } } if (!$failure) { if ($remOverhead) { $overhead = implode('.',$overhead); $query = "UPDATE users SET overhead='$overhead' WHERE id='$slave'"; mysql_query($query); } if ($remClothes) { $clothes = implode('.',$clothes); $query = "UPDATE users SET clothes='$clothes' WHERE id='$slave'"; mysql_query($query); } if ($remBehind) { $behind = implode('.',$behind); $query = "UPDATE users SET behind='$behind' WHERE id='$slave'"; mysql_query($query); } $query = "UPDATE users SET inventory='$inventory' WHERE id='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully removed the clothes you have chosen.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "description") { $description = nl2br($_POST['description']); $query = "UPDATE users SET description='$description' WHERE id='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have updated the NPC\'s description.
'; echo '
'; echo '
'; } if (($_POST['mode'] == "movetown") && ((admin($user_name)) || ($user_name == "God"))) { $town = $_POST['destination']; if (!$town) $message = "You have not selected a destination."; $place = getInfo(townsqr,towns,"WHERE id='$town'"); $room = getInfo(id,rooms,"WHERE place='$place'"); if (!$message) { if (isFighting($slave)) $failure = true; if (!$failure) { $query = "UPDATE users SET town='$town' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET location='$place' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET room='$room' WHERE id='$slave'"; mysql_query($query); $message = "You have moved your NPC."; } } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($_POST['mode'] == "move") { $destination = $_POST['destination']; if (getInfo(id,greetings,"WHERE npc='$slave'")) $failure = "You may not move that NPC, as it is set to greet others."; $destinationPlace = getInfo(place,rooms,"WHERE id='$destination'"); $destinationTown = getInfo(town,places,"WHERE id='$destinationPlace'"); $currentRoom = getInfo(room,users,"WHERE id='$slave'"); if (!inArray($destination,destinations($currentRoom))) $failure = "Your NPC cannot directly access that place at the moment."; print_r(destinations($currentRoom)); if (weigh($slave) > maxWeight($slave)) $failure = "Your NPC is carrying too much."; if (!$destination) $message = "You have not selected a destination."; $location = getInfo(location,users,"WHERE id='$slave'"); $place = getInfo(place,rooms,"WHERE id='$destination'"); $buildingId = getInfo(location,users,"WHERE id='$slave'"); $locked = getInfo(locked,places,"WHERE id='$place'"); if (getInfo(status,users,"WHERE id='$slave'") != "conscious") $message = "The NPC is not fully conscious."; if (($location != $place) && ($locked)) $message = "That place is locked."; if (isFighting($slave)) $message = "That NPC is fighting."; if ($destination == "travel") { if (getInfo(id,travel_routes,"WHERE station='$buildingId'")) { $station = getInfo(station2,travel_routes,"WHERE station='$buildingId'"); $toll = getInfo(toll,travel_routes,"WHERE station='$buildingId'"); } if (getInfo(id,travel_routes,"WHERE station2='$buildingId'")) { $station = getInfo(station,travel_routes,"WHERE station2='$buildingId'"); $toll = getInfo(toll2,travel_routes,"WHERE station2='$buildingId'"); } $money = getInfo(money,users,"WHERE id='$userId'"); $money -= $toll; if ($money < 0) $failure = "You do not have enough money."; if (!$station) $failure = "This station does not lead to anything."; } if ($failure) $message = $failure; if (!$message) { move($slave,$destination); $message = "You have moved your NPC."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($_POST['mode'] == "applyjob") { $job = $_POST['place']; $owner = getInfo(owner,places,"WHERE id='$job'"); if (!$job) $message = "You have not selected a place at which to apply."; if (!$owner) $message = "That place is not owned by anyone - you may not apply for a job there."; if (!$message) { $query = "UPDATE users SET job='$job' WHERE id='$slave'"; mysql_query($query); sendMessage($owner,"Job Application",$slave." is applying for a job at ".getInfo(name,places,"WHERE id='$job'"),"God"); if (getInfo(job,places,"WHERE id='$slave'")) $message = "You have applied for a job somewhere else - that application will be scrapped, and replaced with this new one."; else $message = "Your NPC has applied for a job."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($_POST['mode'] == "hire") { $place = $_POST['place']; if (!$place) $message = "You have not selected a building."; $employees = explode('.',getInfo(employees,places,"WHERE id='$place'")); $owner = getInfo(owner,places,"WHERE id='$place'"); if ($owner != $userId) $message = "You do not own that building."; if (inArray($slave,$employees)) $message = "The NPC is already an employee here."; if (!$message) { $employees = getInfo(employees,places,"WHERE id='$place'"); if ($employees) $employees .= '.'.$slave; else $employees = $slave; $query = "UPDATE places SET employees='$employees' WHERE id='$place'"; mysql_query($query); $message = "You have hired your NPC."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($_POST['mode'] == "travel") { $destination = $_POST['destination']; if (!getInfo(animal,npcs,"WHERE name='$slave'")) { $user = $_POST['user']; $username = $user; $oldUser = $user; $item = $_POST['item']; } if ((!$user) && (!$destination)) $message = "You must select either a user or a town."; $user = getInfo(id,users,"WHERE username='$user'"); if ((!$user) && ($oldUser)) $message = "That user does not exist."; if (!$message) { $time = time(); $query = "INSERT INTO npc_travel VALUES('','$slave','','$destination','','$user','$item','$time')"; mysql_query($query); $message = "The NPC is now travelling."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($_POST['mode'] == "sleep") { if (getInfo(regeneration,users,"WHERE id='$slave'") > time()) $failure = "This NPC has been knocked out in a fight, and may not wake up yet. It will wake up automatically."; if (!$failure) { if (getInfo(status,users,"WHERE id='$slave'") == "unconscious") { $health = getInfo(health,users,"WHERE id='$slave'"); $sleep = getInfo("sleep",users,"WHERE id='$slave'"); $query = "UPDATE users SET status='conscious' WHERE id='$slave'"; mysql_query($query); $sleeptime = time() - $sleep; $heal = round($sleeptime / 3600); $health += $heal * 15; $maxstat = getInfo(type,npcs,"WHERE name='$slave'"); if ($health > $maxstat) $health = $maxstat; $message = "Your NPC is now awake."; } elseif (getInfo(status,users,"WHERE id='$slave'") == "conscious") { $time = time(); $query = "UPDATE users SET sleep='$time' WHERE id='$slave'"; mysql_query($query); $message = "Your NPC is now asleep."; $query = "UPDATE users SET status='unconscious' WHERE id='$slave'"; mysql_query($query); } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "fightsettings") { $fight = $_POST['fight']; $query = "UPDATE npcs SET counter='$fight' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; if ($fight == "fight") echo '
The NPC is now set to fight back when attacked.
'; if ($fight == "") echo '
The NPC is now set to stand its ground when attacked.
'; if ($fight == "run") echo '
The NPC is now set run away when attacked..
'; echo '
'; echo '
'; } if ($_POST['mode'] == "firesettings") { $fire = $_POST['fire']; $query = "UPDATE npcs SET fire='$fire' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; if ($fire == "nothing") echo '
The NPC is now set to do nothing upon sight of a fire.
'; if ($fire == "") echo '
The NPC is now set to extinguish any fires it sees.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "protectsettings") { $protect = $_POST['protect']; if ($protect == "defend") $message = "This NPC will now take a blow for another NPC in its group, and let that NPC attack."; if ($protect == "attack") $message = "This NPC will now let the victim counter, and attack the attacker itself."; if ($protect == "full") $message = "This NPC will now attack and defend for the victim."; $query = "UPDATE npcs SET protect='$protect', counter='fight' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'; echo $message; echo '
'; echo '
'; echo '
'; } if ($_POST['mode'] == "movesettings") { $move = $_POST['move']; if ($move == "stand") { $query = "UPDATE npcs SET movement='' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The NPC is now set to stay in one place.
'; echo '
'; echo '
'; } if (($move == "wander") && (!getInfo(id,greetings,"WHERE npc='$slave'"))) { $query = "UPDATE npcs SET movement='wander' WHERE name='$slave'"; mysql_query($query); $time = time(); $query = "DELETE FROM npc_wander WHERE npc='$slave'"; mysql_query($query); $query = "INSERT INTO npc_wander VALUES('','$slave','$time')"; mysql_query($query); $query = "UPDATE npcs SET mode='wander' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The NPC is now set to wander around aimlessly.
'; echo '
'; echo '
'; } if ($move == "follow") { $user = $_POST['user']; $username = getInfo(username,users,"WHERE id='$user'"); if (!$user) $message = "That user does not exist."; else $message = "The NPC is now set to follow $username."; if ($user) { $query = "UPDATE npcs SET movement='follow' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET var='$user' WHERE name='$slave'"; mysql_query($query); } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "transform") { $transformation = getInfo(transformation,users,"WHERE id='$slave'"); $transformed = getInfo(transformed,users,"WHERE id='$slave'"); if (!$transformation) $failure = "The NPC does not have a transformed state."; if (!$failure) { if ($transformed) { $query = "UPDATE users SET transformed='' WHERE id='$slave'"; mysql_query($query); $success = "The NPC has reverted to your humanoid form."; } else { $query = "UPDATE users SET transformed='$transformation' WHERE id='$slave'"; mysql_query($query); $success = "The NPC has transformed."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$success.'
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "leader") { $leader = $_POST['leader']; $leadername = $leader; $leader = getInfo(id,users,"WHERE username='$leader'"); if ($master == $userId) { $query = "UPDATE npcs SET leader='$leader' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The control has been given to '.$leadername.'
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
You do not own this NPC.
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "jobsettings") { $job = $_POST['job']; if ($job == "idle") { $query = "DELETE FROM npc_siege WHERE npc='$slave'"; mysql_query($query); $query = "DELETE FROM npc_arrow WHERE npc='$slave'"; mysql_query($query); $query = "DELETE FROM npc_mining WHERE npc='$slave'"; mysql_query($query); $query = "UPDATE npcs SET mode='' WHERE name='$slave'"; mysql_query($query); $message = "The NPC is now set to idle."; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($job == "siege") { $weapon = $_POST['weapon']; $ammo = $_POST['ammo'.$weapon]; $target = $_POST['siegeTarget']; $weaponType = getInfo(type,arsenals,"WHERE id='$weapon'"); $types = getInfo(attack,weapons,"WHERE id='$weaponType'"); $targetType = getInfo(type,places,"WHERE id='$target'"); if (($types) && ($target)) { $types = explode('.',$types); if (!inArray($targetType,$types)) $message = "This weapon cannot be used against that kind of building."; } if (!$weapon) $message = "You must select a siege weapon."; if ((!$ammo) && (!getInfo(damage,weapons,"WHERE id='$weaponType'"))) $message = "You must select a type of ammunition."; $alreadyNPC = getInfo(npc,npc_siege,"WHERE weapon='$weapon'"); if ((getInfo(npc,npc_siege,"WHERE weapon='$weapon'") != $slave) && (getInfo(npc,npc_siege,"WHERE weapon='$weapon'")) && (getInfo(mode,npcs,"WHERE name='$alreadyNPC'") == "siege")) $message = "There is already an NPC set to that siege weapon."; if ((getInfo(weapon,npc_siege,"WHERE npc='$slave'") != $weapon) && (getInfo(weapon,npc_siege,"WHERE npc='$slave'")) && (getInfo(mode,npcs,"WHERE name='$slave'") == "siege")) $message = "This NPC is already set to another siege weapon."; $place = getInfo(location,users,"WHERE id='$slave'"); $employees = getInfo(employees,places,"WHERE id='$place'"); $employees = explode('.',$employees); if (!inArray($slave,$employees)) $message = "$slave must be an employee/crew member to work the siege weaponry."; if (!$message) { $time = time(); $query = "DELETE FROM npc_siege WHERE npc='$slave'"; mysql_query($query); $query = "UPDATE npcs SET mode='siege' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET var='' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET movement='' WHERE name='$slave'"; mysql_query($query); $query = "INSERT INTO npc_siege VALUES('','$slave','$weapon','$ammo','$target','$time')"; mysql_query($query); $message = "The NPC is now set to control a siege weapon."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($job == "forrage") { $query = "UPDATE npcs SET mode='forrage' wHERE name='$slave'"; mysql_query($query); $message = "Your NPC is now set to pick up anything they find lying around on the ground."; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($job == "mine") { $query = "DELETE FROM npc_mining WHERE npc='$slave'"; mysql_query($query); $time = time(); $room = getInfo(room,users,"WHERE id='$slave'"); $query = "INSERT INTO npc_mining VALUES('','$slave','$time','$room')"; mysql_query($query); $query = "UPDATE npcs SET mode='mine' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET movement='' WHERE npc='$slave'"; mysql_query($query); $message = "Your NPC is now set to mine resources."; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } if ($job == "sell") { $query = "UPDATE npcs SET mode='sell' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET var='' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET movement='' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The NPC is now set to automatically work the counter for a restaurant or shop.
'; echo '
'; echo '
'; } if ($job == "protect") { $user = $_POST['user']; $username = getInfo(username,users,"WHERE id='$user'"); if ($user == "all:room") $username = "all NPCs (stop any fights), while staying in the same room."; if ($user == "all:place") $username = "all NPCs (stop any fights), while staying in the same building and wandering from room to room."; if ($user == "all") $username = "all NPCs (stop any fights), while wandering around town."; if (!$user) $message = "You have not selected a user."; if (isFighting($user)) $message = "That user is currently fighting - you may only set your NPC to protect a user who is not being attacked at the time."; if (!$message) { $query = "UPDATE npcs SET mode='protect' WHERE name='$slave'"; mysql_query($query); $query = "UPDATE npcs SET var='$user' WHERE name='$slave'"; mysql_query($query); if (($user == "all:place") || ($user == "all")) { $query = "UPDATE npcs SET movement='wander' WHERE name='$slave'"; mysql_query($query); $time = time() + (3600 * 18); $query = "INSERT INTO npc_wander VALUES('','$slave','$time')"; mysql_query($query); } elseif ($user != "all:room") { $query = "UPDATE npcs SET movement='follow' WHERE name='$slave'"; mysql_query($query); } $message = "The NPC is set to protect $username."; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$message.'
'; echo '
'; echo '
'; } } $take = $_POST['take']; if ($take) { if ((getInfo(town,users,"WHERE id='$slave'") != getInfo(town,users,"WHERE id='$userId'")) && (!admin($user_name))) $failure = "You must be in the same town as your NPC to be able to take anything from their inventory. $slave : $userId"; $slaveInventory = explode('.',getInfo(inventory,users,"WHERE id='$slave'")); $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $max = count($take); for ($i = 0;$i < $max;$i++) { $item = $take[$i]; if (inArray($item,$slaveInventory)) { $slaveInventory = implode('.',$slaveInventory); $slaveInventory = removeElement($item,$slaveInventory,'.'); $slaveInventory = explode('.',$slaveInventory); if ($inventory) $inventory .= '.'.$item; else $inventory = $item; } else { $failure = $slave." isn't carrying one of the items you are trying to take."; } } if (!$failure) { $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); $slaveInventory = implode('.',$slaveInventory); $query = "UPDATE users SET inventory='$slaveInventory' WHERE id='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully taken the items.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } elseif ($_POST['mode'] == "wear") { $wearOverhead = $_POST['overhead']; $wearUnderhead = $_POST['underhead']; $wearBehind = $_POST['behind']; $conditions = "WHERE id='$slave'"; $overhead = getInfo(overhead,users,$conditions); $underhead = getInfo(clothes,users,$conditions); $behind = getInfo(behind,users,$conditions); $inventory = explode('.',getInfo(inventory,users,$conditions)); $max = count($wearBehind); for ($i = 0;$i < $max;$i++) { $item = $wearBehind[$i]; if (inArray($item,$inventory)) { $inventory = implode('.',$inventory); $inventory = removeElement($item,$inventory,'.'); $inventory = explode('.',$inventory); if ($behind) $behind .= '.'.$item; else $behind = $item; } else { $failure = "The NPC is not carrying one of the items you are trying to wear."; } } $max = count($wearOverhead); for ($i = 0;$i < $max;$i++) { $item = $wearOverhead[$i]; if (inArray($item,$inventory)) { $inventory = implode('.',$inventory); $inventory = removeElement($item,$inventory,'.'); $inventory = explode('.',$inventory); if ($overhead) $overhead .= '.'.$item; else $overhead = $item; } else { $failure = "The NPC is not carrying one of the items you are trying to wear."; } } $max = count($wearUnderhead); for ($i = 0;$i < $max;$i++) { $item = $wearUnderhead[$i]; if (inArray($item,$inventory)) { $inventory = implode('.',$inventory); $inventory = removeElement($item,$inventory,'.'); $inventory = explode('.',$inventory); if ($underhead) $underhead .= '.'.$item; else $underhead = $item; } else { $failure = "The NPC is not carrying one of the items you are trying to wear."; } } if (!$failure) { $inventory = implode('.',$inventory); $query = "UPDATE users SET inventory='$inventory' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET overhead='$overhead' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET clothes='$underhead' WHERE id='$slave'"; mysql_query($query); $query = "UPDATE users SET behind='$behind' WHERE id='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The NPC has successfully worn the clothes you have chosen.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "stoptravel") { $query = "DELETE FROM npc_travel WHERE npc='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
Your NPC has stopped travelling.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "money") { $money = getInfo(money,users,"WHERE id='$userId'"); $slaveMoney = getInfo(money,users,"WHERE id='$slave'"); if ($_POST['action'] == "Give") { $transfer = $_POST['money']; $money -= $transfer; if ($money >= 0) { $slaveMoney += $transfer; $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); $query = "UPDATE users SET money='$slaveMoney' WHERE id='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully transfered '.$transfer.' gold to your npc\'s account.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
You do not have enough money.
'; echo '
'; echo '
'; } } if ($_POST['action'] == "Take") { $transfer = $_POST['money']; $slaveMoney -= $transfer; if ($slaveMoney >= 0) { $money += $transfer; $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); $query = "UPDATE users SET money='$slaveMoney' WHERE id='$slave'"; mysql_query($query); $topic = "Money"; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully taken '.$transfer.' gold from your npc\'s account.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
Your npc does not have enough money.
'; echo '
'; echo '
'; } } } if ($_POST['mode'] == "addGroup") { $group = $_POST['group']; if (getInfo(creator,npc_groups,"WHERE id='$group'") != $userId) $failure = "You must be the creator of the group to add NPCs to it."; if (!$failure) { $query = "UPDATE npcs SET npcgroup='$group' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
This NPC is now part of a group.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "remGroup") { $query = "UPDATE npcs SET npcgroup='' WHERE name='$slave'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
This NPC is no longer part of a group.
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Control Panel
'; echo '
'; echo '
This is where you may control your '.$slaveName.'\'s belongings. You may remove your npc\'s clothing, and/or take anything from its inventory.
'; echo '
'; echo '
'; if (getInfo(regeneration,users,"WHERE id='$slave'") <= time()) { echo '

'; } if (getInfo(animal,npcs,"WHERE name='$slave'")) { echo '

'; } echo '

'; echo '
'; if ((admin($user_name)) || ($user_name == "God")) { $citizen = getInfo(id,npc_citizens,"WHERE npc='$slave'"); $job = getInfo(job,npc_citizens,"WHERE npc='$slave'"); $cost = getInfo(cost,npc_citizens,"WHERE npc='$slave'"); $home = getInfo(home,npc_citizens,"WHERE npc='$slave'"); $resistance = getInfo(resistance,npc_citizens,"WHERE npc='$slave'"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Citizen
'; echo '
'; echo '
'; echo '
'; echo "Occupation:
"; echo "Cost:
"; echo "Willpower (resistance to being bribed):
"; echo "Home:
"; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Edit Questions
'; echo '
'; echo '
'; echo "In order to make your NPC more interesting, you can set up pre-set statements other users can say to it. You can also set up pre-written responses.

"; echo "
"; echo ""; echo "
"; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Description
'; echo '
'; echo '
'; $name = stripslashes(getInfo(name,places,"WHERE id='$place_id'")); $description = br2n(stripslashes(getInfo(description,users,"WHERE id='$slave'"))); echo '

'; echo '
'; echo '
'; echo '
'; echo '
'; if ((getInfo(animal,npcs,"WHERE name='$slave'")) && (!getInfo(named,npcs,"WHERE name='$slave'"))) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Command of NPC
'; echo '
'; echo '
'; echo '
'; echo 'If you wish, you can name this animal. Be careful, because you can only name it once.

'; echo ' '; echo '
'; echo '
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Current Settings
'; echo '
'; echo '
'; $conditions = "WHERE id='$slave'"; $roomId = getInfo(room,users,$conditions); $room = getInfo(name,rooms,"WHERE id='$roomId'"); $placeId = getInfo(location,users,$conditions); $place = getInfo(name,places,"WHERE id='$placeId'"); $townId = getInfo(town,users,$conditions); $town = getInfo(name,towns,"WHERE id='$townId'"); $max = numRows(posts); $userLocation = getInfo(location,users,"WHERE id='$slave'"); if (getInfo(id,fires,"WHERE room='$roomId'")) $font = " color=#f97400"; if (getInfo(id,fires,"WHERE place='$placeId'")) $placefont = " color=#f97400"; if (isFighting($userId) == "defense") $font = " color=#FF0000"; if (getInfo(user,travels,"WHERE user='$slave'")) { $left = getInfo(arrival,travels,"WHERE user='$slave'") - time(); if ($left > 0) { $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); echo $slaveName.' is currently travelling. '.$slaveName.' will arrive in '.$hours.' hours, '.$minutes.' minutes and '.$seconds.' seconds.'; } else echo $slaveName.' is currently travelling. '.$slaveName.' will arrive in less than a minute\'s time.'; } elseif (getInfo(destination,place_travels,"WHERE place='$userLocation'")) { $path = getInfo(path,place_travels,"WHERE place='$place'"); $path = explode('.',$path); $time = count($path) * (20 * 60); $time += getInfo(time,place_travels,"WHERE place='$place'"); $left = $time - time(); if ($left > 0) { $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); if ($place) echo ' '.$place.''; if ($place && $room) echo ' > '; if ($room) echo ''.$room.'. Travelling (by ship/caravan). Arrival in '.$hours.' hours, '.$minutes.' minutes and '.$seconds.' seconds.'; } else { if ($place) echo ' '.$place.''; if ($place && $room) echo ' > '; if ($room) echo ''.$room.'. Travelling (by ship/caravan). '.$slaveName.' will arrive in less than a minute\'s time.'; } } else { echo 'Currently In : '; if ($town) echo ''.$town.''; if ($town && $place) echo ' > '; if ($place) echo ''.$place.''; if ($place && $room) echo ' > '; if ($room) echo ''.$room.''; } echo "
"; $sex = getInfo(sex,users,"WHERE id='$slave'"); if ($sex == "m") $gender = "Male"; if ($sex == "f") $gender = "Female"; $status = getInfo(status,users,"WHERE id='$slave'"); $status = capitalize($status); $job = getInfo(mode,npcs,"WHERE name='$slave'"); $health = getInfo(health,users,"WHERE id='$slave'"); $type = getInfo(type,npcs,"WHERE name='$slave'"); $movement = getInfo(movement,npcs,"WHERE name='$slave'"); $var = getInfo('var',npcs,"WHERE name='$slave'"); if ($movement == "wander") $move = "Wander aimlessly"; if ($movement == "follow") $move = "Follow ".getInfo(username,users,"WHERE id='$var'"); if ($movement == "") $move = "Stay in the same room"; if (getInfo(npc,npc_travel,"WHERE npc='$slave'")) $move = "Travelling"; $attacked = getInfo(counter,npcs,"WHERE name='$slave'"); if ($attacked == "") $attack = "Stand ground"; if ($attacked == "run") $attack = "Run away"; if ($attacked == "fight") $attack = "Fight back"; $fire = getInfo(fire,npcs,"WHERE name='$slave'"); if ($fire == "nothing") $fire = "Do nothing"; else $fire = "Extinguish"; echo "Gender : $gender
"; echo "Status : $status
"; echo "Health : $health/$type
"; echo "Movement : $move
"; echo "If Attacked : $attack
"; echo "Reaction to fire : $fire
"; echo "Current Job : "; if ($job == "siege") { $target = getInfo(target,npc_siege,"WHERE npc='$slave'"); $weapon = getInfo(weapon,npc_siege,"WHERE npc='$slave'"); $weaponType = getInfo(type,arsenals,"WHERE id='$weapon'"); $weaponType = getInfo(name,weapons,"WHERE id='$weaponType'"); $ammo = getInfo(ammo,npc_siege,"WHERE npc='$slave'"); $ammoType = getInfo(type,ammo,"WHERE id='$ammo'"); $ammoType = getInfo(name,ammunition,"WHERE id='$ammoType'"); $targetName = getInfo(name,places,"WHERE id='$target'"); if ($target) echo "Fire $weaponType [$weapon] ($ammoType) at $targetName
"; else echo "Man $weaponType [$weapon] ($ammoType) and return fire if attacked
"; } if ($job == "protect") { $protect = getInfo('var',npcs,"WHERE name='$slave'"); $protect = getInfo(username,users,"WHERE id='$protect'"); echo "Protect $protect
"; } if ($job == "sell") { echo "Automatically tend to the selling of items, if the npc is an employee in its current location
"; } if ($job == "mine") { echo "Automatically mine the crude resources in the room."; } if ($job == "forrage") { echo "Pick up one item from the room every hour."; } if ($job == "") { echo "This NPC is not set to do anything"; } echo '
'; echo '
'; echo '
'; if ($master == $userId) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Command of NPC
'; echo '
'; echo '
'; echo '
'; echo 'If you wish, you can give command of the NPC to another user, without having to give up complete ownership. This allows the user to control all aspects of the NPC including job, movement, reactions and inventory.

'; $leadername = getInfo(username,users,"WHERE id='$leader'"); echo ' '; echo '
'; echo '
'; echo '
'; echo '
'; } if ((admin($user_name)) || ($user_name == "God")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Move Town
'; echo '
'; echo '
'; echo '
'; echo 'Move :
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Move NPC
'; echo '
'; echo '
'; echo '
'; echo 'Move :
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Block Door
'; echo '
'; echo '
'; echo '
'; if (!getInfo(id,doors,"WHERE block='$slave' or block2='$slave'")) { echo 'Door :
'; echo '
'; } else { echo '
'; } echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Apply for Job
'; echo '
'; echo '
'; echo '
'; echo 'Place :
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Grouping
'; echo '
'; echo '
'; echo 'In order to organize your NPCs more easily, you may group NPCs together. This allows you to assign them all the same task by setting the controls once, instead of for each individual NPC. Some controls, however, are not available through the group panel and must be assigned individually. An NPC can only belong to one group at a time.'; echo '
Current Group : '; $group = getInfo(npcgroup,npcs,"WHERE name='$slave'"); if (!$group) echo "$slaveName is not part of a group."; else echo getInfo(name,npc_groups,"WHERE id='$group'"); echo '

'; echo '
'; echo 'Switch to : '; echo ' '; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Hire NPC
'; echo '
'; echo '
'; echo '
'; echo 'Hire in :
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Steer Ship/Caravan
'; echo '
'; echo '
'; echo '
'; echo 'Ship/Caravan :
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Settings
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if (getInfo(type,npcs,"WHERE name='$slave'") > 10) { echo ''; echo ''; } echo ''; echo '
'; echo '
'; echo '
'; echo 'Movement :

'; $room = getInfo(room,users,"WHERE id='$slave'"); $place = getInfo(place,rooms,"WHERE id='$room'"); $town = getInfo(town,places,"WHERE id='$place'"); echo '
'; echo 'User : '; echo '
'; echo ''; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; if (getInfo(animal,npcs,"WHERE name='$slave'")) { echo 'Job :

'; } else { if (getInfo(type,npcs,"WHERE name='$slave'") > 10) { echo 'Job :

'; } else { echo 'Job :

'; } } if (getInfo(type,npcs,"WHERE name='$slave'") > 10) { if (!getInfo(animal,npcs,"WHERE name='$slave'")) { echo '
Siege Weapon :
'; $max = count($weapons); for ($i = 0;$i < $max;$i++) { $weapon_id = $weapons[$i]; $weapon = getInfo(name,arsenals,"WHERE id='$weapon_id'"); $weaponType = getInfo(type,arsenals,"WHERE id='$weapon_id'"); echo '
'; if (getInfo(damage,weapons,"WHERE id='$weaponType'")) { echo "This weapon does not require any ammunition."; } else { echo 'Ammunition :
'; } echo '
'; echo ''; } echo 'Target :
'; echo '
'; echo ''; echo '
'; echo 'User :
'; echo '
'; } } echo ''; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo 'When Attacked :

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo 'Reaction to fire :

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo 'Protect Group :

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Travelling
'; echo '
'; echo '
'; echo '
'; if (!getInfo(npc,npc_travel,"WHERE npc='$slave'")) { echo 'Fill out as much of the form below as you need; do note that not every field is mandatory for certain tasks. For example, if you only want your NPC to go to a particular town, you need only select a "destination". Similarly, if you don\'t want your NPC to deliver something, you need not select an item. Also, you do not even need to state a destination, if you wish the NPC to follow a particular user - the NPC will simply hop from town to town, trying to get to the same town as that user. Do remember, however, that an NPC cannot deliver a crate.

'; echo 'Destination : '; if (!getInfo(animal,npcs,"WHERE name='$slave'")) { echo ' User : Deliver Item : '; } echo '

'; echo ''; } else { echo ""; $destination = getInfo(destination,npc_travel,"WHERE npc='$slave'"); $town = getInfo(name,towns,"WHERE id='$destination'"); $user = getInfo(user,npc_travel,"WHERE npc='$slave'"); $username = getInfo(username,users,"WHERE id='$user'"); $item = getInfo(item,npc_travel,"WHERE npc='$slave'"); $itemName = getInfo(name,user_items,"WHERE id='$item'"); if ($user) { if ($item) echo "The NPC is delivering $itemName to $username."; else echo "The NPC is travelling to wherever $username is."; } else echo "The NPC is travelling to $town."; echo "

"; } echo ''; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Money
'; echo '
'; echo '
'; echo '
'; $money = getInfo(money,users,"WHERE id='$slave'"); echo 'Your npc is currently carrying '.$money.' gold. You can choose to either give or take a money to or from your npc.

'; echo ' '; echo '
'; echo '
'; echo '
'; echo '
'; echo getInfo(transformation,users,"WHERE id='$slave'"); if ((getInfo(transformation,users,"WHERE id='$slave'")) && (!getInfo(animal,npcs,"WHERE name='$slave'"))) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Transformation
'; echo '
'; echo '
'; echo 'The NPC has a transformed state. If you wish, you may toggle between the transformation and the humanoid state.

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Avatar
'; echo '
'; echo '
'; $user_id = getInfo(id,users,"WHERE id='$slave'"); echo '
'; echo ''; echo '
'; $conditions = "WHERE id='$slave'"; $overhead = explode('.',getInfo(overhead,users,$conditions)); $clothes = explode('.',getInfo(clothes,users,$conditions)); $behind = explode('.',getInfo(behind,users,$conditions)); $hair = getInfo(hair,users,"WHERE id='$slave'"); if (!$hair) { $hair_hidden = true; $hair = getInfo(hairhide,users,"WHERE id='$slave'"); } else { $hair_hidden = false; } $hair_image = getInfo(image,hair,"WHERE id='$hair'"); $hair_sex = getInfo(sex,hair,"WHERE id='$hair'"); $hair_sex = getInfo(sex,bases,"WHERE id='$hair_sex'"); echo '
Hair
'; echo ''; echo ''; echo '

'; echo '
'; echo '

'; echo '
'; echo '
Over-Hair Clothing/Accessories
'; $max = count($overhead); for ($i = 0;$i < $max;$i++) { $item = $overhead[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $record = getInfo(item,user_items,$conditions); $image = displayClothing($record); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '

'; echo '
'; echo '
Under-Hair Clothing/Accessories
'; $max = count($clothes); for ($i = 0;$i < $max;$i++) { $item = $clothes[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $record = getInfo(item,user_items,$conditions); $image = displayClothing($record); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '
'; echo '
'; echo '
Behind Avatar Clothing/Accessories
'; $max = count($behind); for ($i = 0;$i < $max;$i++) { $item = $behind[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $record = getInfo(item,user_items,$conditions); $image = displayClothing($record); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Inventory
'; echo '
'; echo '
'; unset($clothes); $conditions = "WHERE id='$slave'"; $inventory = explode('.',getInfo(inventory,users,$conditions)); $max = count($inventory); for ($i = 0;$i < $max;$i++) { $item = $inventory[$i]; $conditions = "WHERE id='$item'"; $type = getInfo(type,user_items,$conditions); if (($type == "food") || ($type == "drink") || ($type == "alcohol") || (($type == "poison"))) $foods[] = $item; if (($type == "clothing") || ($type == "armour") || ($type == "weapon")) $clothes[] = $item; if (($type == "other") || ($type == "misc") || ($type == "seal")) $other[] = $item; if ($type == "crate") $crates[] = $item; if ($type == "resource") $resources[] = $item; if ($type == "material") $materials[] = $item; if ($type == "key") $keys[] = $item; if ($type == "door") $doors[] = $item; if ($type == "relic") $relics[] = $item; } echo '
Clothing/Accessories
'; $max = count($clothes); for ($i = 0;$i < $max;$i++) { $item = $clothes[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $record = getInfo(item,user_items,$conditions); $image = displayClothing($record); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Wear Over-Hair
'; echo '
Wear Under-Hair
'; echo '
Wear Behind Avatar
'; echo '
Take
'; echo '

'; echo '
'; echo '
Food
'; $max = count($foods); for ($i = 0;$i < $max;$i++) { $item = $foods[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $type = getInfo(type,user_items,$conditions); $stat = getInfo("stat",user_items,$conditions); if ($type == "food") { $stats = '+'.$stat.' health'; $type = "Food"; } if ($type == "drink") { $stats = '+'.$stat.' mana'; $type = "Drink"; } if ($type == "alcohol") { $stats = '+'.$stat.' health
+'.$stat.' intoxication'; $type = "Alcohol"; } if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'.$type.'
'.$stats; echo '
Take
'; echo '

'; echo '
'; echo '
Miscellaneous Items
'; $max = count($other); for ($i = 0;$i < $max;$i++) { $item = $other[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
Crates
'; $max = count($crates); for ($i = 0;$i < $max;$i++) { $item = $crates[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
Crude Resources
'; $max = count($resources); for ($i = 0;$i < $max;$i++) { $item = $resources[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
Materials
'; $max = count($materials); for ($i = 0;$i < $max;$i++) { $item = $materials[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
Keys
'; $max = count($keys); for ($i = 0;$i < $max;$i++) { $item = $keys[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
Doors
'; $max = count($doors); for ($i = 0;$i < $max;$i++) { $item = $doors[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
Bodyparts
'; $max = count($relics); for ($i = 0;$i < $max;$i++) { $item = $relics[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'
'; echo '
Take
'; echo '

'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
You must be '.$slave.'\'s owner to view this.
'; echo '
'; echo '
'; } echo ''; include "index-bottom.php" ?>