Blasphemy
Well-Known Member
- Joined
- Jan 5, 2012
- Messages
- 387
- Reaction score
- 67
thanks for clarification... because I was testing and it was working fine for me hehe
thanks for clarification... because I was testing and it was working fine for me hehe
I don't know but I have an issue related to this. Ranged spells from monsters, are extremely fast, and my engine has this improvement... what is happening?That one is, just saying if you use rand(), like rand()%10, its not inclusive. Programming is fun (Y)
Heres my Orc Spearman now.
Before uniform_random(1, spellBlock.chance) == 1
After uniform_random(1, spellBlock.chance) == 1
A Demon vs Hydra.
Before uniform_random(1, spellBlock.chance) == 1
After uniform_random(1, spellBlock.chance) == 1
A lot more agressive with spells and healing.
void Monster::doAttacking(uint32_t)
{
if (!attackedCreature || (isSummon() && attackedCreature == this)) {
return;
}
const Position& myPos = getPosition();
const Position& targetPos = attackedCreature->getPosition();
bool updateLook = false;
if (OTSYS_TIME() >= earliestAttackTime && !isFleeing()) {
updateLook = true;
if (Combat::closeAttack(this, attackedCreature, FIGHTMODE_BALANCED)) {
egibleToDance = true;
earliestAttackTime = OTSYS_TIME() + 2000;
removeCondition(CONDITION_AGGRESSIVE, true);
}
}
for (spellBlock_t& spellBlock : mType->info.attackSpells) {
if (spellBlock.range != 0 && std::max<uint32_t>(Position::getDistanceX(myPos, targetPos), Position::getDistanceY(myPos, targetPos)) <= spellBlock.range) {
if (uniform_random(0, spellBlock.chance) == 0 && (master || health > mType->info.runAwayHealth || uniform_random(1, 3) == 1)) {
updateLookDirection();
minCombatValue = spellBlock.minCombatValue;
maxCombatValue = spellBlock.maxCombatValue;
spellBlock.spell->castSpell(this, attackedCreature);
egibleToDance = true;
}
}
}
if (updateLook) {
updateLookDirection();
}
}
the uniform attack formula is the closest I think to a true 7.x time attackI don't know but I have an issue related to this. Ranged spells from monsters, are extremely fast, and my engine has this improvement... what is happening?
Code:void Monster::doAttacking(uint32_t) { if (!attackedCreature || (isSummon() && attackedCreature == this)) { return; } const Position& myPos = getPosition(); const Position& targetPos = attackedCreature->getPosition(); bool updateLook = false; if (OTSYS_TIME() >= earliestAttackTime && !isFleeing()) { updateLook = true; if (Combat::closeAttack(this, attackedCreature, FIGHTMODE_BALANCED)) { egibleToDance = true; earliestAttackTime = OTSYS_TIME() + 2000; removeCondition(CONDITION_AGGRESSIVE, true); } } for (spellBlock_t& spellBlock : mType->info.attackSpells) { if (spellBlock.range != 0 && std::max<uint32_t>(Position::getDistanceX(myPos, targetPos), Position::getDistanceY(myPos, targetPos)) <= spellBlock.range) { if (uniform_random(0, spellBlock.chance) == 0 && (master || health > mType->info.runAwayHealth || uniform_random(1, 3) == 1)) { updateLookDirection(); minCombatValue = spellBlock.minCombatValue; maxCombatValue = spellBlock.maxCombatValue; spellBlock.spell->castSpell(this, attackedCreature); egibleToDance = true; } } } if (updateLook) { updateLookDirection(); } }
oh, I'll try to do a video about my case... I mean, my distanced spell mobs are bugthe uniform attack formula is the closest I think to a true 7.x time attack
if it doesn't suit your requirements, reduce the monster intervals separately
the "hmm" of the warlock goes to fastoh, I'll try to do a video about my case... I mean, my distanced spell mobs are bug
Looks pretty right just from these gifs.oh, I'll try to do a video about my case... I mean, my distanced spell mobs are bug
Post automatically merged:
View attachment 71943 the "hmm" of the warlock goes to fast
View attachment 71944hunters doesn't attack that fast
i see... thanks for the support <3Looks pretty right just from these gifs.
Ranged monsters spell cast interval is every 1 second, and again when they walk.
Here's an example from Cipsoft real server (3 hunters and 3 warlocks)
where should i check for attack intervals ? i want to add this feature to nekiro's downgraded serverLooks pretty right just from these gifs.
Ranged monsters spell cast interval is every 1 second, and again when they walk.
Here's an example from Cipsoft real server (3 hunters and 3 warlocks)
First of all in monster xml, where will be what should he actwhere should i check for attack intervals ? i want to add this feature to nekiro's downgraded server
Monsters in Nostalrius don't have intervals in the xml files ,because 7.x monstesr didnt have individual intervals.First of all in monster xml, where will be what should he act
i thought that "chance" is like sort of interval here...All spell casts are in sources onAttacking. They all already attack on the 1second interval unless in melee rannge, and its 2second.
<attacks attack="13" skill="18">
<attack name="physical" min="-50" max="-100" range="7" [B]chance[/B]="2">
<attribute key="shootEffect" value="arrow" />
</attack>
Thanks panther on attacking and where else?Monsters in Nostalrius don't have intervals in the xml files ,because 7.x monstesr didnt have individual intervals.
All spell casts are in sources onAttacking. They all already attack on the 1second interval unless in melee rannge, and its 2second.
Idk about Nekiros downgrade, its basd of f TFS 1,4 isnt it? Might be quite diference from these soruces.
"transfer" -> "How much do you want to transfer?", Topic=104
Topic=104,%1,0<%1,Balance>=%1 -> Price=%1, "Who exactly you want to transfer your %P gold to?", Topic=105
Topic=105,PlayerExist(String)=1 -> Name=String, "So you want to transfer %P gold to %NS?", Topic=106
Topic=105 -> "Sorry, that player does not exist."
Topic=106,"yes" -> "%NS has recieved %P gold!", Transfer(Name, Price)
PlayerExist(String)=1 // check to see that player actually exists
Name=String // set the variable to be able to use it inside transfer function later
%NS // string response
else if (identifier == "transfer") {
action->type = BEHAVIOUR_TYPE_TRANSFER;
searchType = BEHAVIOUR_PARAMETER_TWO;
}
case BEHAVIOUR_TYPE_TRANSFER: {
Player* target = g_game.getPlayerByName(action->expression->string);
if (!target) {
break;
}
int32_t money = evaluate(action->expression2, player, message);
if (money > 0) {
player->setBankBalance(player->getBankBalance() - money);
target->setBankBalance(target->getBankBalance() + money);
}
break;
}
#thais
Topic=1,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32313,32212,7), EffectOpp(11)
Topic=1,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32313,32212,7), EffectOpp(11)
Topic=1,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#carlin
Topic=2,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32388,31821,7), EffectOpp(11)
Topic=2,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32388,31821,7), EffectOpp(11)
Topic=2,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#ab'dendriel
Topic=3,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32733,31664,7 ), EffectOpp(11)
Topic=3,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32733,31664,7 ), EffectOpp(11)
Topic=3,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#edron
Topic=4,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33182,31764,7), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33182,31764,7), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#venore
Topic=5,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32956,32023,7), EffectOpp(11)
Topic=5,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32956,32023,7), EffectOpp(11)
Topic=5,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#darashia
Topic=6,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33293,32481,7), EffectOpp(11)
Topic=6,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33293,32481,7), EffectOpp(11)
Topic=6,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#ankrahmun
Topic=7,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33092,32882,7), EffectOpp(11)
Topic=7,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33092,32882,7), EffectOpp(11)
Topic=7,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#port hope
Topic=8,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32527,32784,6), EffectOpp(11)
Topic=8,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32527,32784,6), EffectOpp(11)
Topic=8,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#cormaya
Topic=4,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33289,31956,6), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33289,31956,6), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
##carpets
#darashia
Topic=1,"yes",CountMoney>=Price -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(33269,32441,6), EffectOpp(11)
Topic=1,"yes",CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33269,32441,6), EffectOpp(11)
Topic=1,"yes",CountMoney<Price,Balance<Price -> "You have not enough gold."
#femor hills
Topic=2,"yes",CountMoney>=Price -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(32535,31837,4), EffectOpp(11)
Topic=2,"yes",CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32535,31837,4), EffectOpp(11)
Topic=2,"yes",CountMoney<Price,Balance<Price -> "You have not enough gold."
#edron
Topic=3,"yes",CountMoney>=Price -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(33193,31784,3), EffectOpp(11)
Topic=3,"yes",CountMoney<Price,Balance>=Price -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33193,31784,3), EffectOpp(11)
Topic=3,"yes",CountMoney<Price,Balance<Price -> "You have not enough gold."
i think there's a lot more we must add...has anyone implemented bank transfer system yet for npcs or got some experience to help me finish it?
gen-bank.ndb
Code:"transfer" -> "How much do you want to transfer?", Topic=104 Topic=104,%1,0<%1,Balance>=%1 -> Price=%1, "Who exactly you want to transfer your %P gold to?", Topic=105 Topic=105,PlayerExist(String)=1 -> Name=String, "So you want to transfer %P gold to %NS?", Topic=106 Topic=105 -> "Sorry, that player does not exist." Topic=106,"yes" -> "%NS has recieved %P gold!", Transfer(Name, Price)
not sure how to implement these yet
Code:PlayerExist(String)=1 // check to see that player actually exists Name=String // set the variable to be able to use it inside transfer function later %NS // string response
Transfer(Name, Price) action:
BehaviourDatabase::loadActions
BehaviourDatabase::checkActionC++:else if (identifier == "transfer") { action->type = BEHAVIOUR_TYPE_TRANSFER; searchType = BEHAVIOUR_PARAMETER_TWO; }
C++:case BEHAVIOUR_TYPE_TRANSFER: { Player* target = g_game.getPlayerByName(action->expression->string); if (!target) { break; } int32_t money = evaluate(action->expression2, player, message); if (money > 0) { player->setBankBalance(player->getBankBalance() - money); target->setBankBalance(target->getBankBalance() + money); } break; }
Sorted out update combat.cpp@Ezzz
Someone checks the area effect of burst arrows, because i found it's going straight to the creature and not following the arrow.
And i downloaded another clean soucer from here and compiled the same thing.
I tried to fix combat.cpp only made it worse.
i think those changes were improve on 2019Sorted out update combat.cpp
after remove MissileEffect from burst arrow in items.srv
Your solution kinda worked for me, Thanks for that!Sorted out update combat.cpp
after remove MissileEffect from burst arrow in items.srv
you need to compile it.... /facepalmI download It but i can't start the server to test. There isn't a .exe to execute and open it. Where can I find it?