My Brave Shine Posted June 3, 2014 Author Share Posted June 3, 2014 Hey darlings Eclipcians… i stay working in my owne project.. and.. making tests and more tests... when I encounter one situation.. In ModCombat [Server Side] the calcule of "damage" Npc and Player [Npc x Player] and … [ Player x Player ~ ] This not add GetPlayerProtection in reduction of damage total '-' that cause a slots of equipaments.. helmet… armor.. and etc.. does nothing work '-' use or not use is whatever... :x ???i test modific the values (in game) .. values of.. possible Armor of Helmet and Armor... not reduce the damage of Npcs or Player...Therefore, use equipment is useless.=====================I have add in ModCombat, i think.. Sub TryNpcAttackPlayer and TryPlayerAttackPlayer.. on last "Damage = Damage"After all calcules and process of blockamount, and etc... i add..."Damage = Damage - GetPlayerProtection" its correct? has worked, but have cases of the Npc Attacker give HitKill and kill the player '-' Anyone can you help me put a calculation that actually works? or, teach my to add in my code one calcule where work.Att ~ (srry my bad english... ) Link to comment Share on other sites More sharing options...
Stein Posted June 3, 2014 Share Posted June 3, 2014 They were never finished or meant to be used in a production environment, they're just there because nobody bothered polishing this as it's really something that differs for every game. Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 3, 2014 Author Share Posted June 3, 2014 uhm.. But, in the Sub, Getplayerprotection have data of the slots… equipaments... basics, armor and helmet, i can call the sub protection in modcombat to soften the Damage of Player and Npc? or the Sub is useless? '-' Link to comment Share on other sites More sharing options...
Slasheree Posted June 3, 2014 Share Posted June 3, 2014 paste the Getplayerprotection function please :) Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 3, 2014 Author Share Posted June 3, 2014 rsrs slasherrrrrr *o* I'm at work.. when I get home i post <3(chegar em casa eu te mando s2s2s ) Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 3, 2014 Author Share Posted June 3, 2014 ```Function GetPlayerProtection(ByVal index As Long) As Long Dim Armor As Long Dim Helm As Long GetPlayerProtection = 0 ' Check for subscript out of range If isPlaying(index) = False Or index <= 0 Or index > Player_HighIndex Then Exit Function End If Armor = GetPlayerEquipment(index, Armor) Helm = GetPlayerEquipment(index, Helmet) GetPlayerProtection = (GetPlayerStat(index, Stats.Endurance) \ 3) If Armor > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Armor).Data2 End If If Helm > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Helm).Data2 End IfEnd Function```GetPlayerProtection : 3 Link to comment Share on other sites More sharing options...
Slasheree Posted June 3, 2014 Share Posted June 3, 2014 the formula appears to be somewhat 'legit', maybe you're setting your enemy's damage too high Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 3, 2014 Author Share Posted June 3, 2014 no… Npc Damage is igual of EO 3\. I not edit..my only edit is putis..In Sub TryNpcAttackPlayer``` ' * 1.5 if crit hit If CanNpcCrit(npcNum) Then Damage = Damage * 1.5 SendActionMsg mapnum, "Critical!", BrightCyan, 1, (MapNpc(mapnum).NPC(mapNpcNum).x * 32), (MapNpc(mapnum).NPC(mapNpcNum).y * 32) End If If Damage > 0 Then Call NpcAttackPlayer(mapNpcNum, index, Damage) End If End IfEnd Sub```before If Damage > 0 Then..I add...Damage = Damage - GetPlayerProtectionindex in the case... Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 4, 2014 Author Share Posted June 4, 2014 ```Function GetPlayerDefense(ByVal index As Long) As Long Dim Armor As Long Dim Helm As Long Dim Shield As Long GetPlayerDefense = 0 ' Check for subscript out of range If isPlaying(index) = False Or index <= 0 Or index > Player_HighIndex Then Exit Function End If Armor = GetPlayerEquipment(index, Armor) Helm = GetPlayerEquipment(index, Helmet) Shield = GetPlayerEquipment(index, Shield) GetPlayerDefense = (GetPlayerStat(index, Stats.Endurance) \ 3) FullArmor = GetPlayerEquipment(index, Armor) + GetPlayerEquipment(index, Helmet) If Armor > 0 Then GetPlayerDefense = GetPlayerDefense + Item(Armor).Data2 End If If Helm > 0 Then GetPlayerDefense = GetPlayerDefense + Item(Helm).Data2 End If If Shield > 0 Then GetPlayerDefense = GetPlayerDefense + Item(Shield).Data2 If Armor > 0 < Helm Then GetPlayerDefense = GetPlayerDefense + FullArmor End IfEnd Function```and it? if i add this in modCombat, and add call of sub in formule damage in TryNpcAttackPlayer??ex:My Sub GetPlayerDefense, would be very high defense items?Work?And```If Armor > 0 < Helm ThenGetPlayerDefense = GetPlayerDefense + FullArmorEnd If```Work? '-' i never test , and I am new to programming ù.ù#EditNot Work. I desist. rs. Link to comment Share on other sites More sharing options...
Matt Posted June 4, 2014 Share Posted June 4, 2014 You need to do```Damage = Damage - GetPlayerDefense(index)```and```If Armor > 0 and Helm > 0 then GetPlayerDefense = GetPlayerDefense + FullArmorend if``` Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 4, 2014 Author Share Posted June 4, 2014 Matt matt matt : 3Yep, in my text i have forget the index… :xin My sub defense i add FullArmor is long ... and going test. After post the conclusion..Thx Link to comment Share on other sites More sharing options...
Slasheree Posted June 4, 2014 Share Posted June 4, 2014 also, maybe you'll need to check if this variable doesn't get negative values:```Damage = Damage - GetPlayerDefense(index)```something like this```Damage = Damage - GetPlayerDefense(index)If Damage < 0 then Damage = 0``` Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 4, 2014 Author Share Posted June 4, 2014 Yep, i understand this.. But, i think, in my test.In ServerSide, ModCombat, have one code…"+/- this…"Damage = rand(1,Damage)"the damage "total" randomize the damage for 1 util damage total valor… the chances of damage low appaer is high.. '-' but this create a big variable of damage.if add the "getplayerdefense" or "getplayerprotection" after this, the damage is impaired sharply...i add th code"Damage = Damage - GetPlayerDefense(index)"or."Damage = Damage - GetPlayerProtection(index)"but, i Think, the SUB (TryNpcAttackPlayer), not understand What is the defense of the target player '-' i make change in data items, add more , or add other equipment.. and the calcule not change.. the damage of npc is egual. '-'simplifying ... I think the SUB'' can not understand that GetPlayerDefense or GetPlayerProtection is the player.and now? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now