$npc->Damage($entity_id)?
I've searched and cannot find a way to code making an npc do damage to an entity_id. The script is posted below. I'd like to make the line indicated by surrounding comment lines (so you can find it easily) perform the function listed on that line. The entire remainder of the script functions as intended. Any help would be appreciated.
Code:
############# |
Code:
Heres an idea of how to use damage. Be aware its very dangerous to use as you can cause crashes with it if you try to Damage a null entity. |
Thank you for the format of that command, I'll employ a check to see if the intended recipient is up first to prevent crashes.
|
I tried the code as NatedogEZ has listed above:
Code:
$npc->Damage($h_ent, $h_dmg*0.1, 0, 1, true, -1, false); I'm a little confused on the first part where it says "Damage(Mob* from," What does this mean? Does it refer to the intended recipient of the damage, or the entity doing the damage (thus the "from")? If the former, Nate's code looks correct but does not work. If the latter, it should be changed to $NPC_ID but I don't see the point of this in the argument list. |
http://67.23.190.71/forums/showthread.php?t=26031
I found this old post about the same topic. It appears, from the suggested working code, that the "from" variable needs to be $npc, simply listing the source of the damage as the script npc in question. I will be trying this later today when I get the chance, although I'm still worried about the spell_id being 0. Code:
$npc->Damage($npc, $h_dmg*0.1, 0, 1, true, -1, false); |
Update:
I changed the code to: Code:
$npc->Damage($npc, $h_dmg, 0, 1, true, -1, false); Code:
if($timer eq "damage") { Nomada the Snowdrift says 'Salvanna is on my hatelist with 19014 hate and 56753 damage. Nomada the Snowdrift says 'Doing 56753 damage to Mob=SCALAR(0xcdd1f64)' |
Try this maybe...
Code:
if($timer eq "damage") { |
It is now clear from testing
Code:
$npc->Damage($h_ent, $h_dmg, 13, 1, true, -1, false); So, this does not solve my problem of having the mob cause $h_dmg to each entity on its hatelist. This function cannot create that effect and my search continues... |
wait... maybe it needs to be ...
Code:
|
I found a solution:
Code:
$npc->DoSpecialAttackDamage($h_ent, 400, $h_dmg, $h_dmg, -1); Thank you NatedogEZ for all the help trying to solve this! |
Code:
$ent->Damage($npc, 1000, 0, 1, 'FALSE', -1, 'FALSE'); |
All times are GMT -4. The time now is 10:10 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.