Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Item: Blood Syringe
- Created by: Laughing Octopus
- Script that executes on activate(touch).
- Creates a second item in the user's inventory representing the target's blood. */
- #include "x0_i0_match"
- void main()
- {
- //Define Varibles
- object oItem = GetItemActivated();
- object oPC = GetItemActivator();
- object oTarget = GetItemActivatedTarget();
- string sBlood = GetName(oTarget);
- string sTrueBlood = GetName(oTarget, TRUE);
- string sNoBlood = "The target has no blood to draw.";
- //Determine if target is a creature
- if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) {
- //Determine if creature is a valid type
- switch(GetRacialType(oTarget)) {
- case RACIAL_TYPE_CONSTRUCT: SendMessageToPC(oPC, sNoBlood); break;
- case RACIAL_TYPE_UNDEAD: SendMessageToPC(oPC, sNoBlood); break;
- case RACIAL_TYPE_ELEMENTAL: SendMessageToPC(oPC, sNoBlood); break;
- case RACIAL_TYPE_INVALID: SendMessageToPC(oPC, sNoBlood); break;
- default:
- //Petrified people have petrified blood
- if(GetHasEffect(EFFECT_TYPE_PETRIFY, oTarget) != TRUE) {
- //Determine if target is willing or helpless
- if((oTarget == oPC) //willing
- || GetHasEffect(EFFECT_TYPE_CHARMED, oTarget) //willing
- || GetHasEffect(EFFECT_TYPE_SLEEP, oTarget) //helpless
- || GetHasEffect(EFFECT_TYPE_PARALYZE, oTarget) //helpless
- ) {
- //Create sample and apply name variable
- object oBlood = CreateItemOnObject("emb_itm_blood", oPC);
- SetName(oBlood, sBlood+"'s Blood");
- SetLocalString(oBlood, "BloodOwner", sTrueBlood);
- } else {SendMessageToPC(oPC, "The target is not willing or helpless.");}
- } else {SendMessageToPC(oPC, sNoBlood);}
- }
- } else {SendMessageToPC(oPC, "The target is not a creature.");}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement