Fishing System 2.0
Re: Fishing System 2.0
just keep a list of the valid mobids of spawnable mobs, then iterate to find the first that isnt spawned (getmobaction == 0), then move its pos behind the player (setpos + nearposition), then spawn it with spawnmob, and update its enmity to make it engage the fisher (these functions are assumed to be from script, i forget if fishing is core or script)
Re: Fishing System 2.0
That is what I am doing with the exception of setting the x,y,z to position -1.0,-1.0,-1.0 so it will load the mob when the server initializes the zone other wise I can't spawn the mob
the reason I am setting the x,y,z to this is because the server will not actually spawn the mob it will just add info to the mob list.
and the fishing is core and lua its kind of weird lol I am trying to optimize it is a bit.
I hope to have a beta soon I am trying to figure out how I want to handle the bait and rod info because it need to get changed.
the reason I am setting the x,y,z to this is because the server will not actually spawn the mob it will just add info to the mob list.
and the fishing is core and lua its kind of weird lol I am trying to optimize it is a bit.
I hope to have a beta soon I am trying to figure out how I want to handle the bait and rod info because it need to get changed.
Re: Fishing System 2.0
just don't spawn mobs off the map, move them using setPos first, and make sure they despawn instead of walking back after losing combat
Re: Fishing System 2.0
well here is my function I can't seem to get the mob to attack the player :/ it spawns the mob where it should though
I hope this is the proper method
Code: Select all
void spawncatch(CCharEntity* PChar, uint32 mobid)
{
CMobEntity* PMob = (CMobEntity*)zoneutils::GetEntity(mobid, TYPE_MOB);
PMob->m_AllowRespawn = false;
PMob->m_SpawnPoint = nearPosition(PChar->loc.p, 2.2f, M_PI);
PMob->PBattleAI->SetLastActionTime(gettick());
if (PMob->PBattleAI->GetCurrentAction() == ACTION_NONE)
{
PMob->PBattleAI->SetCurrentAction(ACTION_SPAWN);
}
if (PMob->PBattleAI->GetCurrentAction() == ACTION_NONE ||
PMob->PBattleAI->GetCurrentAction() == ACTION_SPAWN)
{
PMob->PBattleAI->SetLastActionTime(0);
PMob->PBattleAI->SetCurrentAction(ACTION_SPAWN);
}
else {
ShowDebug(CL_CYAN"SpawnMob: <%s> is alredy spawned\n" CL_RESET, PMob->GetName());
}
PMob->PBattleAI->SetBattleTarget(PChar);
luautils::OnMobEngaged(PMob, PChar);
PMob->PBattleAI->CheckCurrentAction(gettick());
}
Re: Fishing System 2.0
don't call onMobEngaged, setBattleTarget or CheckCurrentAction, let the AI handle those. all you have to do is add base enmity using PMob->PEnmityContainer->AddBaseEnmity
-
- Developer
- Posts: 40
- Joined: Sat Mar 30, 2013 12:00 pm
Re: Fishing System 2.0
Fished up mobs probably have their own mob IDs, hence I would assume there can be a maximum amount of fished up mobs per time in one area. I'm not really sure on this, though. From what I remember from retail camping Devil Manta.. This is probably the case. For moving the mob position, can just do X and Y +1 I would assume. Might make some mobs appear off the side of boats and stuff though :/
Re: Fishing System 2.0
he's already using nearPosition with pi rotation to spawn them behind the fisher, so he's good on that partApocalypse612 wrote:Fished up mobs probably have their own mob IDs, hence I would assume there can be a maximum amount of fished up mobs per time in one area. I'm not really sure on this, though. From what I remember from retail camping Devil Manta.. This is probably the case. For moving the mob position, can just do X and Y +1 I would assume. Might make some mobs appear off the side of boats and stuff though :/
Re: Fishing System 2.0
I love how we all remember the devil manta fishing with 30 people around that lakeApocalypse612 wrote:Fished up mobs probably have their own mob IDs, hence I would assume there can be a maximum amount of fished up mobs per time in one area. I'm not really sure on this, though. From what I remember from retail camping Devil Manta.. This is probably the case. For moving the mob position, can just do X and Y +1 I would assume. Might make some mobs appear off the side of boats and stuff though :/
Yes in his instance you could only have 2 pugs and 2 crabs, anything else caught while they were on the surface was either items or the Manta.
Also if two people hooked the same mob - when the other person pulled it up first, typically the 1st person would get a message that released the catch saying, "You lacked the skill to catch" or some other generic statement.
I noticed you (@edgecom) said you had an issue with it attacking the player when pulled up, are the spawning claimed to the fisher?
Re: Fishing System 2.0
thank you lotus I am a derp I did try the enmity but I was using UpadteBaseEnmity witch never worked lol I have it working now I am writing in checks for mob example: if player dies or zones,logs etc
those other functios are for pets manly I did more poking.
here are a couple of screenshots don't mind the text messages I need to update them I am going to do that last
those other functios are for pets manly I did more poking.
here are a couple of screenshots don't mind the text messages I need to update them I am going to do that last
Re: Fishing System 2.0
I have one other question because we want to try and get close to retail I will need to add a column to the char that would only allow a certain number of fish to be caught per day. I never liked so I was thinking of just making the luck percent a global in the server setting that away server ops could change it if they need / want to.
by changing the luck you could make it like retail without having to modify the char table (At least in theory)
by changing the luck you could make it like retail without having to modify the char table (At least in theory)