Thread: Random fixes
View Single Post
  #8  
Old 08-11-2004, 03:34 PM
Branks
Sarnak
 
Join Date: May 2004
Posts: 58
Default

still working on this but been busy, anyway heres a few others that might be good enough to use.

lifeburn correction, although the FD effect in the recource is real buggy and causes the spell to be no agro, suppose to?
zone\spells.cpp repleace exsisting with-
Code:
 updated in later post.
Fearless and Fear resistance, also in zone\spells.cpp around line 1708 add-

Code:
	// solar: now check if the spell is allowed to land

	if((spelltar->IsClient())&&(IsEffectInSpell(spell_id,SE_Fear))&&((spelltar->CastToClient()->GetAAStruct()->class_skills.named.fearless)==1))
	{
		entity_list.MessageClose(spelltar, false, 50, 0, "%s has no Fear!", spelltar->GetName());
		return false;
	}
	if((spelltar->IsClient())&&(IsEffectInSpell(spell_id,SE_Fear))&&((spelltar->CastToClient()->GetAAStruct()->archetype_skills.named.fear_resistance)>=1))
	{
		int lev=spelltar->CastToClient()->GetAAStruct()->archetype_skills.named.fear_resistance;
		int r=MakeRandomInt(1,100);
		if((lev == 1)&&(r >= 95))
		{
			spelltar->CastToClient()->Message(0,"You overcome your Fears.");
			return false;
		}
		else if((lev == 2)&&(r >= 90))
		{
			spelltar->CastToClient()->Message(0,"You overcome your Fears.");
			return false;
		}
		else if((lev == 3)&&(r >= 75))
		{
			spelltar->CastToClient()->Message(0,"You overcome your Fears.");
			return false;
		}
	}
act of valor- zone/client.cpp around line 3808 replace exsisting with-
Code:
	case 76:			//act of valor
		{
			int cur_level=CastToClient()->GetAAStruct()->class_skills.named.act_of_valor;
			if(cur_level == 1)
			{
				if(target>0){targ=target->GetID();}
				else if(target==0)
				{
					CastToClient()->Message(0,"Skill requires a target");
					break;
				}
				CastSpell(2775,targ,9,0,0,0,0);
				int heal=c->GetHP();
				int curhp=target->GetHP();
				target->SetHP(heal+curhp);
				c->Death(c,0,0,0);
				timermod=4320;
				break;
			}
			else
				CastToClient()->Message(0,"You have not learned this skill");
		}
		break;
also in client.cpp around line 4308 change case 186 to 184 to correct guardian of the forrest.

Archery Mastery and headshot i went through some logs of ranger friends from live and found a lot of the current archery code to be incorrect IMO so i kinda redid a whole lot of it and added a level check that brings things much closer to live i believe, i think its better but far from perfect yet, anyway
zone/client_process.cpp around line 2268- remove everything from
float chancetohit = 0;
down to the } that is right above
float multiple=(GetLevel()/5);
and replace with-

Code:
							float chancetohit = 0;
							if(target){
								if(target->IsNPC())
									chancetohit = GetSkill(ARCHERY) / 3.75;
								else
									chancetohit = GetSkill(ARCHERY) / 4.75; //harder to hit players

								if (m_pp.level-target->GetLevel() < 0) {
									chancetohit -= (float)((target->GetLevel()-m_pp.level)*(target->GetLevel()-m_pp.level))/4;
								}
								
								int16 targetagi = target->GetAGI();
								int16 playerDex = (int16)(this->itembonuses->DEX + this->spellbonuses->DEX)/2;
								int16 levmod =0;
								if((this->GetLevel()-20) <= (target->GetLevel()))
								{
									levmod = ((target->GetLevel())-(this->GetLevel()-20))*0.5;
								}
								
								targetagi = (targetagi <= 200) ? targetagi:targetagi + ((targetagi-200)/5);
								chancetohit -= (float)targetagi*0.05;
								chancetohit += playerDex;
								chancetohit = (chancetohit > 0) ? chancetohit+30:30;
								chancetohit -= levmod;
								chancetohit = chancetohit*0.5;
								chancetohit = chancetohit > 95 ? 95 : chancetohit; // cap to 95%
								
								// Hit?
								if (MakeRandomFloat(0, 100) > chancetohit) {
									//this->Message(MT_Emote, "You missed your target");
									//this->Message_StringID(M,GENERIC_MISS,"You","your target.");
									target->Damage(this, 0, 0xffff, 0x07);
								}
								else {
									const Item_Struct* RangeItem = RangeWeapon->GetItem();
									const Item_Struct* AmmoItem = Ammo->GetItem();
									uint16 WDmg = RangeItem->Common.Damage;
									uint16 ADmg = AmmoItem->Common.Damage;
									int lev=CastToClient()->GetAAStruct()->class_skills.named.archery_mastery;
									int mod = 0;
									if(lev==0){mod=1;}
									else if(lev==1){mod=1.3;}
									else if(lev==2){mod=1.6;}
									else if(lev==3){mod=2.0;}
									
									uint16 levelBonus = (GetSTR()+GetLevel()+GetSkill(ARCHERY)) / 100;
									uint16 MaxDmg = (WDmg+ADmg)*levelBonus*mod;
									
									sint32 TotalDmg = 0;
									sint32 critDmg = 0;
									

									
									if (MaxDmg == 0)
										MaxDmg = 1;
									TotalDmg = (1 + MakeRandomInt(0, MaxDmg));
									if(GetClass()==RANGER) {
										critDmg = (sint32)(TotalDmg * 2);
									}
									if(target->IsClient()){ //Tone down pvp damage
										if(critDmg>0)
											critDmg-=critDmg/4;
										TotalDmg-=TotalDmg/4;
									}
									if ((GetClass()==RANGER)&&((GetAAStruct()->pop_ability.named.headshot)==1)&&((target->GetLevel()) <= (this->GetLevel()-20))&&(MakeRandomInt(0,100) >= 75)&&(target->IsNPC()))
									{	//headshot
										entity_list.MessageClose(this, false, 50, 0, "%s scores a HEADSHOT!", this->GetName());
										target->Damage(this, 32000, 0xffff, 0x07);
									}
									// no crits before level 12 cap is maxed	//todo make crits based on AA for other classes
									else if((GetClass()==RANGER)&&(GetSkill(ARCHERY)>65)&&(MakeRandomInt(0, 500) < (GetSkill(ARCHERY)+playerDex)/2)) {
										if(target->IsNPC() && !target->IsMoving() && !target->IsRooted() && this->GetLevel()>50){
											if(this->GetGM())
											{
												Message(0,"(GM ONLY) Doubling attack damage, npc isnt moving!");
												critDmg*=2;
											}
										}
										char val1[20]={0};
										entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, CRITICAL_HIT, GetName(), ConvertArray(critDmg,val1));
										//this->Message_StringID(MT_CritMelee,CRITICAL_HIT,GetName(),ConvertArray(critDmg,val1));
										//this->Message(MT_CritMelee, "You score a critical hit!(%d)", critDmg);
										target->Damage(this, critDmg, 0xffff, 0x07);
									}

									else {
										if(GetClass()==RANGER && !target->IsMoving() && !target->IsRooted() && this->GetLevel()>50){
											if(this->GetGM())
											{
												Message(0,"(GM ONLY) Doubling attack damage, npc isnt moving!");
												TotalDmg*=2;
											}
										}
										char hitname[64]={0};
										strncpy(hitname,target->GetName(),strlen(target->GetName())-2);
										//char val1[20]={0};
										//Message_StringID(MT_Emote,HIT_NON_MELEE,"You",hitname,ConvertArray(TotalDmg,val1));
										//this->Message(MT_Emote, "You Hit for a total of %d non-melee damage.", TotalDmg);
										target->Damage(this, TotalDmg, 0xffff, 0x07);
									}
								}
							
								// See if the player increases their skill - with cap
								float wisebonus =  (GetWIS() > 200) ? 20 + ((GetWIS() - 200) * 0.05) : GetWIS() * 0.1;
								
								if (((55-(GetSkill(ARCHERY)*0.240))+wisebonus > MakeRandomFloat(0, 100)) && (GetSkill(ARCHERY)<(m_pp.level+1)*5) && GetSkill(ARCHERY) < 252)
									this->SetSkill(ARCHERY,GetSkill(ARCHERY)+1);
							}
							break;
						}
Flurry, i made it 5, 10, 20% chance per lev based on something i read somewhere and just guessed and made it a 50% chance at 2 extra attacks when it triggers, also im not exactly sure how raging flurry works, from the wording it sounds like it might increase the chance of the second attack happening however a friend said it improves the chance of flurry happening by 10% per rank, anyone know how this works? i also made the flurry report an area thing with a range of 30 just cause well i think its cooler looking
zone\client_process.cpp around line 5336 add-
Code:
				if(((CastToClient()->GetAAStruct()->class_skills.named.flurry) >= 1)&&(IsAttackAllowed(target))
					&&(CastingSpellID()==0)&&(CombatRange(target)))
				{	//Dook- Flurry AA
					int lev=0;
					lev=CastToClient()->GetAAStruct()->class_skills.named.flurry;
					float rana = MakeRandomFloat(0, 1);
					float ranb = MakeRandomFloat(0, 1);
					if((lev == 1)&&(rana >= 0.95))
					{
						entity_list.MessageClose(this,false,20,13,"%s unleashes a FLURRY of attacks on %s!", GetName(), target->GetCleanName());
						Attack(target,13);
						if(ranb >= 0.5){Attack(target,13);}
					}
					else if((lev == 2)&&(rana >= 0.90))
					{
						entity_list.MessageClose(this,false,20,13,"%s unleashes a FLURRY of attacks on %s!", GetName(), target->GetCleanName());
						Attack(target,13);
						if(ranb >= 0.5){Attack(target,13);}
					}
					else if((lev == 3)&&(rana >= 0.80))
					{
						entity_list.MessageClose(this,false,20,13,"%s unleashes a FLURRY of attacks on %s!", GetName(), target->GetCleanName());
						Attack(target,13);
						if(ranb >= 0.5){Attack(target,13);}
					}
				}
Ambidexterity heard things from 7% to %10 so i went with %10
also in client_process.cpp around line 5392 add-

Code:
				if(CastToClient()->GetAAStruct()->class_skills.named.ambidexterity == 1)
				{
					DualWieldProbability = (GetSkill(DUAL_WIELD) + GetLevel()) / 354.5f;  // 10% for ambidexterity
				}
anyway thats all i got thats workable so far, more to come, anyone fixed wake the dead yet? i have no idea where to even start.
Reply With Quote