An example is a mender that is banging out iron, turns to face the player, still banging, says their PlayFlavor (yes, still banging) but sneaks in a bow or smile or wink emote, then immediately goes back to banging iron, spraying sparks and shards of metal all over the players nice magic robes.
[REQ] FaceTarget() stops visual_state
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
[REQ] FaceTarget() stops visual_state
When you Hail an NPC and they are doing something visually (menders for example are smithing), the NPC should turn to face the player and stop what they are doing until the player ignores them for a duration and FaceTarget() expires - then put the NPC back into it's original visual_state.
An example is a mender that is banging out iron, turns to face the player, still banging, says their PlayFlavor (yes, still banging) but sneaks in a bow or smile or wink emote, then immediately goes back to banging iron, spraying sparks and shards of metal all over the players nice magic robes.
An example is a mender that is banging out iron, turns to face the player, still banging, says their PlayFlavor (yes, still banging) but sneaks in a bow or smile or wink emote, then immediately goes back to banging iron, spraying sparks and shards of metal all over the players nice magic robes.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
I attempted to code this as well, in a coding mood today I guess, and again this works for me. Not sure if this is the best way or correct way to do it but have yet to crash or screw up my server with this code.
In Entity.cpp around line 341 find:
And replace with this:
In ZoneServer.cpp around line 1509 find:
Right after it add this:
I know these are rather small things but I hope it is helpful, and the correct way of doing this stuff.
In Entity.cpp around line 341 find:
Code: Select all
if(GetHP() > 0 && target->IsPlayer() && !EngagedInCombat())
GetZone()->AddHeadingTimer(this);Code: Select all
if(GetHP() > 0 && target->IsPlayer() && !EngagedInCombat()){
GetZone()->AddHeadingTimer(this);
SetTempVisualState(GetVisualState());
SetVisualState(0);
}Code: Select all
if(itr->second->Check(false)){
itr->first->SetHeading(itr->first->GetSpawnOrigHeading());Code: Select all
itr->first->SetVisualState(itr->first->GetTempVisualState());
itr->first->SetTempVisualState(0);- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Hey man, every small thing adds to the completion of the emulator. Nice work! Can I ask you to create "patches" though instead of find/replace?
If you use TortoiseSVN, you can right-click on your checked out code and drill down to Create Patch, and it will compare your modified code with what is current SVN, and save to a *.patch file. Then all we have to do is apply that patch rather than hunt and peck for where the changes go.
Keep up the good work. I wish I could code, but I have yet to find that rosetta stone =)
If you use TortoiseSVN, you can right-click on your checked out code and drill down to Create Patch, and it will compare your modified code with what is current SVN, and save to a *.patch file. Then all we have to do is apply that patch rather than hunt and peck for where the changes go.
Keep up the good work. I wish I could code, but I have yet to find that rosetta stone =)
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Is this what you need? Never did this stuff before.
ZoneServer.patch
Entity.patch
Provided links incase you need the actual files. If this is what you needed I will do the same for my other post.
ZoneServer.patch
Code: Select all
Index: zoneserver.cpp
===================================================================
--- zoneserver.cpp (revision 151)
+++ zoneserver.cpp (working copy)
@@ -1507,6 +1507,8 @@
for(itr = heading_timers.begin(); itr != heading_timers.end(); itr++){
if(itr->second->Check(false)){
itr->first->SetHeading(itr->first->GetSpawnOrigHeading());
+ itr->first->SetVisualState(itr->first->GetTempVisualState());
+ itr->first->SetTempVisualState(0);
safe_delete(itr->second);
heading_timers.erase(itr);
break;
Code: Select all
Index: Entity.cpp
===================================================================
--- Entity.cpp (revision 151)
+++ Entity.cpp (working copy)
@@ -338,8 +338,11 @@
if(!target)
return;
FaceTarget(target->GetX(), target->GetZ());
- if(GetHP() > 0 && target->IsPlayer() && !EngagedInCombat())
+ if(GetHP() > 0 && target->IsPlayer() && !EngagedInCombat()){
GetZone()->AddHeadingTimer(this);
+ SetTempVisualState(GetVisualState());
+ SetVisualState(0);
+ }
}
void Entity::SetHPRegen(int16 new_val){
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Yea I noticed you could do that but figured I should post only the changes relative to this topic, will post links for the other changes I made in its respective post. Also I didn't want to group it all together in case I screwed up on one of them.
**EDIT**
Edited my last post in the Race vs Race_Type thread and added the patch files.
**EDIT**
Edited my last post in the Race vs Race_Type thread and added the patch files.
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Who is online
Users browsing this forum: No registered users and 0 guests