Dungeon Crawl custom code merge

Added numerous modding hooks.
Added rules:
	Character:KeepLevelOverMax - Don't delevel a character if they are found to be over max level rule.
	Spells:UseCHAScribeHack - Optionally omit spells with CHA in effect12 when using scribespells and traindiscs
	Combat:MonkACBonusWeight - Adjust the weight threshold for monk AC bonus
	Combat:ClientStunLevel - Adjust the level clients kicks and bashes start to roll for stuns
	Combat;QuiverWRHasteDiv - Adjust the divisor applied to weight reduction for haste calcs
	Combat:UseArcheryBonusRoll - Make archery stationary bonus a roll
	Combat:ArcheryBonusChance - Archery stationary bonus chance

Added account flags and associated perl wrappers
Added EVENT_ITEM_TICK for interactive items
Added EVENT_DUEL_WIN and EVENT_DUEL_LOSE, which exports $enemyname and $enemyid
Added timer and interval to console worldshutdown command
Added EQW interface for worldshutdown and server-wide messages
This commit is contained in:
Tabasco
2013-04-24 15:58:51 -05:00
parent b15cb08f54
commit 56490400ca
45 changed files with 1321 additions and 156 deletions
+73 -1
View File
@@ -1895,7 +1895,8 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue)
if(id == "special_attacks")
{
NPCSpecialAttacks(val.c_str(), 0);
//DCBOOKMARK - Added reset flag.
NPCSpecialAttacks(val.c_str(), 0, 1);
return;
}
@@ -2414,3 +2415,74 @@ FACTION_VALUE NPC::CheckNPCFactionAlly(int32 other_faction) {
bool NPC::IsFactionListAlly(uint32 other_faction) {
return(CheckNPCFactionAlly(other_faction) == FACTION_ALLY);
}
//DCBOOKMARK
int NPC::GetScore()
{
int lv = min(70, (int)GetLevel());
int basedmg = (lv*2)*(1+(lv / 100)) - (lv / 2);
int minx = 0;
int basehp = 0;
int hpcontrib = 0;
int dmgcontrib = 0;
int spccontrib = 0;
int hp = GetMaxHP();
int mindmg = min_dmg;
int maxdmg = max_dmg;
int final;
if(lv < 46)
{
minx = ceil( ((lv - (lv / 10)) - 1) );
basehp = (lv * 10) + (lv * lv);
}
else
{
minx = ceil( ((lv - (lv / 10)) - 1) - (( abs(45 - lv) ) / 2) );
basehp = (lv * 10) + ((lv * lv) * 4);
}
if(hp > basehp)
{
hpcontrib = (int)( (float)((float)hp / (float)basehp) * 1.5);
if(hpcontrib > 5) { hpcontrib = 5; }
if(maxdmg > basedmg)
{
dmgcontrib = ceil( ((maxdmg / basedmg) * 1.5) );
}
if(HasNPCSpecialAtk("E")) { spccontrib++; } //Enrage
if(HasNPCSpecialAtk("F")) { spccontrib++; } //Flurry
if(HasNPCSpecialAtk("R")) { spccontrib++; } //Rampage
if(HasNPCSpecialAtk("r")) { spccontrib++; } //Area Rampage
if(HasNPCSpecialAtk("S")) { spccontrib++; } //Summon
if(HasNPCSpecialAtk("T")) { spccontrib += 2; } //Triple
if(HasNPCSpecialAtk("Q")) { spccontrib += 3; } //Quad
if(HasNPCSpecialAtk("U")) { spccontrib += 5; } //Unslowable
if(HasNPCSpecialAtk("L")) { spccontrib++; } //Innate Dual Wield
}
if(npc_spells_id > 12)
{
if(lv < 16) { spccontrib++; }
else { spccontrib += (int)floor(lv/15); }
}
final = minx + hpcontrib + dmgcontrib + spccontrib;
final = max(1, final);
final = min(100, final);
return(final);
}
uint32 NPC::GetSpawnKillCount()
{
uint32 sid = GetSpawnPointID();
if(sid > 0)
{
return(zone->GetSpawnKillCount(sid));
}
return(0);
}