Aller au contenu

Photo

Throwing shoe spell


  • Veuillez vous connecter pour répondre
24 réponses à ce sujet

#1
werelynx

werelynx
  • Members
  • 628 messages
I downloaded the Custom Content Challenge June 2011 - Poor Folk and would like to use "throwing shoe" spell as a means of knocking out an NPC (via applying permanent sleep effect).
I made the item that is able to cast such spell(throwing shoe), but I'm unable to effectively script applying sleep effect upon impact of the shoe.
Tried editing 2da to make it apply custom "sleep" script upon impact, but didn't know how to proceed further - Lilac Soul's generator does not seem to have succh option. It can't be heartbeat, because it will effectively be during the fight with said NPC.

Would you be able to help me?

#2
henesua

henesua
  • Members
  • 3 863 messages
Ah ha! I like where this is going.

Post what you have so far, and I and I am sure others will take a look.

In terms of general strategy for tackling this however I recommend looking at the sleep spell because it appears to me that you are essentially creating a version of an item activated sleep spell.

#3
werelynx

werelynx
  • Members
  • 628 messages
I made a script with Lilac and called it "sleep":

void main()
{
object oPC;
if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE)
){
SendMessageToPC(GetItemActivator(), "Improper use of item!");
return;}
object oTarget;
oTarget = GetItemActivatedTarget();
effect eEffect;
eEffect = EffectSleep();
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
}

and edited spells.2da lines:

1501  Throwing_Shoe_Male                  7479     is_ccc_shoe01    V        M       s      ****        0x3e         sleep              ****   ****     ****    ****      ****     ****       3        1500       hand       ****              ****              ****              ****              ****               ****               up         1000       ****             ****             ****             ****               1      it_thr_shoe01      ballistic      hand            spr_los            path              ****             0              ****           ****           ****           ****           ****           2          ****     4          ****        0                  0                   ****         0                ****        ****       ****       1    
        
1502  Throwing_Shoe_Fem                   7476     is_ccc_shoe02    V        M       s      ****        0x3e         sleep              ****   ****     ****    ****      ****     ****       3        1500       hand       ****              ****              ****              ****              ****               ****               up         1000       ****             ****             ****             ****               1      it_thr_shoe02      ballistic      hand            spr_los            path              ****             0              ****           ****           ****           ****           ****           2          ****     4          ****        0                  0                   ****         0                ****        ****       ****       1            
 
the column with "sleep" is the one I changed from the ccc original 2da

I have an item(Shoe of Throwing) with one-shot spell "Right foot" that corresponds to the 1502 2da line.

Modifié par werelynx, 30 janvier 2013 - 01:56 .


#4
henesua

henesua
  • Members
  • 3 863 messages
Here you go, Werelynx.

Posted Image

Try these on and tell me how they fit.

I treated the shoes as grenades, shoe bombs if you will. Two grenade items are in the ERF, with a spell. The 2das are included for your use as is the HAK and a Module to try them out. All the shoe resources are in the HAK. Or you can use the CCC hak. Your choice. But the 2DAs I gave you need to be in a top hak in your module.

Modifié par henesua, 30 janvier 2013 - 03:07 .


#5
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Oh well done, sir. Jorge Arbusto approves. :P

Funky

#6
werelynx

werelynx
  • Members
  • 628 messages
They are lovely! I will include them now, just make sure there is not a single save against the dreaded Henesua's Shoes of Throwing, muahahahh, khe, khe.
THANKS!

#7
henesua

henesua
  • Members
  • 3 863 messages
I only did the spell. All the real work is by Estelindis. Please credit her for the shoe grenades. Implementing them as grenades appears to have been her intention for these all along anyway.

With regards to the little spell script I put together. Feel free to modify. The VFX_IMP_HEAD_SONIC may be a bit much. And notice that I made crits with a shoe particularly difficult to save against. They put you to sleep for 10 rounds as well.

You'll notice that all of that can be adjusted at the top of the main(). Just change the values in the variables nDC and nDuration. If you have questions, ask away.

[edit] I just realized... I might not have put the sleeping VFX on thsoe that got knocked out. That will need to be remedied. Let me know if you need this revised or if you can handle that change.

Modifié par henesua, 30 janvier 2013 - 09:30 .


#8
henesua

henesua
  • Members
  • 3 863 messages
 The crude implementation was bugging me. I improved the spell script a great deal.

The effect is now a stun. The duration VFX is the disabled one that goes with a stun. Targets play various animations at random for the different possibilities: dodges, spasms, taunts, flops etc...

I like this one much better. Very diverting.

Modifié par henesua, 31 janvier 2013 - 03:21 .


#9
werelynx

werelynx
  • Members
  • 628 messages
With the help of Lilac's I changed the original Imelda's Flop House to do: no saves, nor ranged touch attack rolls, permanent sleep. I wanted it more as a narrative tool, rather than real weapon. To not get it overpowered I only give the player a pair of such shoes.
Oh and I added "Boot to the head!" line spoken by PC after each throw.

Of course I will credit Estelinda! Just do not know how to include her alias in the module, yet. (S)he is already in the readme.

#10
Estelindis

Estelindis
  • Members
  • 3 699 messages
Thanks for providing such prompt help, Henesua! I am no amazing script wizard myself, so when Werelynx asked me for advice I suggested this forum right away. Good to know it's still going strong.

#11
henesua

henesua
  • Members
  • 3 863 messages
Sounds good, Werelynx. Since you removed saves and the to hit roll, I doubt any of the changes I made are of much value to you. Unfortunate. That last upload looks much better.

Estelindis, you are missed here. Those shoes are a fun addition to the game. I hadn't played with them before. I wish you still slummed it with us and churned out your goodies in the CCC.

I wonder if you could be tempted to join us for a module building challenge. Care to join us?

#12
Estelindis

Estelindis
  • Members
  • 3 699 messages
Thanks for the kind words. I wish I was still doing the CCC too. I just have to focus on finishing my postgraduate work at the moment and NWN is too enjoyable a distraction. I shall have a look at the module challenge anyway, even if I don't take part.

#13
werelynx

werelynx
  • Members
  • 628 messages
It kinda does that. Yesterday I set a deadline for myself and now I'm sure I will need more time to implement everything. Worst is that I don't want to stop.

Well.
Now that my NPCs are sleeping I would like to wake them. I made a script with Lilac and put it on the lever's OnClick (OnUsed was already, well used).

oTarget = GetObjectByTag("Mistress");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect)==EFFECT_TYPE_SLEEP) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}

The problem is it does not work :(
I made sleep a supernaturaleffect - could that be the culprit?

Anyway I hope you would try to make some modules with us. Even such a clumsy and nooby scripter/builder as I have tried.

Modifié par werelynx, 04 février 2013 - 10:14 .


#14
ffbj

ffbj
  • Members
  • 593 messages
Probably. There is a subtype: int SUBTYPE_SUPERNATURAL
So:
(GetEffectType(eEffect) == SUBTYPE_SUPERNATURAL)

Modifié par ffbj, 05 février 2013 - 07:08 .


#15
henesua

henesua
  • Members
  • 3 863 messages
Werelynx

in your loop instead of checking for the sleep effect, check which spell applied the effect, and remove every effect created by the spell.

#16
ffbj

ffbj
  • Members
  • 593 messages
This topic reminds me of American Maid:
http://www.thetick.ws/tvheroes.html

#17
werelynx

werelynx
  • Members
  • 628 messages
Hilarious, will have to watch it:)

The code I'm going to test:

oTarget = GetObjectByTag("Mistress");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
   {
   if (GetEffectType(eEffect) == SUBTYPE_SUPERNATURAL) RemoveEffect(oTarget, eEffect);
   eEffect = GetNextEffect(oTarget);
   }

I can't understand how to do it Henesua style :(. I'm not good at scripting and I can't find function that would do GetLastSpell is only valid for last spell, but sometimes it won't be the sleep spell(NPCs are casters as well).
GetHasSpellEffect : I do not know how to call the spell in this, the link in the description points only to visual effects.

Off to test it.

Modifié par werelynx, 05 février 2013 - 08:56 .


#18
werelynx

werelynx
  • Members
  • 628 messages
Ok that did not work. I have an idea though: I will remove "supernaturalness" and try then. Or just make area wide dispel(if that's possible)


Edit: It makes me wonder though: If effect is normal, then it could be removed by sleeping(at least that's what Lilac says). So the sleep effect can be removed by sleeping.

Lilac should have written "by resting" :P

Modifié par werelynx, 05 février 2013 - 09:19 .


#19
henesua

henesua
  • Members
  • 3 863 messages
You need

GetEffectSpellId

Use that function to determine whether the shoe spell created the effect within your loop

Modifié par henesua, 05 février 2013 - 09:21 .


#20
werelynx

werelynx
  • Members
  • 628 messages
oTarget = GetObjectByTag("Tad");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}

Would this do? Boot spells are 1501 and 1502 in my spells.2da

Edit: Nah, it didn't work. What's exactly the Id of a spell?

Modifié par werelynx, 05 février 2013 - 09:51 .


#21
henesua

henesua
  • Members
  • 3 863 messages

werelynx wrote...

oTarget = GetObjectByTag("Tad");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}

Would this do? Boot spells are 1501 and 1502 in my spells.2da


That is a bit messy, preventing you from adding more spells. Better practice would be:
oTarget = GetObjectByTag("Tad");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
    nSpellId    = GetEffectSpellId(eEffect);
    if (nSpellId==1500 || nSpellId==1501)
        RemoveEffect(oTarget, eEffect);

    eEffect = GetNextEffect(oTarget);
}


#22
werelynx

werelynx
  • Members
  • 628 messages
Oh Mein Gott! Lilac never initiated the variable: object oTarget
Or maybe I didn't copy it anywhere, hopefully this is the solution.
If not then 'my' (ABC very vague hint) NPCs will have to deal with their commas.

#23
henesua

henesua
  • Members
  • 3 863 messages
i made a mistake. declare the variable outside the loop.

int nSpellId;

I meant to, but I'm also supposed to be working. :) A bit distracted by RL.

Also... compiling the script shoudl catch that error. Make sure you compile the script. At the least do a module build, and build your scripts.

Modifié par henesua, 05 février 2013 - 10:18 .


#24
werelynx

werelynx
  • Members
  • 628 messages
Bwahaahhahah! It is alive!

The code I used is:
object oTarget;
int nSpellId;
effect eEffect;

oTarget = GetObjectByTag("Tad");
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
and so on for every critter's tag

Your code still wouldn't work. Dunno why. Just put two placeables: one with yours and one with above(remains of previous playtest)

Did not know that I can compile those, I was about to complain about not having a compiler that would show the errors.


By the way I hope you won't be angry when you see for what I did use this code. In any case I'm strengthening the security of my lair(by buying a lots of boots).

and last but not least:

THANK YOU FOR HELP :happy:!!!!

Modifié par werelynx, 05 février 2013 - 10:43 .


#25
henesua

henesua
  • Members
  • 3 863 messages
Oh... I made a mistake... the spell numbers would be 1501 and 1502 then. instead of 1500 and 1501. I missed that.

You should really set constants for your spells and put them in a central include. Little istakes like I made are difficult to track down. But if you have all of your custom spell and feat constants etc... in a central include it makes checking that the indexes are correct much easier.

Modifié par henesua, 05 février 2013 - 11:06 .