FUNCTION int Q4MJ(obj user) { int Q5NC = 0x00; int Q4NC; loc Q4VS = loc( getLocation(user) ); loc there = loc( Q5I9(user) ); if(!isInMap(there)) { Q4RD(user); systemMessage(user, "There is no room to summon that here."); } else { faceHere(user, getDirectionInternal(Q4VS, there)); if(hasObjVar(this, "magicItemModifier")) { int Q52W = getObjVar(this, "magicItemModifier"); Q4NC = 0x06 * Q52W; } else { if(getSkillLevel(user, 0x19) < 0x0A) { Q4NC = 0x14; } else { Q4NC = 0x14 * getSkillLevel(user, 0x19) / 0x05; } } obj Q4PE = createGlobalNPCAt(0x0259, there, 0x00); if(Q4PE != NULL()) { doLocAnimation(there, 0x3728, 0x0A, 0x0A, 0x00, 0x00); sfx(there, 0x0217, 0x00); setType(Q4PE, 0x0F); animateMobile(Q4PE, 0x0C, 0x0F, 0x01, 0x00, 0x00); attachScript(Q4PE, "destcrea"); setObjVar(Q4PE, "summonDifficulty", 0x02EE); int Q5ND = Q558(Q4PE, user, 0x64, 0x01); callback(Q4PE, Q4NC, 0x08); Q5NC = 0x01; } else { bark(user, "Whoops...something got in the way."); } } Q5UQ(this); return(Q5NC); }
FUNCTION int Q4IT(obj user, obj usedon, int Q4ID, int Q5NM) { int Q5NC = 0x00; if(Q50G(usedon)) { int Q4NC; loc Q4VS = loc( getLocation(user) ); loc there = loc( getLocation(usedon) ); int Q5VZ; faceHere(user, getDirectionInternal(Q4VS, there)); if(hasObjVar(this, "magicItemModifier")) { int Q52W = getObjVar(this, "magicItemModifier"); Q4NC = 0x06 * Q52W; Q5VZ = Q52W; } else { Q4NC = 0x06 * getSkillLevel(user, 0x19) / 0x05; Q5VZ = (getSkillLevel(user, 0x19) / 0x0A) + 0x01; } int Q5A7 = 0x373A; int Q5AN = 0x01EA; if(!Q4ID) { Q5A7 = 0x374A; Q5AN = 0x01E1; Q5VZ = 0x00 - Q5VZ; } sfx(there, 0x01EA, 0x00); doMobAnimation(usedon, Q5A7, 0x0A, 0x0F, 0x00, 0x00); for(int s = 0x00; s < 0x03; s ++) { if(Q41Q(usedon, s, Q5VZ, Q4NC)) { Q5NC = 0x01; } } if(!Q4ID) { Q422(user, usedon, 0x00, Q5NM); Q5UK(user, usedon, 0x02, Q5NM); Q41C(user, usedon, Q5NM); receiveUnhealthyActionFrom(usedon, user); } } Q5UQ(this); return(Q5NC); }
FUNCTION int Q43R(obj user, int newType) { int Q5NC = 0x00; if(Q50G(user)) { if(newType >= 0x00) { if(isRiding(user)) { int Q52Q = unRide(user); } if(!(hasObjVar(Q62D, "oldBodyType"))) { setObjVar(Q62D, "oldBodyType", getObjType(Q62D)); } if(!(hasObjVar(Q62D, "oldHue"))) { setObjVar(Q62D, "oldHue", getHue(Q62D)); } setType(user, newType); setHue(user, 0x00); int Q4NC = (getSkillLevel(user, 0x19) / 0x05) * 0x05; if(isScroll()) { Q4NC = 0x3C; } Q4MU(user, Q4NC); Q5NC = 0x01; } } Q5UQ(this); return(Q5NC); }
FUNCTION int Q4MA(obj user, obj usedon, int Q5VX, int Q4ID, int Q5NM) { int Q5NC = 0x00; int Q463; int Q4NC; if(Q50G(usedon)) { loc Q4VS = loc( getLocation(user) ); loc there = loc( getLocation(usedon) ); faceHere(user, getDirectionInternal(Q4VS, there)); if(hasObjVar(this, "magicItemModifier")) { int Q52W = getObjVar(this, "magicItemModifier"); Q4NC = 0x06 * Q52W; Q463 = Q52W; } else { Q4NC = 0x06 * getSkillLevel(user, 0x19) / 0x05 + 0x01; Q463 = getSkillLevel(user, 0x19) / 0x0A + 0x01; } if(!Q4ID) { Q463 = 0x00 - Q463; } if(!Q41Q(usedon, Q5VX, Q463, Q4NC)) { Q5NC = 0x01; Q4RD(user); } else { doMobAnimation(usedon, Q4T7(Q5VX, Q4ID), 0x0A, 0x0F, 0x00, 0x00); sfx(there, Q4TA(Q5VX, Q4ID), 0x00); } if(!Q4ID) { Q422(user, usedon, 0x00, Q5NM); Q5UK(user, usedon, 0x02, Q5NM); Q41C(user, usedon, Q5NM); receiveUnhealthyActionFrom(usedon, user); } } Q5UQ(this); return(Q5NC); }
TangibleObject* ImageDesignManager::createHairObject(CreatureObject* imageDesigner, CreatureObject* targetObject, const String& hairTemplate, const String& hairCustomization) { Reference<TangibleObject*> oldHair = targetObject->getSlottedObject("hair").castTo<TangibleObject*>(); HairAssetData* hairAssetData = CustomizationIdManager::instance()->getHairAssetData(hairTemplate); if (hairTemplate.isEmpty()) { if (!CustomizationIdManager::instance()->canBeBald(getSpeciesGenderString(targetObject))) return oldHair; else return NULL; } if (hairAssetData == NULL) return oldHair; int skillMod = hairAssetData->getSkillModValue(); if (imageDesigner->getSkillMod("hair") < skillMod) return oldHair; if (hairAssetData->getServerPlayerTemplate() != targetObject->getObjectTemplate()->getFullTemplateString()) { error("hair " + hairTemplate + " is not compatible with this creature player " + targetObject->getObjectTemplate()->getFullTemplateString()); return oldHair; } ManagedReference<SceneObject*> hair = imageDesigner->getZoneServer()->createObject(hairTemplate.hashCode(), 1); //TODO: Validate hairCustomization if (hair == NULL || !hair->isTangibleObject()) { if (hair != NULL) { Locker locker(hair); hair->destroyObjectFromDatabase(true); } return oldHair; } TangibleObject* tanoHair = cast<TangibleObject*>( hair.get()); Locker locker(tanoHair); tanoHair->setContainerDenyPermission("owner", ContainerPermissions::MOVECONTAINER); tanoHair->setContainerDefaultDenyPermission(ContainerPermissions::MOVECONTAINER); String appearanceFilename = tanoHair->getObjectTemplate()->getAppearanceFilename(); CustomizationVariables data; data.parseFromClientString(hairCustomization); if (validateCustomizationString(&data, appearanceFilename, getSkillLevel(imageDesigner, "hair"))) tanoHair->setCustomizationString(hairCustomization); return tanoHair; }
FUNCTION int Q4LV(obj user, obj usedon) { int Q5NC = 0x00; if(Q50G(usedon)) { int Q4NC; int defenseBonus; loc Q4VS = loc( getLocation(user) ); loc there = loc( getLocation(usedon) ); faceHere(user, getDirectionInternal(Q4VS, there)); if(!hasScript(usedon, "remprtct")) { doMobAnimation(usedon, 0x375A, 0x09, 0x14, 0x00, 0x00); sfx(there, 0x01ED, 0x00); if(hasObjVar(this, "magicItemModifier")) { int Q52W = getObjVar(this, "magicItemModifier"); Q4NC = 0x06 * Q52W; defenseBonus = 0x07; } else { defenseBonus = (getSkillLevel(user, 0x19) / 0x0A); Q4NC = 0x06 * getSkillLevel(user, 0x19) / 0x05; } setNaturalAC(usedon, getNaturalAC(usedon) + defenseBonus); setObjVar(usedon, "defenseBonus", defenseBonus); attachScript(usedon, "remprtct"); int Q527 = Q41J(user, usedon, 0x00, this); callback(usedon, Q4NC, 0x13); Q5NC = 0x01; } } Q5UQ(this); return(Q5NC); }
void ImageDesignManager::updateColorCustomization(CreatureObject* imageDesigner, const String& customizationName, uint32 value, TangibleObject* hairObject, CreatureObject* creo) { if (value > 255 || creo == NULL) return; String speciesGender = getSpeciesGenderString(creo); ManagedReference<CreatureObject*> creatureObject = creo; CustomizationData* customData = getCustomizationData(speciesGender, customizationName); if (customData == NULL) { //System::out << "Unable to get CustomizationData for " + speciesGender + "_" + customizationName << endl; return; } String skillMod = customData->getImageDesignSkillMod(); if (imageDesigner->getSkillMod(skillMod) < customData->getSkillModValue()) return; String variables = customData->getVariables(); String type = customData->getType(); TangibleObject* objectToUpdate = creo; if (customData->getIsVarHairColor()) { objectToUpdate = hairObject; } if (objectToUpdate == NULL) return; Vector<String> fullVariables; StringTokenizer tokenizer(variables); tokenizer.setDelimeter(","); while (tokenizer.hasMoreTokens()) { String var; tokenizer.getStringToken(var); fullVariables.add(var); } int skillLevel = getSkillLevel(imageDesigner, skillMod); updateColorVariable(fullVariables, value, objectToUpdate, skillLevel); }
FUNCTION int Q4LI(obj user, obj usedon, int Q5NM) { int Q5NC = 0x00; if(Q50G(usedon)) { if(!getMobFlag(usedon, 0x02)) { int Q4NC; loc Q4VS = loc( getLocation(user) ); loc there = loc( getLocation(usedon) ); faceHere(user, getDirectionInternal(Q4VS, there)); if(hasObjVar(this, "magicItemModifier")) { Q4NC = 0x02 * (getObjVar(this, "magicItemModifier")) + 0x05; } else { Q4NC = (getSkillLevel(user, 0x19) / 0x0A + 0x01) * 0x02 + 0x05; } if(Q4CN(NULL(), usedon, 0x05)) { Q4NC = Q4NC / 0x02; } doMobAnimation(usedon, 0x376A, 0x06, Q4NC, 0x00, 0x00); sfx(there, 0x0204, 0x00); setWaitState(usedon, Q4NC); int Q67T = waitState(usedon); setMobFlag(usedon, 0x02, 0x01); scriptTrig(usedon, 0x01, user); if(isValid(usedon)) { Q422(user, usedon, 0x00, Q5NM); if(isValid(usedon)) { Q5UK(user, usedon, 0x02, Q5NM); if(isValid(usedon)) { attachScript(usedon, "rempara"); callback(usedon, Q4NC, 0x0D); } } } } } Q5UQ(this); return(Q5NC); }