Following Nathan's sound suggestion I opened a new thread for the disarmcode <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="
" border="0" alt="smile.gif" />
Pieter, your new disarm code
code:
if( CheckAttribute(weapon, "fist" ) && enemy.chr_ai.group != LAI_GROUP_PLAYER )
// PB: New weapons attribute, exclusively for your fists
{
int rank = makeint(attack.rank)
int punch = rand (rank) + rank;
// Calculates the strength of your punch; character's rank increases damage
LAi_ApplyCharacterDamage(enemy, punch);
// Applies damage to enemy
LAi_CheckKillCharacter(enemy);
// Checks if this has killed the character
if(rand(100)< punch +10) // ccc added +10
// Checks if punch knocks enemy out; character's rank increases chance
{
LAi_SetPoorTypeNoGroup(enemy); // makes initial target collapse or cover
enemy.stuntime = locTmpTime; // stores the time of this, for reawakening
enemy.stuntime.dialog.filename = enemy.dialog.filename; // saves original dialog
enemy.dialog.filename = "stunned_dialog.c" ; // assigns "stunned" dialog during stuntime
if(enemy.sex == "man") {PlaySound("OBJECTSVoicesdeadmaledead1.wav")} // groan
else{PlaySound("OBJECTSVoicesdeadfemaledead_wom2.wav")}
Log_SetStringToLog("WHACK! You knocked out your opponent!");
float u, v, w; // coordinates for effects
GetCharacterPos(enemy, &u, &v, &w); // determines position of initial target
CreateParticleSystem("stars" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
// displays the "stars" particle effect on the victim
}
else
{
LAi_group_Attack(attack, enemy); // makes victim and associates attack you
}
}
looks correct to me. You have grasped the logic of coding quite well by now <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid="
" border="0" alt="onya.gif" />
One thing is IMHO not necessary in the first condition "chain":
if( CheckAttribute(weapon, "disarm" ) && LAi_IsFightMode(enemy) && !CheckAttribute(enemy,"nodisarm" ) && enemy.equip.blade!="bladeX4")
If "bladeX4" doesn't have the "disarm" attribute you can skip "&& enemy.equip.blade!="bladeX4" " completely cause "CheckAttribute(weapon, "disarm" )" will sort "bladeX4" out then.
This may not have the effect you have in mind:
if(CheckAttribute(attack,"skill.Fencing")) {disarmbonus = 20} else
{disarmbonus = 0}
"skill.Fencing" is the "Melee" skill.(Blame Akella for these confusing terms) As FAIK every (fighting) character has that, even if it is only "1", "attack" will ALWAYS have a disarmbonus of 20.
I assume that you wanted to check for the PERK(ability) "Professional Fencer", right ? That would be "perks.list.SwordplayProfessional"
So this might have the desired effect:
int disarmbonus = 0;
if(CheckAttribute(attack,"perks.list.SwordplayProfessional")) {disarmbonus = 20;}
Setting disarmbonus to 0 right away saves you the else case. if(IsCharacterPerkOn(enemy, "SwordplayProfessional")) is what Akella uses for perkchecks.
HTH

Pieter, your new disarm code
code:
if( CheckAttribute(weapon, "fist" ) && enemy.chr_ai.group != LAI_GROUP_PLAYER )
// PB: New weapons attribute, exclusively for your fists
{
int rank = makeint(attack.rank)
int punch = rand (rank) + rank;
// Calculates the strength of your punch; character's rank increases damage
LAi_ApplyCharacterDamage(enemy, punch);
// Applies damage to enemy
LAi_CheckKillCharacter(enemy);
// Checks if this has killed the character
if(rand(100)< punch +10) // ccc added +10
// Checks if punch knocks enemy out; character's rank increases chance
{
LAi_SetPoorTypeNoGroup(enemy); // makes initial target collapse or cover
enemy.stuntime = locTmpTime; // stores the time of this, for reawakening
enemy.stuntime.dialog.filename = enemy.dialog.filename; // saves original dialog
enemy.dialog.filename = "stunned_dialog.c" ; // assigns "stunned" dialog during stuntime
if(enemy.sex == "man") {PlaySound("OBJECTSVoicesdeadmaledead1.wav")} // groan
else{PlaySound("OBJECTSVoicesdeadfemaledead_wom2.wav")}
Log_SetStringToLog("WHACK! You knocked out your opponent!");
float u, v, w; // coordinates for effects
GetCharacterPos(enemy, &u, &v, &w); // determines position of initial target
CreateParticleSystem("stars" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
// displays the "stars" particle effect on the victim
}
else
{
LAi_group_Attack(attack, enemy); // makes victim and associates attack you
}
}
looks correct to me. You have grasped the logic of coding quite well by now <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid="

One thing is IMHO not necessary in the first condition "chain":
if( CheckAttribute(weapon, "disarm" ) && LAi_IsFightMode(enemy) && !CheckAttribute(enemy,"nodisarm" ) && enemy.equip.blade!="bladeX4")
If "bladeX4" doesn't have the "disarm" attribute you can skip "&& enemy.equip.blade!="bladeX4" " completely cause "CheckAttribute(weapon, "disarm" )" will sort "bladeX4" out then.
This may not have the effect you have in mind:
if(CheckAttribute(attack,"skill.Fencing")) {disarmbonus = 20} else
{disarmbonus = 0}
"skill.Fencing" is the "Melee" skill.(Blame Akella for these confusing terms) As FAIK every (fighting) character has that, even if it is only "1", "attack" will ALWAYS have a disarmbonus of 20.
I assume that you wanted to check for the PERK(ability) "Professional Fencer", right ? That would be "perks.list.SwordplayProfessional"
So this might have the desired effect:
int disarmbonus = 0;
if(CheckAttribute(attack,"perks.list.SwordplayProfessional")) {disarmbonus = 20;}
Setting disarmbonus to 0 right away saves you the else case. if(IsCharacterPerkOn(enemy, "SwordplayProfessional")) is what Akella uses for perkchecks.
HTH