//Morphogenic Hat Script
//Allows a player to change their look to absolutely any hat available or to a defined upper limit. Check the "OnInit" label for information on this.
//
//By Slam
- script Morpho FAKE_NPC,{
OnWhisperGlobal:
.@keyword$ = @whispervar0$;
.@item_id = atoi(@whispervar1$);
if (.@item_id != 0 && (getiteminfo(.@item_id, ITEMINFO_TYPE) != IT_ARMOR || (getiteminfo(.@item_id, ITEMINFO_LOC) & EQP_HELM) == 0)) {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Item " + .@item_id + " is not a headgear!");
dispbottom(" ");
end;
}
if ((.@keyword$ == "upper" && !isequipped(.top_morpho))
|| (.@keyword$ == "middle" && !isequipped(.mid_morpho))
|| (.@keyword$ == "lower" && !isequipped(.low_morpho))) {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Sorry, you do not currently have your Morpho equipped.");
dispbottom("Please equip it and try again!");
dispbottom(" ");
end;
}
if ((.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower")
&& !callfunc("MorphoValidateLocation", .@keyword$, .@item_id)) {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Sorry, this headgear was not designed for this headgear slot.");
dispbottom(" ");
end;
}
.@view_id = getiteminfo(.@item_id, ITEMINFO_VIEWSPRITE);
if ((.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower") && .@view_id <= 0) {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Invalid headgear ID.");
dispbottom(" ");
end;
}
//for (.@i = 0; .@i < getarraysize(.morpho_disallowed); .@i++) {
// if (.@item_id == .morpho_disallowed[.@i]) {
// dispbottom("---------------[Morpho Helper]---------------");
// dispbottom(" ");
// dispbottom("Sorry, you cannot change your Morpho into this headgear.");
// dispbottom("Please try another.");
// dispbottom(" ");
// end;
// }
//}
if (.@keyword$ == "help") {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Welcome to the Morpho Settings NPC!");
dispbottom("I can help you set what your Morphohat looks like");
dispbottom(" ");
dispbottom("To use this NPC, whisper NPC:Morpho (you should");
dispbottom("know this already) with upper/middle/lower or ");
dispbottom("wing. The wing section is not yet implemented");
dispbottom("however. Now, to set your Morphohat use the ");
dispbottom("following layout:");
dispbottom(" ");
dispbottom("upper#5232 - This will make it a Pink Kitty");
dispbottom(" ");
dispbottom("Protip: Use RateMyServer.net for item IDs.");
dispbottom(" ");
end;
}
if (.@keyword$ == "info") {
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("You currently have the following items set for your Morpho hat:");
dispbottom("Upper - " + ((morpho_id_top == 0) ? "None" : getitemname(morpho_id_top)));
dispbottom("Middle - " + ((morpho_id_mid == 0) ? "None" : getitemname(morpho_id_mid)));
dispbottom("Lower - " + ((morpho_id_low == 0) ? "None" : getitemname(morpho_id_low)));
dispbottom(" ");
end;
}
if (.@keyword$ == "clear") {
morpho_id_top = 0;
morpho_id_mid = 0;
morpho_id_low = 0;
if (getequipid(EQI_HEAD_TOP) == .top_morpho)
setlook(LOOK_HEAD_TOP, 0);
if (getequipid(EQI_HEAD_MID) == .mid_morpho)
setlook(LOOK_HEAD_MID, 0);
if (getequipid(EQI_HEAD_LOW) == .low_morpho)
setlook(LOOK_HEAD_BOTTOM, 0);
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Your Morphing Hats list has been cleared.");
dispbottom(" ");
end;
}
if (.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower") {
if (.@keyword$ == "upper") {
morpho_id_top = .@item_id;
setlook(LOOK_HEAD_TOP, .@view_id);
}
if (.@keyword$ == "middle") {
morpho_id_mid = .@item_id;
setlook(LOOK_HEAD_MID, .@view_id);
}
if (.@keyword$ == "lower") {
morpho_id_low = .@item_id;
setlook(LOOK_HEAD_BOTTOM, .@view_id);
}
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Selected headgear ID: " + .@item_id);
dispbottom(" ");
end;
}
dispbottom("---------------[Morpho Helper]---------------");
dispbottom(" ");
dispbottom("Sorry, I didn't understand the option you have");
dispbottom("have given me. Please type 'help' for more info");
dispbottom(" ");
end;
OnInit:
// Change this to the upper limit of the headgears that you wish to make available
setarray(.morpho_disallowed[0], 9001, 5386, 5387, 5391, 5394, 5407, 5408, 5419, 5428, 5436,
5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446,
5447, 5448, 5449, 5459, 5481, 5486, 5487, 5488, 5492, 5493,
5494, 5495, 5508, 5516, 5517, 5520, 5532, 5533, 5534, 5535,
5540, 5541, 5542, 5543, 5544, 5551, 5552, 5553, 5560, 5561,
5562, 5571, 5575, 5576, 5577, 5578, 5583, 5584, 5587, 5595,
5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609,
5610, 5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619,
5620, 5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629,
5630, 5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639,
5640, 5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649,
5650, 5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659,
5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669,
5670, 5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679,
5680, 5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689,
5690, 5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699,
5700, 5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709,
5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719,
5720, 5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729,
5730, 5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739,
5740, 5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749,
5750, 5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759,
5760, 5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769,
5770, 5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779,
5780, 5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789,
5790, 5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799,
5809, 5812, 5814, 5824, 23134, 5070); //inb4OVERNINETHOUSAND
// Equip IDs - Change these to the ID numbers of the hat you wish to designate as the Morphing hat
.top_morpho = 25092;
.mid_morpho = 25093;
.low_morpho = 25094;
end;
}
// If you wish to make the "Morph" an Account bound variable, simply change all instances of "morpho_id_*" with "#morpho_id_"
function script MorphoEquip {
.@equipslot = getarg(0);
switch(.@equipslot) {
case 1: // Upper
if (morpho_id_top == 0)
dispbottom("No headgear set for upper. PM \"NPC:Morpho\" with the word \"help\" for more information.");
else
setlook(LOOK_HEAD_TOP, getiteminfo(morpho_id_top, ITEMINFO_VIEWSPRITE));
end;
case 2: // Mid
if (morpho_id_mid == 0)
dispbottom("No headgear set for middle. PM \"NPC:Morpho\" with the word \"help\" for more information.");
else
setlook(LOOK_HEAD_MID, getiteminfo(morpho_id_mid, ITEMINFO_VIEWSPRITE));
end;
case 3: // Lower
if (morpho_id_low == 0)
dispbottom("No headgear set for lower. PM \"NPC:Morpho\" with the word \"help\" for more information.");
else
setlook(LOOK_HEAD_BOTTOM, getiteminfo(morpho_id_low, ITEMINFO_VIEWSPRITE));
end;
}
}
// Validates if a headgear fits in the passed location.
//
// getarg(0) - The location keyword ("upper", "middle", "lower")
// getarg(1) - The item ID of the desired headgear
//
// Returns 1 on success, or 0 on failure.
function script MorphoValidateLocation {
.@keyword$ = getarg(0);
.@location = getiteminfo(getarg(1), ITEMINFO_LOC);
// Upper and Upper+Mid only. Comment out the two lines below to remove this functionality.
//if (.@keyword$ == "upper" && .@location != EQP_HEAD_TOP && .@location != (EQP_HEAD_TOP | EQP_HEAD_MID))
// return 0;
// Mid and Mid+Lower only. Comment out the two lines below to remove this functionality.
//if (.@keyword$ == "middle" && .@location != EQP_HEAD_MID && .@location != (EQP_HEAD_MID | EQP_HEAD_LOW))
// return 0;
// Lower only. Comment out the two lines below to remove this functionality.
//if (.@keyword$ == "lower" && .@location != EQP_HEAD_LOW)
// return 0;
return 1;
}